Core Platform v8.0 - Deployment Process

Contents

  1. Overview
  2. Existing Environment Migration Using SmartPkg
    1. Smartpkg Installation in bastion
    2. kubeseal Installation in Bastion Machine
    3. Sealed Secret Controller Installation
    4. 4. Generate sealed secret from the existing secret
    5. Take a backup for all the helm manifests
    6. Delete helm releases
  3. Application Deployment
    1. Update smartpkg in bastion
    2. Create product and env files
  4. Create or update new sealed-secret
  5. Secret Additions As per Release
    1. Platform 8.0
    2. Platform 7.8
  6. Deploy Core Platform package

Overview

SmartOps product deployment configuration has been revised to support better flexibility and configuration. Products will be packaged in “Smart package” and will be deployable using tool “smartpkg”. This document covers instructions to install core-platform 8.0.1 using smartpkg.

Same set of instructions can be followed hereafter except the migration steps, which applies only for first time.

Existing Environment Migration Using SmartPkg

Smartpkg Installation in bastion

Smartpkg is a python-based tool to help managing and deploying smartops Product packages based on helm charts. This is a prerequisite to deploy smartOps products. SmartPkg should be installed in machine from where the Kubernetes deployment happens which is usually a bastion machine.

Below are the pre-requisites for installing smartpkg:

Installation Steps

  1. Login to the machine you want to install smartpkg 

  2. Execute => sudo apt-get install python3-pip

  3. Execute => python3 -m pip install ConfigArgParse wheel pyyaml jsonschema

  4. Execute => python3 -m pip install smartpkg==0.0.17 -i https://ci3r7qwshs5jhr6j34yykoi4f3p7f2t3546zju65dmxzkzbl4d5q@pkgs.dev.azure.com/USTInnovationEngineering/SmartOps/_packaging/python-lib/pypi/simple --

  5. Verify the installation by => smartpkg –help

Note: If smartpkg: command not found error shows up, logout and login or open a new session 

kubeseal Installation in Bastion Machine

echo "Installing kubeseal..." wget https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.15.0/kubeseal-linux-amd64 -O kubeseal sudo install -m 755 kubeseal /usr/local/bin/kubeseal kubeseal --version

Sealed Secret Controller Installation

Reference Link: https://github.com/bitnami-labs/sealed-secrets#installation

  1. Sealed Secrets is an open-source tool and it is composed of two parts

    1. A cluster-side controller / operator

    2. A client-side utility: kubeseal

  2. The kubeseal utility uses asymmetric crypto to encrypt secrets that only the controller can decrypt

  3. These encrypted secrets are encoded in a SealedSecret resource. Here is how it looks an example:

    apiVersion: bitnami.com/v1alpha1

    kind: SealedSecret

    metadata:

      name: mysecret

      namespace: mynamespace

    spec:

      encryptedData:

        foo: AgBy3i4OJSWK+PiTySYZZA9rO43cGDEq.....

  4. Install sealed-secret-controller after creating namespace from the jfrog

    helm repo add smartops-helm-virtual https://ustsmartops.jfrog.io/artifactory/smartops-helm-virtual --username <jfrog-username> --password <jfrog-password>

    kubectl create ns sealed-secrets-controller –context kc-smartops-platform-qa01

    helm upgrade --install -n sealed-secrets-controller sealed-secrets-controller-rel smartops-helm-virtual/sealed-secret-controller --version 0.0.0 --set global.namespace=sealed-secrets-controller --kube-context kc-smartops-platform-qa01

     

 

4. Generate sealed secret from the existing secret

 

 

Take a backup for all the helm manifests

chmod +x manifest.sh

bash manifest.sh

helm get manifest smartops-logmon-logmon-rel -n smartops-logmon --kube-context kc-smartops-platform-qa01 > cp-backup/smartops-logmon.yaml

Delete helm releases

chmod +x delete_release.sh

bash delete_release.sh

 

helm uninstall smartops-logmon-logmon-rel -n smartops-logmon --kube-context kc-smartops-platform-qa01

helm uninstall sealed-secrets-controller-rel -n sealed-secrets-controller --kube-context kc-smartops-platform-qa01

helm uninstall smartops-common-gpu-setup-rel -n smartops-common --kube-context kc-smartops-platform-qa01

helm uninstall smartops-common-secret-setup-rel  -n smartops-common --kube-context kc-smartops-platform-qa01

 

Application Deployment

Update smartpkg in bastion

python3 -m pip install smartpkg==0.0.17 -i https://ci3r7qwshs5jhr6j34yykoi4f3p7f2t3546zju65dmxzkzbl4d5q@pkgs.dev.azure.com/USTInnovationEngineering/SmartOps/_packaging/python-lib/pypi/simple --

Create product and env files

mkdir core-platform-prod && cd core-platform-prod

packagecore-platform

version8.0.1-34

nameSpacesmartopsv1-stg01,smartops-logmon,sealed-secrets-controller

helmCharts:

  cluster-config:

    helmParams--namespace smartopsv1-stg01 --timeout 120s

    deploy"true"

    values:

      envenv.yaml

  logmon:

    helmParams--namespace smartops-logmon --timeout 120s

    deploy"false"

  smartops-infra:

    helmParams--namespace smartopsv1-stg01 --timeout 120s

    deploy"true"

    values:

      envenv.yaml,env_secrets.yaml

  core-platform:

    helmParams--namespace smartopsv1-stg01 --timeout 20m0s

    deploy"true"

    values:

      envenv.yaml

  rhub:

    helmParams--namespace smartopsv1-stg01 --timeout 20m0s

    deploy"true"

    values:

      envenv.yaml

  xd:

    helmParams--namespace smartopsv1-stg01 --timeout 20m0s

    deploy"true"

    values:

      envenv.yaml

 

Picture 18

For References 

Create or update new sealed-secret

echo -n "$SECRET_VALUE" | kubectl create secret generic ${NAMESPACE}-secret -n ${NAMESPACE}  --context  $KUBE_CONTEXT --dry-run=client --from-file=${NAMESPACE}-$SECRET_KEY=/dev/stdin -o json | kubeseal --controller-namespace=sealed-secrets-controller --controller-name=sealed-secrets-controller --context  $KUBE_CONTEXT --format=yaml > ${NAMESPACE}-sealed-secret.yaml

Picture 17

Note - for updating new secrets follow the same steps above and update sealed-secrets block in env-secrets.yaml and redeploy.

 

Secret Additions As per Release

Platform 8.0

<namespace>-rabbitmq-keda-url: amqp://admin:kJ4zK9nC3bT4qN9w@<namespace>-rabbitmq. <namespace>.svc.cluster.local:5672

Platform 7.8

<namespace>-rhub-adapters-rabbitmq-amqp-password with value “pqmaqmtibbar”

<namespace>-rhub-adapters-rabbitmq-amqp-username with value “rabbitmq_amqp”

<namespace>-app-to-app-clones-password with value “M@$terClones”

<namespace>-app-to-app-clones-username with value “clones”

<namespace>-app-to-app-ihub-password with value “M@$terIhub”

<namespace>-app-to-app-ihub-username with value “ihub”

<namespace>-rhub-adapters-api-agent-password with value “tnegaipa”

<namespace>-rhub-adapters-api-agent-username with value “api_agent”

 

Deploy Core Platform package

 

Note: Please ensure that data backup is taken and validated as part of Pre-Deployment Activities

Run the smartpkg deploy command from the path where values folder and product.yaml file are present.

smartpkg clean,deploy --kubeContext <kubeconfig> --jfrogUser ${JFROG_USERNAME}