Bird
Raised Fist0
Kubernetesdevops~20 mins

External secret management integration in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
External Secrets Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this command?
You have installed External Secrets Operator in your Kubernetes cluster. You run the following command to check the status of the ExternalSecret resource named db-credentials in the default namespace:

kubectl describe externalsecret db-credentials

What output will you see regarding the secret synchronization status?
AError: Secret not found in external provider
BStatus: Synced<br>Last Sync Time: 2024-06-01T12:00:00Z
CStatus: Pending<br>Last Sync Time: N/A
Dkubectl: error: the server doesn't have a resource type "externalsecret"
Attempts:
2 left
💡 Hint
Check the status section in the describe output for ExternalSecret resources.
❓ Configuration
intermediate
2:00remaining
Which ExternalSecret YAML correctly references a secret from AWS Secrets Manager?
You want to create an ExternalSecret resource that fetches a secret named prod/db-password from AWS Secrets Manager and stores it in a Kubernetes secret named db-password. Which YAML snippet is correct?
A
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: db-password
spec:
  secretStoreRef:
    name: aws-secret-store
    kind: SecretStore
  target:
    name: db-password
  data:
  - secretKey: password
    remoteRef:
      key: prod/db-password
      property: password
B
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: db-password
spec:
  secretStoreRef:
    name: aws-secret-store
    kind: ClusterSecretStore
  target:
    name: db-password
  dataFrom:
  - key: prod/db-password
C
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: db-password
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: aws-secret-store
    kind: SecretStore
  target:
    name: db-password
  data:
  - secretKey: password
    remoteRef:
      key: prod/db-password
D
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: db-password
spec:
  secretStoreRef:
    name: aws-secret-store
    kind: SecretStore
  target:
    name: db-password
  data:
  - secretKey: password
    remoteRef:
      key: prod/db-password
      version: latest
Attempts:
2 left
💡 Hint
Look for the correct use of property to specify the secret field inside AWS Secrets Manager.
❓ Troubleshoot
advanced
2:00remaining
Why does the ExternalSecret fail to sync with this error?
You see this error in the External Secrets Operator logs:

failed to get secret from provider: AccessDeniedException: User is not authorized to perform: secretsmanager:GetSecretValue

What is the most likely cause?
AThe ExternalSecret resource YAML is missing the <code>refreshInterval</code> field
BThe Kubernetes service account does not have permission to read secrets in the cluster
CThe AWS IAM role or user used by the External Secrets Operator lacks permission to access the secret in AWS Secrets Manager
DThe secret name in ExternalSecret does not match the Kubernetes secret name
Attempts:
2 left
💡 Hint
Check the permissions related to AWS Secrets Manager access.
🔀 Workflow
advanced
3:00remaining
What is the correct order of steps to integrate External Secrets Operator with HashiCorp Vault?
Arrange the steps in the correct order to set up External Secrets Operator to fetch secrets from HashiCorp Vault.
A2,4,1,3
B4,2,1,3
C2,1,4,3
D4,1,2,3
Attempts:
2 left
💡 Hint
Think about deploying the operator first, then setting Vault permissions, then configuring Kubernetes resources.
✅ Best Practice
expert
2:30remaining
Which practice is best for securely managing external secret access in Kubernetes?
You want to ensure the External Secrets Operator accesses external secrets securely and with least privilege. Which practice is best?
AUse a single AWS IAM user with full Secrets Manager access for all namespaces and workloads.
BDisable authentication in External Secrets Operator to simplify access.
CStore AWS credentials as plain text in Kubernetes secrets and mount them to pods.
DCreate separate IAM roles with minimal permissions per namespace and use Kubernetes service account annotations for role assumption.
Attempts:
2 left
💡 Hint
Consider the principle of least privilege and Kubernetes-native authentication methods.

Practice

(1/5)
1. What is the main purpose of using ExternalSecret in Kubernetes?
easy
A. To sync secrets from external secret stores into Kubernetes automatically
B. To create new Kubernetes namespaces
C. To monitor pod resource usage
D. To deploy applications without containers

Solution

  1. Step 1: Understand ExternalSecret role

    ExternalSecret is designed to fetch and sync secrets from external secret management systems into Kubernetes.
  2. Step 2: Compare options with purpose

    Only To sync secrets from external secret stores into Kubernetes automatically describes syncing secrets automatically, which matches ExternalSecret's main use.
  3. Final Answer:

    To sync secrets from external secret stores into Kubernetes automatically -> Option A
  4. Quick Check:

    ExternalSecret syncs external secrets = C [OK]
Hint: ExternalSecret = syncing external secrets into Kubernetes [OK]
Common Mistakes:
  • Confusing ExternalSecret with namespace creation
  • Thinking it manages pods or deployments
  • Assuming it monitors resource usage
2. Which of the following is the correct syntax to define an ExternalSecret resource in Kubernetes?
easy
A. apiVersion: external-secrets.io/v1alpha1 kind: ExternalSecret metadata: name: my-secret spec: refreshInterval: 1h secretStoreRef: name: my-store target: name: synced-secret data: - secretKey: password remoteRef: key: prod/db-password
B. apiVersion: v1 kind: Secret metadata: name: my-secret stringData: password: prod/db-password
C. apiVersion: apps/v1 kind: Deployment metadata: name: secret-deployment spec: replicas: 1
D. apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: my-secret-store

Solution

  1. Step 1: Identify ExternalSecret resource structure

    ExternalSecret uses apiVersion external-secrets.io/v1alpha1, kind ExternalSecret, and spec with secretStoreRef and data fields.
  2. Step 2: Match syntax with options

    apiVersion: external-secrets.io/v1alpha1 kind: ExternalSecret metadata: name: my-secret spec: refreshInterval: 1h secretStoreRef: name: my-store target: name: synced-secret data: - secretKey: password remoteRef: key: prod/db-password matches the correct syntax for ExternalSecret resource definition including refreshInterval, secretStoreRef, and data mapping.
  3. Final Answer:

    Correct ExternalSecret resource syntax -> Option A
  4. Quick Check:

    ExternalSecret syntax = apiVersion: external-secrets.io/v1alpha1 kind: ExternalSecret metadata: name: my-secret spec: refreshInterval: 1h secretStoreRef: name: my-store target: name: synced-secret data: - secretKey: password remoteRef: key: prod/db-password [OK]
Hint: Look for apiVersion external-secrets.io and kind ExternalSecret [OK]
Common Mistakes:
  • Using Secret kind instead of ExternalSecret
  • Confusing SecretStore with ExternalSecret
  • Wrong apiVersion or missing spec fields
3. Given this ExternalSecret YAML snippet, what will be the name of the Kubernetes Secret created?
spec:
  target:
    name: app-secret
  data:
  - secretKey: api-key
    remoteRef:
      key: prod/api-key
medium
A. prod/api-key
B. external-secret
C. api-key
D. app-secret

Solution

  1. Step 1: Understand target.name in ExternalSecret

    The target.name field specifies the name of the Kubernetes Secret that will be created or updated.
  2. Step 2: Identify the value in target.name

    Here, target.name is set to "app-secret", so the Kubernetes Secret will be named "app-secret".
  3. Final Answer:

    app-secret -> Option D
  4. Quick Check:

    target.name sets Secret name = app-secret [OK]
Hint: target.name is the Kubernetes Secret name [OK]
Common Mistakes:
  • Confusing remoteRef.key with Secret name
  • Using secretKey as Secret name
  • Assuming default name external-secret
4. You applied an ExternalSecret manifest but the Kubernetes Secret is not created. Which is the most likely cause?
medium
A. The pod does not have enough CPU resources
B. The Kubernetes API server is down
C. The ExternalSecret controller is not installed or running in the cluster
D. The Deployment spec is missing replicas

Solution

  1. Step 1: Identify role of ExternalSecret controller

    The ExternalSecret controller watches ExternalSecret resources and creates Kubernetes Secrets accordingly.
  2. Step 2: Analyze why Secret is not created

    If the controller is missing or not running, ExternalSecret resources won't be processed, so no Secrets are created.
  3. Final Answer:

    The ExternalSecret controller is not installed or running in the cluster -> Option C
  4. Quick Check:

    Missing controller = no Secret creation [OK]
Hint: Check if ExternalSecret controller pod is running [OK]
Common Mistakes:
  • Blaming pod CPU resources for Secret creation
  • Assuming API server downtime without checking
  • Confusing Deployment replicas with secret syncing
5. You want to sync a secret from AWS Secrets Manager into Kubernetes using ExternalSecret. Which two key configurations must you include in your ExternalSecret manifest?
hard
A. podSelector to select pods and replicas for scaling
B. secretStoreRef to specify AWS Secrets Manager and data with remoteRef key
C. container image and command to run the sync
D. nodeSelector to assign nodes and tolerations for scheduling

Solution

  1. Step 1: Identify required ExternalSecret fields for AWS integration

    You must specify secretStoreRef to point to the AWS Secrets Manager store and data with remoteRef key to map the secret key.
  2. Step 2: Exclude unrelated fields

    podSelector, replicas, container image, nodeSelector, and tolerations are unrelated to ExternalSecret syncing secrets.
  3. Final Answer:

    secretStoreRef to specify AWS Secrets Manager and data with remoteRef key -> Option B
  4. Quick Check:

    secretStoreRef + data.remoteRef = AWS secret sync [OK]
Hint: Use secretStoreRef and data.remoteRef for external secrets [OK]
Common Mistakes:
  • Confusing pod or node selectors with secret syncing
  • Trying to specify container image in ExternalSecret
  • Missing secretStoreRef or data fields
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard