ceph-helm icon indicating copy to clipboard operation
ceph-helm copied to clipboard

Cannot generate keyring

Open Helenbj opened this issue 7 years ago • 9 comments

Is this a request for help?:


BUG REPOR :

When I run command "kubectl get pods -n ceph" after "helm install ..", I got:

NAME                                   READY   STATUS     RESTARTS   AGE
ceph-mds-75dc968dc7-kvp67              0/1     Init:0/2   0          18m
ceph-mgr-75f4c4dc76-x5r74              0/1     Init:0/2   0          18m
ceph-mon-check-85d59b5fd4-xjczs        0/1     Init:0/2   0          18m
ceph-mon-zjzpp                         0/3     Init:0/2   0          18m
ceph-osd-dev-sdd-clhpt                 0/1     Init:0/3   0          18m
ceph-osd-dev-sde-2fkmt                 0/1     Init:0/3   0          18m
ceph-rbd-provisioner-d59d65f74-nkj48   1/1     Running    0          18m
ceph-rbd-provisioner-d59d65f74-xqhmt   1/1     Running    0          18m
ceph-rgw-7598c7788-mbjt9               0/1     Init:0/2   0          18m

Then I see logs of one of these faild pods, and got:

Events:
  Type     Reason       Age                      From               Message
  ----     ------       ----                     ----               -------
  Normal   Scheduled    21m                      default-scheduler  Successfully assigned ceph/ceph-rgw-7598c7788-mbjt9 to minion
  Warning  FailedMount  14m (x5 over 14m)        kubelet, minion    MountVolume.SetUp failed for volume "ceph-bootstrap-rgw-keyring" : secret "ceph-bootstrap-rgw-keyring" not found
  Warning  FailedMount  14m (x5 over 14m)        kubelet, minion    MountVolume.SetUp failed for volume "ceph-mon-keyring" : secret "ceph-mon-keyring" not found
  Warning  FailedMount  14m (x5 over 14m)        kubelet, minion    MountVolume.SetUp failed for volume "ceph-bootstrap-mds-keyring" : secret "ceph-bootstrap-mds-keyring" not found
  Warning  FailedMount  8m15s (x11 over 14m)     kubelet, minion    MountVolume.SetUp failed for volume "ceph-bootstrap-osd-keyring" : secret "ceph-bootstrap-osd-keyring" not found
  Warning  FailedMount  4m11s (x13 over 14m)     kubelet, minion    MountVolume.SetUp failed for volume "ceph-client-admin-keyring" : secret "ceph-client-admin-keyring" not found
  Warning  FailedMount  <invalid> (x9 over 12m)  kubelet, minion    Unable to mount volumes for pod "ceph-rgw-7598c7788-mbjt9_ceph(44a7d63a-9230-11e9-9dd2-5820b10bbe42)": timeout expired waiting for volumes to attach or mount for pod "ceph"/"ceph-rgw-7598c7788-mbjt9". list of unmounted volumes=[ceph-client-admin-keyring ceph-mon-keyring ceph-bootstrap-osd-keyring ceph-bootstrap-mds-keyring ceph-bootstrap-rgw-keyring]. list of unattached volumes=[pod-etc-ceph ceph-bin ceph-etc pod-var-lib-ceph pod-run ceph-client-admin-keyring ceph-mon-keyring ceph-bootstrap-osd-keyring ceph-bootstrap-mds-keyring ceph-bootstrap-rgw-keyring default-token-rbjr6]

When I run command “kubectl get job -n ceph”, I got:

NAME                                  COMPLETIONS   DURATION   AGE
ceph-mds-keyring-generator            0/1           17m        17m
ceph-mgr-keyring-generator            0/1           17m        17m
ceph-mon-keyring-generator            0/1           17m        17m
ceph-namespace-client-key-generator   0/1           17m        17m
ceph-osd-keyring-generator            0/1           17m        17m
ceph-rgw-keyring-generator            0/1           17m        17m
ceph-storage-keys-generator           0/1           17m        17m

I think the file "ceph/ceph/templates/job-keyring.yaml" format is wrong for k8s v1.14.1.

{{- if .Values.manifests.job_keyring }}
{{- $envAll := . }}
{{- if .Values.deployment.storage_secrets }}
{{- range $key1, $cephBootstrapKey := tuple "mds" "osd" "rgw" "mon" "mgr"}}
{{- $jobName := print $cephBootstrapKey "-keyring-generator" }}
---
apiVersion: batch/v1
kind: Job 
metadata:
  name: ceph-{{ $jobName }}
spec:
  template:
    metadata:
      labels:
{{ tuple $envAll "ceph" $jobName | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
    spec:
      restartPolicy: OnFailure
      nodeSelector:
        {{ $envAll.Values.labels.jobs.node_selector_key }}: {{ $envAll.Values.labels.jobs.node_selector_value }}      containers:
        - name:  ceph-{{ $jobName }}
          image: {{ $envAll.Values.images.ceph_config_helper }}
          imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.secret_provisioning | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}          env:
            - name: DEPLOYMENT_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: CEPH_GEN_DIR 
              value: /opt/ceph
            - name: CEPH_TEMPLATES_DIR
              value: /opt/ceph/templates
            {{- if eq $cephBootstrapKey "mon"}}
            - name: CEPH_KEYRING_NAME
              value: ceph.mon.keyring
            - name: CEPH_KEYRING_TEMPLATE
              value: mon.keyring
            {{- else }}
            - name: CEPH_KEYRING_NAME
              value: ceph.keyring
            - name: CEPH_KEYRING_TEMPLATE
              value: bootstrap.keyring.{{ $cephBootstrapKey }}
            {{- end }}
            - name: KUBE_SECRET_NAME
              value: {{  index $envAll.Values.secrets.keyrings $cephBootstrapKey }}
          command:
            - /opt/ceph/ceph-key.sh
          volumeMounts:
            - name: ceph-bin
              mountPath: /opt/ceph/ceph-key.sh
              subPath: ceph-key.sh
              readOnly: true
            - name: ceph-bin
              mountPath: /opt/ceph/ceph-key.py
              subPath: ceph-key.py
              readOnly: true
            - name: ceph-templates
              mountPath: /opt/ceph/templates
              readOnly: true
      volumes:
        - name: ceph-bin
          configMap:
            name: ceph-bin
            defaultMode: 0555
        - name: ceph-templates
          configMap:
            name: ceph-templates
            defaultMode: 0444
{{- end }}
{{- end }}
{{- end }}

Version of Helm and Kubernetes:

Helm

Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}

Kubernetes

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}

Which chart: local/ceph

What happened:

kubectl describe pod ceph-storage-keys-generator-9x6z8 -n ceph
++ ceph_gen_key
++ python /opt/ceph/ceph-key.py
+ CEPH_CLIENT_KEY=AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w==
+ create_kube_key AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w== ceph.client.admin.keyring admin.keyring ceph-client-admin-keyring
+ CEPH_KEYRING=AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w==
+ CEPH_KEYRING_NAME=ceph.client.admin.keyring
+ CEPH_KEYRING_TEMPLATE=admin.keyring
+ KUBE_SECRET_NAME=ceph-client-admin-keyring
+ kubectl get --namespace ceph secrets ceph-client-admin-keyring
Error from server (NotFound): secrets "ceph-client-admin-keyring" not found
+ cat
+ kubectl create --namespace ceph -f -
++ kube_ceph_keyring_gen AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w== admin.keyring
++ CEPH_KEY=AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w==
++ CEPH_KEY_TEMPLATE=admin.keyring
++ sed 's|{{ key }}|AQBhjwldAAAAABAAO9uRzdtFukGfCKVFFFPM1w==|' /opt/ceph/templates/admin.keyring
++ base64
++ tr -d '\n'
error: error validating "STDIN": error validating data: unknown; if you choose to ignore these errors, turn validation off with --validate=false

What you expected to happen:

When I run bellow command, all jobs are completed.

kubectl get job - n ceph

And after bellow command, I can see kinds of keyring.

kubectl get secret -n ceph

How to reproduce it (as minimally and precisely as possible):

Just run command

helm install --name=ceph local/ceph --namespace=ceph -f ~/ceph-overrides.yaml

Anything else we need to know:

Waiting you to resolv it online. tks! @rootfs @zmc @alfredodeza @liewegas @jecluis @ktdreyer

Helenbj avatar Jun 19 '19 01:06 Helenbj

got same problem

majikxu avatar Jun 19 '19 05:06 majikxu

got same problem @rootfs @zmc @alfredodeza @liewegas @jecluis @ktdreyer

xieyf0413 avatar Jun 29 '19 11:06 xieyf0413

+1 looks like the manifests produced by the jobs to rotate keys cannot pass validation with kube 1.14.1

ffilippopoulos avatar Jun 30 '19 16:06 ffilippopoulos

+1, Got the same problem with k8s 1.14.3

chenyg0911 avatar Jul 02 '19 06:07 chenyg0911

@All

I'm using the below environment and facing the same issue.


K8s Version root@master:/home/devops/helm/ceph-helm/ceph# kubectl version Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}


HELM VERSION root@master:/home/devops/helm/ceph-helm/ceph# helm version Client: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}


taruntilokani avatar Jul 16 '19 10:07 taruntilokani

got same problem

wade-bigdata avatar Aug 14 '19 08:08 wade-bigdata

Got the same problem and versions are blows:

kubectl version

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

helm version

Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

YLonely avatar Aug 16 '19 07:08 YLonely

Finally, I give up ceph-helm, and setup ceph cluster via rook-ceph, all is easy and work well.

Helenbj avatar Aug 16 '19 10:08 Helenbj

Last commit on ceph-helm was from 26:th June. Its not deployable on 1.16+ I'm also going for rook-ceph instead

sudo-undefined avatar Jan 05 '20 12:01 sudo-undefined