how to assign only 1 secret key in Cluster Role ? Please go through my below code, say I have multiple secrets and I want to give access to only 1 secret among via service account so how can I achieve ? if not possible and its possible only by mentioning secret key in manifest file directly without secret account then what is the use of secret account I want to know.
# A role for reading/listing secrets
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: secret-access-cr
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["secrets"] verbs: ["get", "list"]
Please help.
One of the example how you can use clusterrole binding and how to alllow/deny access to the API resources from within the POD using ClusterRole, ServiceAccount and RoleBinding process you can find in this tutorial:
https://developer.ibm.com/recipes/tutorials/service-accounts-and-auditing-in-kubernetes/
Community related information:
Kubernetes namespace default service account
Shortly please create:
More infomration about https://kubernetes.io/docs/reference/access-authn-authz/rbac/