Documentation PortalBack to Self Assist PortalBack
Documentation Portal
Contents

Config Map and Ingress Changes - V 4.5

Setup configmaps

Configmaps play a vital role in the migration process by storing configuration data for applications running in Kubernetes clusters. It is necessary to set up the required configmaps to ensure a smooth transition of the application to the AWS environment.

  • Separate Configurations for Primary and DR Environments
    If you have different configurations for your primary and DR environments, follow these steps:

    1. Open your values.yml file in a text editor.
    2. Locate the section where config maps are defined.
    3. Create a single config under envvars with name: "only", as shown below or [refer](https://dev.azure.com/netapp-ngdc/devexp/git/nodejs?path=/devexp-nodejs/values.yaml&version=GBrelease/v4.5&line=42&lineEnd=52&lineStartColumn=1&lineEndColumn=43&lineStyle=plain&_a=contents):
    env_vars:
      - name: "primary"
        configs:
          INSTANCE: "primary"
          DB_HOST: "mongo1-dnt.abc-db-mongo1-dnt.svc.cluster.local"
          API_ENDPOINT: "https://dummy-api.netapp.com"
      - name: "dr"
        configs:
          INSTANCE: "dr"
          DB_HOST: "mongo1-dnt.abc-db-mongo1-dnt.svc.cluster.local"
          API_ENDPOINT: "https://dummy-api-dr.netapp.com"
    1. Create a file named - configmap.yaml under templates folder and copy the below contents.
    {{- if .Values.env_vars }}
    {{- range $configmaps := .Values.env_vars }}
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: {{ printf "%s-%s" (include "app.fullname" $) ( $configmaps.name ) | quote }}
      labels:
        {{- include "app.labels" $ | nindent 4 }}
    data: 
    {{- range $key, $val := $configmaps.configs }}
    {{ $key | quote | indent 4}}: {{ $val | quote }}
    {{- end }}
    {{- end }}
    {{- end }}
    1. Add the primary config map referance in deployment.yaml - refer
    envFrom:
    {{- if .Values.env_vars }}
      - configMapRef:
          name: {{ include "app.fullname" . }}-primary
    {{- end }}
  • Config Map if there are no Changes during DR Transition
    If you do not have any configuration changes during the DR transition and want to reuse the same config map, follow these steps:

    1. Open your values.yml file in a text editor.
    2. Locate the section where config maps are defined.
    3. Create a single config under env_vars with name: "only", as shown below:
    env_vars:
    - name: "only"
      configs:
        INSTANCE: "primary"
        DB_HOST: "mongo1-dnt.abc-db-mongo1-dnt.svc.cluster.local"

Make Ingress Changes

Update the Ingress configurations to allow both primary and DR URLs for services. By allowing multiple URLs for each service, including DR URLs, you can test services during the DR validation state before the final cutover. This step enhances the resilience and reliability of the application.

  1. Ambassador will be unsupported from Dec 2023 and is replaced by Kong. You upgrade CloudOne DevOps pipeline to version 4.5 using Pipeline upgrade tool. To learn about configuration changes required to enable kong within CloudOne please refer to Enabling kong within CloudOne.
  2. Add both primary and dr URLs in your values.hostspace/values/values.hostspace.yml files - refer
ingressEndpoints:
- # Dynamically Generate URL
  internal:
    enabled: true
    mappings:
    - prefix: "/"
      rewrite: "/"
  external:
    enabled: false
    mappings:
    - prefix: "/"
      rewrite: "/"
- host: nodejs.netapp.com
  internal:
    enabled: true
    mappings:
    - prefix: "/nodejs"
      rewrite: "/"
  external:
    enabled: false
    mappings:
    - prefix: "/nodejs"
      rewrite: "/"
- host: nodejs-dr.netapp.com
  internal:
    enabled: true
    mappings:
    - prefix: "/nodejs"
      rewrite: "/"
  external:
    enabled: false
    mappings:
    - prefix: "/nodejs"
      rewrite: "/"