Kubernetes Config Management & Secrets

    Question 1KUBERNETES- Purpose of ConfigMaps

    What is the primary purpose of a ConfigMap in Kubernetes?

    Question 2KUBERNETES- Purpose of Secrets

    What is the primary purpose of a Kubernetes Secret?

    Question 3KUBERNETES- Code Snippet (ConfigMap YAML)

    What does this YAML define?

    apiVersion: v1 kind: ConfigMap metadata: name: app-config data: APP_MODE: "production" LOG_LEVEL: "info"

    Question 4KUBERNETES- Using ConfigMap in Pod

    How can a pod consume a ConfigMap?

    Question 5KUBERNETES- Code Snippet (Mount ConfigMap as Volume)

    What does this snippet achieve?

    volumes: - name: config-volume configMap: name: app-config containers: - name: app image: myapp:latest volumeMounts: - name: config-volume mountPath: /etc/config

    Question 6KUBERNETES- Secrets Base64 Encoding

    How must data in Kubernetes Secrets be stored?

    Question 7KUBERNETES- Code Snippet (Secret YAML)

    What is this YAML doing?

    apiVersion: v1 kind: Secret metadata: name: db-secret type: Opaque data: DB_USER: YWRtaW4= DB_PASSWORD: cGFzc3dvcmQ=

    Question 8KUBERNETES- Consume Secret as Environment Variable

    How can a pod use a Secret as an environment variable?

    Question 9KUBERNETES- Best Practices for Secrets

    Which of the following is a best practice for using Kubernetes Secrets?

    Question 10KUBERNETES- Code Snippet (Inject Secret as Environment Variable)

    What does this snippet achieve?

    containers: - name: app image: myapp:latest env: - name: DB_USER valueFrom: secretKeyRef: name: db-secret key: DB_USER