diff --git a/README.md b/README.md index fc7f4b7..c8c0853 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ * [Deploy my-nginx-service](#deploy-my-nginx-service) * [Stick the nginx-ingress controler and my-nginx app together](#stick-nginx-ingress-and-tcp-service) * [Test exposed app on TCP-port 9000](#test-nginx-ingress-and-tcp-service) -* [Running postfix in kubernetes](#running-postfix-in-kuberentes) +* [Running DaemonSets on `hostPort`](#running-daemonsets) ## Install k3s https://k3s.io/: @@ -252,9 +252,58 @@ kubectl logs my-nginx-65c68bbcdf-xkhqj -f [...] ``` -# Running postfix in kubernetes -https://www.tauceti.blog/post/run-postfix-in-kubernetes/ +# Running DaemonSets on `hostPort` +Docs: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ -Important in term of Deployment(one node)/Daemonset(all nodes) -* hostNetwork: true -* dnsPolicy: ClusterFirstWithHostNet \ No newline at end of file +In this case configuration of networking in context of services are not needed. + +``` +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: netcat-daemonset + labels: + app: netcat-daemonset +spec: + selector: + matchLabels: + app: netcat-daemonset + template: + metadata: + labels: + app: netcat-daemonset + spec: + containers: + - command: + - nc + - -lk + - -p + - "23456" + - -v + - -e + - /bin/true + env: + - name: DEMO_GREETING + value: Hello from the environment + image: dockreg-zdf.int.zwackl.de/alpine/latest/amd64:prod + imagePullPolicy: Always + name: netcat-daemonset + ports: + - containerPort: 23456 + hostPort: 23456 + protocol: TCP + resources: + limits: + cpu: 500m + memory: 64Mi + requests: + cpu: 50m + memory: 32Mi + restartPolicy: Always + securityContext: {} + terminationGracePeriodSeconds: 30 + updateStrategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate +``` \ No newline at end of file