Skip to content

Instantly share code, notes, and snippets.

@proelbtn
Created August 31, 2019 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proelbtn/49b6a9d9c4d976304b53f8b7063392e7 to your computer and use it in GitHub Desktop.
Save proelbtn/49b6a9d9c4d976304b53f8b7063392e7 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: notifier
namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: notifier
labels:
app: notifier
spec:
replicas: 1
selector:
matchLabels:
app: notifier
template:
metadata:
labels:
app: notifier
spec:
serviceAccountName: notifier
hostAliases:
- ip: “192.168.0.201”
hostnames:
- “misc”
containers:
- name: notifier
image: misc:5000/notifier
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pod-watcher
rules:
- apiGroups: [“”]
resources: [“pods”]
verbs: [“list”, “watch”]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: notifier
subjects:
- kind: ServiceAccount
name: notifier
namespace: default
roleRef:
kind: ClusterRole
name: pod-watcher
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment