DR Manual Upgrade (V4.4)
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:- Open your
values.yml filein a text editor. - Locate the section where config maps are defined.
- Create a single config under env_vars with
name: "only", as shown below or refer:
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"- Create a file named -
configmap.yamlundertemplates folderand 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 }}- Add the primary config map referance in
deployment.yaml- refer
envFrom:
{{- if .Values.env_vars }}
- configMapRef:
name: {{ include "app.fullname" . }}-primary
{{- end }} - Open your
-
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:- Open your
values.ymlfile in a text editor. - Locate the section where config maps are defined.
- 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" - Open your
Make Ambassador Changes
Update the Ambassador 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.
-
Replace your ambassador.yaml file with the code in this link
-
Add both primary and dr URLs in your
values.hostspace/values/values.workspace.ymlfiles - refer
ingressEndpoints:
- # Dynamically Generate URL
internal:
enabled: true
mappings:
- prefix: "/"
rewrite: "/"
external:
enabled: true
mappings:
- prefix: "/"
rewrite: "/"
- host: nodejs.netapp.com
internal:
enabled: true
mappings:
- prefix: "/nodejs"
rewrite: "/"
external:
enabled: true
mappings:
- prefix: "/nodejs"
rewrite: "/"
- host: nodejs-dr.netapp.com
internal:
enabled: true
mappings:
- prefix: "/nodejs"
rewrite: "/"
external:
enabled: true
mappings:
- prefix: "/nodejs"
rewrite: "/"