1

I created a secret of type service-account using the below code. The secret got created but when I run the kubectl get secrets the service-account secret is not listed. Where am I going wrong

apiVersion: v1
kind: Secret
metadata:
  name: secret-sa-sample
  annotations:
    kubernetes.io/service-account.name: "sa-name"
type: kubernetes.io/service-account-token
data:
  # You can include additional key value pairs as you do with Opaque Secrets
  extra: YmFyCg==
kubectl create -f  sa-secret.yaml
secret/secret-sa-sample created```
zilcuanu
  • 3,451
  • 8
  • 52
  • 105

1 Answers1

0

it might have been created in default namespace. Specify namespace explicitly using -n $NS argument to kubectl

Sameer Naik
  • 1,326
  • 1
  • 13
  • 28