/
SAMi Portal Upgradation

SAMi - Smart API Marketplace Documentation

SAMi Portal Upgradation

 

SAMi Portal Upgradation

Step 1 - Update the Environment Configuration file

Update the Environment configuration file in case there has been any change from the previous configuration file

This is an optional Step and only needs to be performed in case of any changes from previous installation.

Step 2 - Create a K8 Secret for the Cluster to Connect to the SIDGS Docker Registry

The SAMi Product team will provision and provide an AWS Client ID and Secret that need to be used for the below and replace the region name

with the appropriate

aws configure --region <region-name>

Name

Value

Name

Value

AWS Access Key ID

Ref Provided Info

AWS Secret Access Key

Ref Provided Info

Default Region Name

us-east-1

Default Output format

json

Configure Secret

setting the secrets with ECR creds to pull the images.

  1. The below step will set the namespace environment variable followed by creating the namespace

namespace=${K8_NAMESPACE:-ns_name} kubectl create ns $namespace

Modify the ns_name with the namespace name used while setting up SAMi portal.

For instance, please find the example below

namespace=${K8_NAMESPACE:-sam-portal-system} kubectl create ns $namespace

The output should look like the following:

Kubectl get ns | grep "sam-portal-system" sam-portal-system
  1. Create secrets with ECR creds to pull the images.

kubectl create secret docker-registry sam-regcred \ --docker-server= https://ACCOUNT_ID.dkr.ecr.REGION_NAME.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n $namespace

Please find the example below.

kubectl create secret docker-registry sam-regcred \ --docker-server= https://xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n $namespace

The output should look like the following:

kubectl create secret docker-registry sam-regcred \ --docker-server= https://xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n $namespace secret/sam-regcred created

Step 3 - Download the Latest HELM chart

  1. Download the HELM Chart, which is used for the upgrade. The below sets the creds to download helm charts.

    aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/sidgs export HELM_EXPERIMENTAL_OCI=1 helm pull oci://public.ecr.aws/sidgs/sam-portal-chart --version 3.0.1

Change the CHART_VERSION to the desired version, and upon successfully running the above command, sam-portal-chart-3.0.1.tgz should be downloaded.

Step 4 - Upgrade the portal

  1. Validate that Kubectl is available and connected to the Kubernetes cluster

  2. Validate that the namespace ‘sam-portal-system’ is available and reachable by running the below command

kubectl get ns | grep "ns-name" kubectl get pods -n ns-name

Please refer to the example below for more details.

kubectl get ns | grep "sam-portal-system" kubectl get pods -n sam-portal-system

The output should look like the following:

kubectl get ns | grep "sam-portal-system" sam-portal-system kubectl get pods -n sam-portal-system No resources found in test namespace.
  1. Validate the sam-portal-values.yaml using the steps given below:

    helm upgrade sam-portal ./path-to-chart-file \ -f <path-to the-values-file.yaml> \ -n $namespace \ --dry-run

    Update the path-to-chart file to the latest chart, and the complete Manifest is printed upon successful interpretation. Please refer to the example below for more details

helm upgrade sam-portal ./sam-portal-chart-3.0.1.tgz \ -f values.yaml \ -n sam-portal-system \ --dry-run
  1. Install the sam-portal by running step 4 without the dry-run flag

    helm upgrade sam-portal ./sam-portal-chart-3.0.1.tgz \ -f <path-to the-values-file.yaml> \ -n $namespace

Please refer to the example below for more details

helm upgrade sam-portal ./sam-portal-chart-3.0.1.tgz \ -f values.yaml \ -n sam-portal-system

The output should look like the following:

NAME: sam-portal NAMESPACE: sam-portal-system STATUS: deployed REVISION: 2

SAMi Integration Services Upgradation

Step 1 - Update the Configuration file

Create the Environment Configuration file

activemq : image: tag: Latest-Image-TAG sky-data-services-api : image: tag: Latest-Image-TAG env: # non sensitive variables normal: DB_HOST: <fqdn> DB_PORT: 5432 DB_NAME: <DB-name> DB_TYPE: postgresql SPRING_PROFILES_ACTIVE: rds AMQ_BROKER_URL: tcp://sky-amq:61616 SPRING_JPA_DATABASE-PLATFORM: org.hibernate.dialect.PostgreSQLDialect LIFERAY_URL: <liferay-url> MANAGEMENT_URL: https://<integration_url>/vsp/api/vds # Load Secrets from 1 secret ref secret.name secret: DB_USERNAME: <username> DB_PASSWORD: <password> # Secret to Create with sensitive data secret: name: sky-api-service-credential create: true # name of Apigee Org to Use apigee: org: <org-name> image: tag: <image-tag-version> global: gateway: protocol: "HTTP" port: number: 80 SecurePort: number: 443 protocol: "HTTP" secure: enabled: true credentialName: sam-portal-tls domain: use: true name: <integration_url>

The sample file is shown below:

activemq : image: tag: "3.0.1" sky-data-services-api : image: tag: 3.0.1 env: # non sensitive variables normal: DB_HOST: xxxx-dev.cjip1jjvpzht.us-east-1.rds.amazonaws.com DB_PORT: 5432 DB_NAME: db-integration DB_TYPE: postgresql SPRING_PROFILES_ACTIVE: rds AMQ_BROKER_URL: tcp://sky-amq:61616 SPRING_JPA_DATABASE-PLATFORM: org.hibernate.dialect.PostgreSQLDialect LIFERAY_URL: http://liferay.demo.global.cloud MANAGEMENT_URL: https://integration.demo.lobal.cloud/vsp/api/vds # Load Secrets from 1 secret ref secret.name secret: DB_USERNAME: xxxxxxx DB_PASSWORD: xxxxxxx # Secret to Create with sensitive data secret: name: sky-api-service-credential create: true # name of Apigee Org to Use apigee: org: vspa image: tag: 3.0.1 global: gateway: protocol: "HTTP" port: number: 80 SecurePort: number: 443 protocol: "HTTP" secure: enabled: false credentialName: sam-portal-tls domain: use: true name: integration.demo.global.cloud

The table below provides the details regarding the fields

Name

Description

Name

Description

DB_USERNAME

database username for jdbc connection

DB_PASSWORD

database user password for jdbc connection

DB_HOST

database hostname for postgres connection

DB_PORT

database port for jdbc connection

DB_NAME

database named for jdbc connection

liferay-url

liferay Portal url not including http:// or https:// for example: sam-portal-dev.demo.global.cloud

INTEGRATION_URL

URL used for integration services

Image-tag

docker image tag used for deploying the services

activemq-image-tag

docker image tag used for deploying activemq

Latest-Image-TAG

The Image version to which the upgrade will be done.

  1. Download the HELM Chart
    The below sets the creds to download helm charts.

    aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/sidgs export HELM_EXPERIMENTAL_OCI=1 helm pull oci://public.ecr.aws/sidgs/sky-gateway-api-chart --version Latest-chart-version

Change the “Latest-chart-version” to desired chart version

  1. Validate that Kubectl is available and connected to the SAM K8s Cluster

  2. Validate that the namespace ‘sam-int-system’ is available and reachable by running the below command

kubectl get ns| grep "<ns-name>" kubectl get pods -n <ns-name>

Please refer to the example below for more details.

kubectl get ns sam-int-system| grep "sam-int-system" kubectl get pods -n sam-int-system

The output should look like below.

kubectl get ns sam-int-system| grep "sam-int-system sam-int-system Active 26s

Step 2 - Create a K8 Secret for the K8 Cluster to Connect to the SIDGS Docker Registry

Create a K8 Secret for the K8 Cluster to Connect to the SIDGS Docker Registry

Configure AWS

The SAMi Product team will provision and provide an AWS Client ID and Secret that need to be used for the below

aws configure --region <region-name>

Please update the region-name accordingly in the above command

Name

Value

Name

Value

AWS Access Key ID

Ref Provided Info

AWS Secret Access Key

Ref Provided Info

Default Region Name

us-east-1

Default Output format

json

Configure Secret

  1. Create secrets with ECR creds to pull the images.

kubectl create secret docker-registry sam-regcred \ --docker-server= https://ACCOUNT_ID.dkr.ecr.REGION_NAME.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n namespace

Change the “namespace” to the namespace used while setting up SAMi Integration Services

Please find the example below

kubectl create secret docker-registry sam-regcred \ --docker-server= https://xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n namespace

The output should look like the following:

kubectl create secret docker-registry sam-regcred \ --docker-server= https://xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com \ --docker-username=AWS \ --docker-password=`aws ecr get-login-password` \ -n namespace secret/sam-regcred created

Step 3 - Download the HELM charts and Install Integration system

  1. Download the HELM Chart

    aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/sidgs export HELM_EXPERIMENTAL_OCI=1 helm pull oci://public.ecr.aws/sidgs/sky-gateway-api-chart --version 3.0.1

    Update the “Latest-chart-version” to the desired chart version. This will result in creating the file sky-gateway-api-chart-3.0.1.tgz in the current working directory.

  2. Validate that Kubectl is available and connected to the K8 Cluster

  3. Validate the sam-integration-values.yaml using the steps below

    helm upgrade sky-gateway ./sky-gateway-api-chart-3.0.1.tgz \ -f full_path/values.yaml \ -n namespace\ --dry-run

    Please refer to the sample below

helm ugrade sky-gateway ./sky-gateway-api-chart-3.0.1.tgz \ -f values.yaml \ -n namespace \ --dry-run

Upon successful interpretation, the complete Manifest is printed

  1. Upgrade sam-integration as shown below

    helm upgrade sky-gateway ./sky-gateway-api-chart-3.0.1.tgz \ -f <full_path>/values.yaml \ -n namespace

The sample is mentioned below:

helm upgrade sky-gateway ./sky-gateway-api-chart-3.0.1.tgz \ -f values.yaml \ -n sam-int-system

The output should look like the following:

Name: sky-gateway NAMESPACE: sam-int-system STATUS: deployed REVISION: 2 TEST SUITE: None

 

Related content

© 2024 SID Global Solutions | https://www.mysami.io | https://www.sidgs.com | +1 484-218-0021