From 91f64754e8b4ceed396c531f621108ceae3a3bbc Mon Sep 17 00:00:00 2001 From: Arnob kumar saha Date: Tue, 15 Oct 2024 17:11:13 +0600 Subject: [PATCH] Wait using kubectl cli Signed-off-by: Arnob kumar saha --- charts/kubedb-autoscaler/templates/deployment.yaml | 8 +++++--- charts/kubedb-autoscaler/values.yaml | 12 ++++++------ charts/kubedb-dashboard/templates/deployment.yaml | 8 +++++--- charts/kubedb-dashboard/values.yaml | 12 ++++++------ charts/kubedb-ops-manager/templates/deployment.yaml | 8 +++++--- charts/kubedb-ops-manager/values.yaml | 12 ++++++------ charts/kubedb-provisioner/templates/deployment.yaml | 8 +++++--- charts/kubedb-provisioner/values.yaml | 12 ++++++------ .../kubedb-schema-manager/templates/deployment.yaml | 8 +++++--- charts/kubedb-schema-manager/values.yaml | 12 ++++++------ 10 files changed, 55 insertions(+), 45 deletions(-) diff --git a/charts/kubedb-autoscaler/templates/deployment.yaml b/charts/kubedb-autoscaler/templates/deployment.yaml index b148361b7..def5fb212 100644 --- a/charts/kubedb-autoscaler/templates/deployment.yaml +++ b/charts/kubedb-autoscaler/templates/deployment.yaml @@ -58,9 +58,11 @@ spec: - name: wait image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }} imagePullPolicy: {{ .Values.imagePullPolicy }} - args: - - "service" - - "-lapp.kubernetes.io/name=kubedb-webhook-server" + command: + - /bin/sh + - -c + - kubectl wait --for=create -n {{ .Release.Namespace }} service -l 'app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m && + kubectl wait --for=condition=kubedb.com/conversion=true -n {{ .Release.Namespace }} pods -l 'app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m securityContext: {{- toYaml .Values.operator.securityContext | nindent 10 }} resources: diff --git a/charts/kubedb-autoscaler/values.yaml b/charts/kubedb-autoscaler/values.yaml index 8d4327621..10f487745 100644 --- a/charts/kubedb-autoscaler/values.yaml +++ b/charts/kubedb-autoscaler/values.yaml @@ -48,14 +48,14 @@ operator: # requests: # cpu: 100m # memory: 128Mi -# Docker registry containing k8s-wait-for images +# Docker registry containing kubectl-nonroot images waitfor: - # Docker registry used to pull KubeDB enterprise k8s-wait-for image + # Docker registry used to pull KubeDB enterprise kubectl-nonroot image registry: appscode - # KubeDB enterprise k8s-wait-for container image - repository: k8s-wait-for - # KubeDB enterprise k8s-wait-for container image tag - tag: "v2.0" + # KubeDB enterprise kubectl-nonroot container image + repository: kubectl-nonroot + # KubeDB enterprise kubectl-nonroot container image tag + tag: "1.31" # Specify an array of imagePullSecrets. # Secrets must be manually created in the namespace. diff --git a/charts/kubedb-dashboard/templates/deployment.yaml b/charts/kubedb-dashboard/templates/deployment.yaml index 403c2d2d5..d2c39e2f0 100644 --- a/charts/kubedb-dashboard/templates/deployment.yaml +++ b/charts/kubedb-dashboard/templates/deployment.yaml @@ -37,9 +37,11 @@ spec: - name: wait image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }} imagePullPolicy: {{ .Values.imagePullPolicy }} - args: - - "service" - - "-lapp.kubernetes.io/name=kubedb-webhook-server" + command: + - /bin/sh + - -c + - kubectl wait --for=create -n {{ .Release.Namespace }} service -l 'app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m && + kubectl wait --for=condition=kubedb.com/conversion=true -n {{ .Release.Namespace }} pods -l 'app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m securityContext: {{- toYaml .Values.operator.securityContext | nindent 10 }} resources: diff --git a/charts/kubedb-dashboard/values.yaml b/charts/kubedb-dashboard/values.yaml index 08d6dc7f7..8126349eb 100644 --- a/charts/kubedb-dashboard/values.yaml +++ b/charts/kubedb-dashboard/values.yaml @@ -46,14 +46,14 @@ operator: # requests: # cpu: 100m # memory: 128Mi -# Docker registry containing k8s-wait-for images +# Docker registry containing kubectl-nonroot images waitfor: - # Docker registry used to pull KubeDB enterprise k8s-wait-for image + # Docker registry used to pull KubeDB enterprise kubectl-nonroot image registry: appscode - # KubeDB enterprise k8s-wait-for container image - repository: k8s-wait-for - # KubeDB enterprise k8s-wait-for container image tag - tag: "v2.0" + # KubeDB enterprise kubectl-nonroot container image + repository: kubectl-nonroot + # KubeDB enterprise kubectl-nonroot container image tag + tag: "1.31" # Specify an array of imagePullSecrets. # Secrets must be manually created in the namespace. diff --git a/charts/kubedb-ops-manager/templates/deployment.yaml b/charts/kubedb-ops-manager/templates/deployment.yaml index 1330dfefb..cdf754969 100644 --- a/charts/kubedb-ops-manager/templates/deployment.yaml +++ b/charts/kubedb-ops-manager/templates/deployment.yaml @@ -58,9 +58,11 @@ spec: - name: wait image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }} imagePullPolicy: {{ .Values.imagePullPolicy }} - args: - - "service" - - "-lapp.kubernetes.io/name=kubedb-webhook-server" + command: + - /bin/sh + - -c + - kubectl wait --for=create -n {{ .Release.Namespace }} service -l 'app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m && + kubectl wait --for=condition=kubedb.com/conversion=true -n {{ .Release.Namespace }} pods -l 'app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m securityContext: {{- toYaml .Values.operator.securityContext | nindent 10 }} resources: diff --git a/charts/kubedb-ops-manager/values.yaml b/charts/kubedb-ops-manager/values.yaml index 3d3746863..4a5b2284a 100644 --- a/charts/kubedb-ops-manager/values.yaml +++ b/charts/kubedb-ops-manager/values.yaml @@ -53,14 +53,14 @@ operator: # requests: # cpu: 100m # memory: 128Mi -# Docker registry containing k8s-wait-for images +# Docker registry containing kubectl-nonroot images waitfor: - # Docker registry used to pull KubeDB enterprise k8s-wait-for image + # Docker registry used to pull KubeDB enterprise kubectl-nonroot image registry: appscode - # KubeDB enterprise k8s-wait-for container image - repository: k8s-wait-for - # KubeDB enterprise k8s-wait-for container image tag - tag: "v2.0" + # KubeDB enterprise kubectl-nonroot container image + repository: kubectl-nonroot + # KubeDB enterprise kubectl-nonroot container image tag + tag: "1.31" # Specify an array of imagePullSecrets. # Secrets must be manually created in the namespace. diff --git a/charts/kubedb-provisioner/templates/deployment.yaml b/charts/kubedb-provisioner/templates/deployment.yaml index a82c28353..018119767 100644 --- a/charts/kubedb-provisioner/templates/deployment.yaml +++ b/charts/kubedb-provisioner/templates/deployment.yaml @@ -58,9 +58,11 @@ spec: - name: wait image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }} imagePullPolicy: {{ .Values.imagePullPolicy }} - args: - - "service" - - "-lapp.kubernetes.io/name=kubedb-webhook-server" + command: + - /bin/sh + - -c + - kubectl wait --for=create -n {{ .Release.Namespace }} service -l 'app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m && + kubectl wait --for=condition=kubedb.com/conversion=true -n {{ .Release.Namespace }} pods -l 'app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m securityContext: {{- toYaml .Values.operator.securityContext | nindent 10 }} resources: diff --git a/charts/kubedb-provisioner/values.yaml b/charts/kubedb-provisioner/values.yaml index 77b93b4ad..03b834aea 100644 --- a/charts/kubedb-provisioner/values.yaml +++ b/charts/kubedb-provisioner/values.yaml @@ -53,14 +53,14 @@ operator: # requests: # cpu: 100m # memory: 128Mi -# Docker registry containing k8s-wait-for images +# Docker registry containing kubectl-nonroot images waitfor: - # Docker registry used to pull KubeDB enterprise k8s-wait-for image + # Docker registry used to pull KubeDB enterprise kubectl-nonroot image registry: appscode - # KubeDB enterprise k8s-wait-for container image - repository: k8s-wait-for - # KubeDB enterprise k8s-wait-for container image tag - tag: "v2.0" + # KubeDB enterprise kubectl-nonroot container image + repository: kubectl-nonroot + # KubeDB enterprise kubectl-nonroot container image tag + tag: "1.31" # Specify an array of imagePullSecrets. # Secrets must be manually created in the namespace. diff --git a/charts/kubedb-schema-manager/templates/deployment.yaml b/charts/kubedb-schema-manager/templates/deployment.yaml index cb9059a84..09e250e16 100644 --- a/charts/kubedb-schema-manager/templates/deployment.yaml +++ b/charts/kubedb-schema-manager/templates/deployment.yaml @@ -58,9 +58,11 @@ spec: - name: wait image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }} imagePullPolicy: {{ .Values.imagePullPolicy }} - args: - - "service" - - "-lapp.kubernetes.io/name=kubedb-webhook-server" + command: + - /bin/sh + - -c + - kubectl wait --for=create -n {{ .Release.Namespace }} service -l 'app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m && + kubectl wait --for=condition=kubedb.com/conversion=true -n {{ .Release.Namespace }} pods -l 'app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name=kubedb-webhook-server' --timeout=5m securityContext: {{- toYaml .Values.operator.securityContext | nindent 10 }} resources: diff --git a/charts/kubedb-schema-manager/values.yaml b/charts/kubedb-schema-manager/values.yaml index 6a495244e..ace9bbd50 100644 --- a/charts/kubedb-schema-manager/values.yaml +++ b/charts/kubedb-schema-manager/values.yaml @@ -46,14 +46,14 @@ operator: # requests: # cpu: 100m # memory: 128Mi -# Docker registry containing k8s-wait-for images +# Docker registry containing kubectl-nonroot images waitfor: - # Docker registry used to pull KubeDB enterprise k8s-wait-for image + # Docker registry used to pull KubeDB enterprise kubectl-nonroot image registry: appscode - # KubeDB enterprise k8s-wait-for container image - repository: k8s-wait-for - # KubeDB enterprise k8s-wait-for container image tag - tag: "v2.0" + # KubeDB enterprise kubectl-nonroot container image + repository: kubectl-nonroot + # KubeDB enterprise kubectl-nonroot container image tag + tag: "1.31" # Specify an array of imagePullSecrets. # Secrets must be manually created in the namespace.