grandfathermagic

Kubernetes Sidecar Containers

Aug 12th, 2023
1,085
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.93 KB | Source Code | 0 0
  1. # https://kubernetes.io/docs/concepts/workloads/pods/
  2. apiVersion: v1
  3. kind: Pod
  4. metadata:
  5.   name: "webserver"
  6.   namespace: default
  7.   labels:
  8.     app: "webserver"
  9. spec:
  10.   containers:
  11.   - name: sidecar-container
  12.     image: "ubuntu:latest"
  13.     command: [ "/bin/sh", "-c", "--" ]
  14.     args: ["while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done"]
  15.     resources:
  16.       limits:
  17.         cpu: 200m
  18.         memory: 500Mi
  19.       requests:
  20.         cpu: 100m
  21.         memory: 200Mi
  22.     volumeMounts:
  23.     - name: shared-logs
  24.       mountPath: /var/log/nginx
  25.   - name: nginx-container
  26.     image: "nginx:latest"
  27.     resources:
  28.       limits:
  29.         cpu: 200m
  30.         memory: 500Mi
  31.       requests:
  32.         cpu: 100m
  33.         memory: 200Mi
  34.     volumeMounts:
  35.     - name: shared-logs
  36.       mountPath: /var/log/nginx
  37.   volumes:
  38.     - emptyDir: {}
  39.       name: shared-logs
  40.   restartPolicy: Always
  41. ---
  42.  
Advertisement
Add Comment
Please, Sign In to add comment