logging node name for important operations

terminating application when watching pods stops
Dockerfile and docker compose file added.
helm chart added
This commit is contained in:
2025-03-02 23:33:17 +01:00
parent e8d4adaf53
commit be5ceb1ee5
6 changed files with 131 additions and 45 deletions
+39
View File
@@ -0,0 +1,39 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-fetcher
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: kube-fetcher
template:
metadata:
labels:
app: kube-fetcher
spec:
serviceAccountName: kube-fetcher
containers:
- name: fetcher
image: cat.wamblee.org/kube-fetcher:1.0.0
imagePullPolicy: Always
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
privileged: true
runAsUser: 0
args:
- --ready-duration=1m
- --v=3
volumeMounts:
- mountPath: /run/containerd/containerd.sock
name: containerd-sock
volumes:
- name: containerd-sock
hostPath:
path: /run/containerd/containerd.sock
type: Socket
+32
View File
@@ -0,0 +1,32 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-fetcher
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-fetcher
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"]
---
# ClusterRoleBinding to connect the ServiceAccount to the ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-fetcher
subjects:
- kind: ServiceAccount
name: kube-fetcher
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: kube-fetcher
apiGroup: rbac.authorization.k8s.io