Created
June 25, 2020 17:41
-
-
Save alexeldeib/5449516a84eff6e18d611d00cf790915 to your computer and use it in GitHub Desktop.
List deployments in all namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
creationTimestamp: null | |
name: lister | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: Role | |
metadata: | |
creationTimestamp: null | |
name: lister-role | |
rules: | |
- apiGroups: | |
- apps | |
resources: | |
- deployments | |
verbs: | |
- list | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: RoleBinding | |
metadata: | |
name: lister-rolebinding | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: Role | |
name: lister-role | |
subjects: | |
- kind: ServiceAccount | |
name: lister | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
creationTimestamp: null | |
name: cluster-lister-role | |
rules: | |
- apiGroups: | |
- apps | |
resources: | |
- deployments | |
verbs: | |
- list | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: cluster-lister-rolebinding | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-lister-role | |
subjects: | |
- kind: ServiceAccount | |
name: lister | |
namespace: default | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: &name kubectl | |
labels: | |
app: *name | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: *name | |
template: | |
metadata: | |
labels: | |
app: *name | |
spec: | |
serviceAccountName: lister | |
containers: | |
- image: bitnami/kubectl:latest | |
name: kubectl | |
command: ["sleep", "infinity"] | |
resources: | |
requests: | |
cpu: 100m | |
memory: 100Mi | |
limits: | |
cpu: 50m | |
memory: 50Mi |
Author
alexeldeib
commented
Jun 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment