Skip to content
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

Secrets mount #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Secrets mount #6

wants to merge 3 commits into from

Conversation

sseidman
Copy link

Adds a mount secret command that takes as input a string (in the format [{ "secretName": "<secret-name>", "path": "</path/to/secret>" }]) that specifies a list of kubernetes secrets to mount and the path at which to mount them at. Secrets will be written in the the Kubernetes secret format (e.g. filename = username, file = password). Adding this command will allow the k8ssandra-client to be used as the image for k8ssandra/k8ssandra-operator#608.

Verified by loading docker image to a kind cluster and applying the following manifest:

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  USER_NAME: YWRtaW4=
  PASSWORD: MWYyZDFlMmU2N2Rm
---
apiVersion: v1
kind: Pod
metadata:
  name: test-inject
  labels:
  annotations:
  namespace: k8ssandra-operator
spec:
  serviceAccountName: k8ssandra-operator
  initContainers:
    - args:
        - mount
        - "[{\"secretName\": \"mysecret\", \"path\": \"/etc/secrets\"}]"
      image: "k8ssandra/k8ssandra-client"
      imagePullPolicy: IfNotPresent
      name: k8ssandra-client
      volumeMounts:
        - mountPath: /etc/secrets
          name: secrets
  containers:
    - args:
        - sleep
        - "3600"
      image: busybox
      name: lifespan-offensive
      volumeMounts:
        - mountPath: /etc/secrets
          name: secrets
  restartPolicy: Always
  volumes:
    - name: secrets
      emptyDir: {}
      ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant