-
Notifications
You must be signed in to change notification settings - Fork 11
HDDS-11618. Enable HA mode for OM and SCM #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d5a2af0
HDDS-11618. Enable HA modes for OM and SCM
pyttel 8c2606c
fixed namespace issue
pyttel d7e4322
fixed namespace issue
pyttel 4c27e2d
HDDS-11618. First running version of Helm managed OM HA
pyttel d60087d
HDDS-11618. Removed unused helm manager settings
pyttel c36ace1
Merge branch 'main' of github.com:apache/ozone-helm-charts into impro…
Tejaskriya 591c782
Fix storage persistence, make HA default
Tejaskriya d81262b
newline at end of file
Tejaskriya 3c7d83c
replicas of om and scm 1
Tejaskriya d4aacba
change hook from post to pre install for configmap
Tejaskriya beb5ccf
make HA default
Tejaskriya fb73701
split ha upgrade jobs into different files
Tejaskriya 41f9519
make port and cluster id parameterized
Tejaskriya 7410ec3
make ports parameterized, removed unwanted parameters
Tejaskriya 81e09be
shift bootstrap logic to new file
Tejaskriya c0fb376
use exit code to confirm bootstrap
Tejaskriya 61dd755
dynamic config in checksums for SCM/Datanode/S3G, exponential backoff…
Tejaskriya e7c6aeb
Merge branch 'main' of github.com:apache/ozone-helm-charts into HDDS-…
Tejaskriya 769b221
lint errors
Tejaskriya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| {{- if .Values.om.persistence.enabled }} | ||
| {{- $dnodes := ternary (splitList "," (include "ozone.om.decommissioned.nodes" .)) (list) (ne "" (include "ozone.om.decommissioned.nodes" .)) }} | ||
| {{- $env := concat .Values.env .Values.helm.env }} | ||
| {{- $envFrom := concat .Values.envFrom .Values.helm.envFrom }} | ||
| {{- $nodeSelector := or .Values.helm.nodeSelector .Values.nodeSelector }} | ||
| {{- $affinity := or .Values.helm.affinity .Values.affinity }} | ||
| {{- $tolerations := or .Values.helm.tolerations .Values.tolerations }} | ||
| {{- $securityContext := or .Values.helm.securityContext .Values.securityContext }} | ||
| {{- if (gt (len $dnodes) 0) }} | ||
| {{- range $dnode := $dnodes }} | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: {{ printf "%s-helm-manager-decommission-%s" $.Release.Name $dnode }} | ||
| labels: | ||
| {{- include "ozone.labels" $ | nindent 4 }} | ||
| app.kubernetes.io/component: helm-manager | ||
| annotations: | ||
| "helm.sh/hook": post-upgrade | ||
| "helm.sh/hook-weight": "0" | ||
| "helm.sh/hook-delete-policy": hook-succeeded, hook-failed | ||
| spec: | ||
| backoffLimit: {{ $.Values.helm.backoffLimit }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "ozone.selectorLabels" $ | nindent 8 }} | ||
| app.kubernetes.io/component: helm-manager | ||
| spec: | ||
| containers: | ||
| - name: om-decommission | ||
| image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}" | ||
| imagePullPolicy: {{ $.Values.image.pullPolicy }} | ||
| {{- with $.Values.om.command }} | ||
| command: {{- tpl (toYaml .) $ | nindent 12 }} | ||
| {{- end }} | ||
| args: | ||
| - sh | ||
| - -c | ||
| - | | ||
| set -e | ||
| decommission_finalizer() { | ||
| echo "Init decommission finalizer process..." | ||
| while true; do | ||
| IFS= read -r line; | ||
| echo "$line" | ||
| if echo "$line" | grep -q "Successfully decommissioned OM {{ $dnode }}"; then | ||
| echo "{{ $dnode }} was successfully decommissioned!" | ||
| if [ -d /old{{ $.Values.om.persistence.path }} ]; then | ||
| echo "Delete old data on pvc to enable rescheduling without manual PVC deletion!" | ||
| rm -rf /old{{ $.Values.om.persistence.path }}/* | ||
| echo "Data deleted!" | ||
| fi | ||
rakeshadr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| break; | ||
| fi | ||
| done | ||
| echo "Decommission finalizer process finished!" | ||
| exit 0 | ||
| } | ||
| exec ozone admin om decommission -id={{ $.Values.clusterId }} -nodeid={{ $dnode }} -hostname={{ printf "%s-helm-manager-decommission-%s-svc.%s.svc.cluster.local" $.Release.Name $dnode $.Release.Namespace }} | decommission_finalizer | ||
| env: | ||
| {{- include "ozone.configuration.env" $ | nindent 12 }} | ||
| {{- with $env }} | ||
| {{- tpl (toYaml .) $ | nindent 12 }} | ||
| {{- end }} | ||
| {{- with $envFrom }} | ||
| envFrom: {{- tpl (toYaml .) $ | nindent 12 }} | ||
| {{- end }} | ||
| ports: | ||
| - name: om-rpc | ||
| containerPort: {{ $.Values.om.service.rpcPort }} | ||
| - name: om-ratis | ||
| containerPort: {{ $.Values.om.service.ratisPort }} | ||
| volumeMounts: | ||
| - name: config | ||
| mountPath: {{ $.Values.configuration.dir }} | ||
| - name: om-data | ||
| mountPath: {{ $.Values.om.persistence.path }} | ||
| - name: om-data-old | ||
| mountPath: /old{{ $.Values.om.persistence.path }} | ||
| {{- with $nodeSelector }} | ||
| nodeSelector: {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with $securityContext }} | ||
| securityContext: {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| volumes: | ||
| - name: om-data-old | ||
| persistentVolumeClaim: | ||
| claimName: {{ $.Release.Name}}-om-{{ $dnode }} | ||
| - name: om-data | ||
| emptyDir: { } | ||
| - name: config | ||
| projected: | ||
| sources: | ||
| - configMap: | ||
| name: {{ $.Release.Name }}-ozone | ||
| {{- with $.Values.configuration.filesFrom }} | ||
| {{- tpl (toYaml .) $ | nindent 14 }} | ||
| {{- end }} | ||
| restartPolicy: Never | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {{- if .Values.om.persistence.enabled }} | ||
| {{- $dnodes := ternary (splitList "," (include "ozone.om.decommissioned.nodes" .)) (list) (ne "" (include "ozone.om.decommissioned.nodes" .)) }} | ||
| {{- if (gt (len $dnodes) 0) }} | ||
| {{- range $dnode := $dnodes }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ printf "%s-helm-manager-decommission-%s-svc" $.Release.Name $dnode }} | ||
| labels: | ||
| {{- include "ozone.labels" $ | nindent 4 }} | ||
| app.kubernetes.io/component: helm-manager | ||
| annotations: | ||
| "helm.sh/hook": post-upgrade | ||
| "helm.sh/hook-weight": "-10" | ||
| "helm.sh/hook-delete-policy": hook-succeeded, hook-failed | ||
| spec: | ||
| selector: | ||
| job-name: {{ printf "%s-helm-manager-decommission-%s" $.Release.Name $dnode }} | ||
| ports: | ||
| - name: rpc | ||
| port: {{ $.Values.om.service.rpcPort }} | ||
| targetPort: {{ $.Values.om.service.rpcPort }} | ||
| - name: ratis | ||
| port: {{ $.Values.om.service.ratisPort }} | ||
| targetPort: {{ $.Values.om.service.ratisPort }} | ||
| type: ClusterIP | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.