From 65de349d58320f54e6145610b1907f007200e1da Mon Sep 17 00:00:00 2001 From: Steve Taylor Date: Fri, 22 Feb 2019 09:25:48 -0700 Subject: [PATCH] Move ceph-mon's checkPGs cron job to ceph-client - Move the cronjob from ceph-mon to ceph-client - Adding ceph-rbd-pool job as dependencies for cronjob - checkPGs manifest set to true so it will always run in gate. Co-Authored-By: Chinasubbareddy Mallavarapu , Renis Makadia Change-Id: I9855d8d22265e78c7e2f5fa7ece69c9ff532ecb2 --- .../templates/bin/utils/_checkPGs.py.tpl | 0 .../templates/bin/utils/_checkPGs.sh.tpl | 4 ++-- ceph-client/templates/configmap-bin.yaml | 6 ++++++ .../templates/cronjob-checkPGs.yaml | 18 +++++++++------- ceph-client/templates/deployment-mgr.yaml | 8 +++++++ ceph-client/values.yaml | 21 +++++++++++++++++++ ceph-mon/templates/configmap-bin.yaml | 4 ---- ceph-mon/templates/daemonset-mon.yaml | 8 ------- ceph-mon/values.yaml | 15 ------------- tools/deployment/multinode/030-ceph.sh | 1 - .../deployment/osh-infra-logging/020-ceph.sh | 1 - 11 files changed, 47 insertions(+), 39 deletions(-) rename {ceph-mon => ceph-client}/templates/bin/utils/_checkPGs.py.tpl (100%) rename {ceph-mon => ceph-client}/templates/bin/utils/_checkPGs.sh.tpl (78%) rename {ceph-mon => ceph-client}/templates/cronjob-checkPGs.yaml (90%) diff --git a/ceph-mon/templates/bin/utils/_checkPGs.py.tpl b/ceph-client/templates/bin/utils/_checkPGs.py.tpl similarity index 100% rename from ceph-mon/templates/bin/utils/_checkPGs.py.tpl rename to ceph-client/templates/bin/utils/_checkPGs.py.tpl diff --git a/ceph-mon/templates/bin/utils/_checkPGs.sh.tpl b/ceph-client/templates/bin/utils/_checkPGs.sh.tpl similarity index 78% rename from ceph-mon/templates/bin/utils/_checkPGs.sh.tpl rename to ceph-client/templates/bin/utils/_checkPGs.sh.tpl index 3ab82c35b..dcede9ac2 100644 --- a/ceph-mon/templates/bin/utils/_checkPGs.sh.tpl +++ b/ceph-client/templates/bin/utils/_checkPGs.sh.tpl @@ -18,6 +18,6 @@ limitations under the License. set -ex -monPod=$(kubectl get pods --namespace=${DEPLOYMENT_NAMESPACE} --selector=application=ceph --selector=component=mon --output=jsonpath={.items[0].metadata.name} 2>/dev/null) +mgrPod=$(kubectl get pods --namespace=${DEPLOYMENT_NAMESPACE} --selector=application=ceph --selector=component=mgr --output=jsonpath={.items[0].metadata.name} 2>/dev/null) -kubectl exec -t ${monPod} --namespace=${DEPLOYMENT_NAMESPACE} -- /tmp/utils-checkPGs.py All 2>/dev/null +kubectl exec -t ${mgrPod} --namespace=${DEPLOYMENT_NAMESPACE} -- /tmp/utils-checkPGs.py All 2>/dev/null diff --git a/ceph-client/templates/configmap-bin.yaml b/ceph-client/templates/configmap-bin.yaml index 39a9b0fa8..f5227aa06 100644 --- a/ceph-client/templates/configmap-bin.yaml +++ b/ceph-client/templates/configmap-bin.yaml @@ -54,4 +54,10 @@ data: {{ tuple "bin/utils/_checkDNS.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} utils-checkDNS_start.sh: | {{ tuple "bin/utils/_checkDNS_start.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + + utils-checkPGs.py: | +{{ tuple "bin/utils/_checkPGs.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + + utils-checkPGs.sh: | +{{ tuple "bin/utils/_checkPGs.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- end }} diff --git a/ceph-mon/templates/cronjob-checkPGs.yaml b/ceph-client/templates/cronjob-checkPGs.yaml similarity index 90% rename from ceph-mon/templates/cronjob-checkPGs.yaml rename to ceph-client/templates/cronjob-checkPGs.yaml index 052d78ad5..f24a28f2b 100644 --- a/ceph-mon/templates/cronjob-checkPGs.yaml +++ b/ceph-client/templates/cronjob-checkPGs.yaml @@ -73,7 +73,9 @@ spec: spec: serviceAccountName: {{ $serviceAccountName }} nodeSelector: - {{ .Values.labels.mon.node_selector_key }}: {{ .Values.labels.mon.node_selector_value }} + {{ .Values.labels.mgr.node_selector_key }}: {{ .Values.labels.mgr.node_selector_value }} + initContainers: +{{ tuple $envAll "pool_checkpgs" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 12 }} containers: - name: {{ $serviceAccountName }} {{ tuple $envAll "ceph_config_helper" | include "helm-toolkit.snippets.image" | indent 12 }} @@ -85,15 +87,15 @@ spec: command: - /tmp/utils-checkPGs.sh volumeMounts: - - name: ceph-mon-bin + - name: ceph-client-bin mountPath: /tmp/utils-checkPGs.py subPath: utils-checkPGs.py readOnly: true - - name: ceph-mon-bin + - name: ceph-client-bin mountPath: /tmp/utils-checkPGs.sh subPath: utils-checkPGs.sh readOnly: true - - name: ceph-mon-etc + - name: ceph-client-etc mountPath: /etc/ceph/ceph.conf subPath: ceph.conf readOnly: true @@ -116,13 +118,13 @@ spec: restartPolicy: Never hostNetwork: true volumes: - - name: ceph-mon-bin + - name: ceph-client-bin configMap: - name: ceph-mon-bin + name: ceph-client-bin defaultMode: 0555 - - name: ceph-mon-etc + - name: ceph-client-etc configMap: - name: ceph-mon-etc + name: ceph-client-etc defaultMode: 0444 - name: ceph-client-admin-keyring secret: diff --git a/ceph-client/templates/deployment-mgr.yaml b/ceph-client/templates/deployment-mgr.yaml index 32f628a66..82719056d 100644 --- a/ceph-client/templates/deployment-mgr.yaml +++ b/ceph-client/templates/deployment-mgr.yaml @@ -157,6 +157,14 @@ spec: - name: pod-run mountPath: /run readOnly: false + - name: ceph-client-bin + mountPath: /tmp/utils-checkPGs.py + subPath: utils-checkPGs.py + readOnly: true + - name: ceph-client-bin + mountPath: /tmp/utils-checkPGs.sh + subPath: utils-checkPGs.sh + readOnly: true volumes: - name: pod-etc-ceph emptyDir: {} diff --git a/ceph-client/values.yaml b/ceph-client/values.yaml index 6f0c7abc9..3fecfc526 100644 --- a/ceph-client/values.yaml +++ b/ceph-client/values.yaml @@ -122,6 +122,20 @@ network: public: 192.168.0.0/16 cluster: 192.168.0.0/16 +jobs: + pool_checkPGs: + # Execute every 15 minutes + cron: "*/15 * * * *" + history: + # Number of successful job to keep + successJob: 1 + # Number of failed job to keep + failJob: 1 + concurrency: + # Skip new job if previous job still active + execPolicy: Forbid + startingDeadlineSecs: 60 + conf: features: mds: true @@ -319,6 +333,12 @@ dependencies: services: - endpoint: internal service: ceph_mon + pool_checkpgs: + jobs: + - ceph-rbd-pool + services: + - endpoint: internal + service: ceph_mgr checkdns: services: - endpoint: internal @@ -449,3 +469,4 @@ manifests: job_rbd_pool: true service_mgr: true pod_test: false + cronjob_checkPGs: true diff --git a/ceph-mon/templates/configmap-bin.yaml b/ceph-mon/templates/configmap-bin.yaml index 833089c42..2a0496d25 100644 --- a/ceph-mon/templates/configmap-bin.yaml +++ b/ceph-mon/templates/configmap-bin.yaml @@ -54,10 +54,6 @@ data: moncheck-reap-zombies.py: | {{ tuple "bin/moncheck/_reap-zombies.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - utils-checkPGs.py: | -{{ tuple "bin/utils/_checkPGs.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - utils-checkPGs.sh: | -{{ tuple "bin/utils/_checkPGs.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} utils-checkObjectReplication.py: | {{ tuple "bin/utils/_checkObjectReplication.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} utils-checkDNS.sh: | diff --git a/ceph-mon/templates/daemonset-mon.yaml b/ceph-mon/templates/daemonset-mon.yaml index 059f2db15..78f99e780 100644 --- a/ceph-mon/templates/daemonset-mon.yaml +++ b/ceph-mon/templates/daemonset-mon.yaml @@ -175,14 +175,6 @@ spec: mountPath: /tmp/mon-check.sh subPath: mon-check.sh readOnly: true - - name: ceph-mon-bin - mountPath: /tmp/utils-checkPGs.py - subPath: utils-checkPGs.py - readOnly: true - - name: ceph-mon-bin - mountPath: /tmp/utils-checkPGs.sh - subPath: utils-checkPGs.sh - readOnly: true - name: ceph-mon-bin mountPath: /tmp/checkObjectReplication.py subPath: utils-checkObjectReplication.py diff --git a/ceph-mon/values.yaml b/ceph-mon/values.yaml index 3cc962028..eaf4d7e28 100644 --- a/ceph-mon/values.yaml +++ b/ceph-mon/values.yaml @@ -105,20 +105,6 @@ network: public: 192.168.0.0/16 cluster: 192.168.0.0/16 -jobs: - pool_checkPGs: - # Execute every 15 minutes - cron: "*/15 * * * *" - history: - # Number of successful job to keep - successJob: 1 - # Number of failed job to keep - failJob: 1 - concurrency: - # Skip new job if previous job still active - execPolicy: Forbid - startingDeadlineSecs: 60 - conf: templates: keyring: @@ -298,4 +284,3 @@ manifests: service_mon: true service_mon_discovery: true job_storage_admin_keys: true - cronjob_checkPGs: false diff --git a/tools/deployment/multinode/030-ceph.sh b/tools/deployment/multinode/030-ceph.sh index e44c4c1a9..0f6144827 100755 --- a/tools/deployment/multinode/030-ceph.sh +++ b/tools/deployment/multinode/030-ceph.sh @@ -90,7 +90,6 @@ jobs: execPolicy: Forbid startingDeadlineSecs: 60 manifests: - cronjob_checkPGs: true cronjob_defragosds: true EOF diff --git a/tools/deployment/osh-infra-logging/020-ceph.sh b/tools/deployment/osh-infra-logging/020-ceph.sh index f961dfc32..91533cf6d 100755 --- a/tools/deployment/osh-infra-logging/020-ceph.sh +++ b/tools/deployment/osh-infra-logging/020-ceph.sh @@ -185,7 +185,6 @@ jobs: execPolicy: Forbid startingDeadlineSecs: 60 manifests: - cronjob_checkPGs: true cronjob_defragosds: true job_bootstrap: false EOF