Hi @juliettet @rahul456 @Tej-Singh-Rana @akshayyw
I have assigned a task to manage secrets in kubernetes.
But I got stuck at one place and can’t even find the solution in official documents too!
The question says:
- We already have a secret key file
jump host. Create a
officialand it should contain the password/license-number present in
- Also create a
- Configure pod’s
specas container name should be
secret-container-xfusion, image should be
latesttag (remember to mention the tag with image). Use command
'sleep 10000'for container. Mount a volume named as
secret-volume-xfusion(volume should not be a
projected volume). The mount path should be
/opt/appsand mode should be
- Mount the secret within this volume.
- To verify you can exec into the container
secret-container-xfusion, to check the secret key under the mounted path
- Secret type should be
My code for secret
apiVersion: v1 kind: Secret metadata: name: official stringData: password: 5ecur3!
My code for pod:
apiVersion: v1 kind: Pod metadata: name: secret-xfusion spec: volumes: - name: secret-volume-xfusion projected: sources: - secret: name: secret-xfusion containers: - name: secret-container-xfusion image: fedora:latest command: ['/bin/bash', '-c', 'sleep 10000'] volumeMounts: - mountPath: "/opt/apps" name: secret-volume-xfusion readOnly: true
As I execute
kubectl get pods, it got stuck at “container creating” state and I don’t get what actually the question is trying to say? The volume should “NOT” be projected!???
Kindly look into this!!
Links which I am referring to