Skip to content

Instantly share code, notes, and snippets.

@antitree
Created November 1, 2020 22:11
Show Gist options
  • Save antitree/7a2461207259eb36f46ec250eef91ab1 to your computer and use it in GitHub Desktop.
Save antitree/7a2461207259eb36f46ec250eef91ab1 to your computer and use it in GitHub Desktop.
POC for setting up an environment with a secret and cluster role.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: poc-list-bypass
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: poc-list-bypass
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: poc-list-bypass
subjects:
- kind: ServiceAccount
name: poc-list-bypass-sa
namespace: default
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: poc-list-bypass-sa
namespace: default
---
apiVersion: v1
data:
mysecret: a3ViZXJuZXRlcyBMSVNUIHZlcmIgaXMgYSBsaWU=
kind: Secret
metadata:
name: ultra-secret-string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment