Skip to content

Instantly share code, notes, and snippets.

@wirwolf
Created July 7, 2022 12:48
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 wirwolf/a04183f39fa008817842b94858b4d868 to your computer and use it in GitHub Desktop.
Save wirwolf/a04183f39fa008817842b94858b4d868 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
annotations:
imageHash: sha256:f885a590d7d3123df58bd23392e40daa3c951aae63f3e3d457ee43efffb49844
creationTimestamp: "2022-06-29T12:45:22Z"
generateName: landings-fake-php-fpm-77f788b5cb-
labels:
app.kubernetes.io/instance: landings-fake-php-fpm
app.kubernetes.io/name: app-php-fpm-nginx
pod-template-hash: 77f788b5cb
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:imageHash: {}
f:generateName: {}
f:labels:
.: {}
f:app.kubernetes.io/instance: {}
f:app.kubernetes.io/name: {}
f:pod-template-hash: {}
f:ownerReferences:
.: {}
k:{"uid":"0d782b01-6971-4356-bc2e-e32c17e4b15a"}:
.: {}
f:apiVersion: {}
f:blockOwnerDeletion: {}
f:controller: {}
f:kind: {}
f:name: {}
f:uid: {}
f:spec:
f:affinity:
.: {}
f:podAntiAffinity:
.: {}
f:preferredDuringSchedulingIgnoredDuringExecution: {}
f:containers:
k:{"name":"app-logs"}:
.: {}
f:args: {}
f:command: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}
f:resources: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:volumeMounts:
.: {}
k:{"mountPath":"/app/log"}:
.: {}
f:mountPath: {}
f:name: {}
k:{"name":"monitoring"}:
.: {}
f:env:
.: {}
k:{"name":"PHP_FPM_FIX_PROCESS_COUNT"}:
.: {}
f:name: {}
f:value: {}
k:{"name":"PHP_FPM_SCRAPE_URI"}:
.: {}
f:name: {}
f:value: {}
f:image: {}
f:imagePullPolicy: {}
f:lifecycle:
.: {}
f:preStop:
.: {}
f:exec:
.: {}
f:command: {}
f:name: {}
f:ports:
.: {}
k:{"containerPort":9253,"protocol":"TCP"}:
.: {}
f:containerPort: {}
f:name: {}
f:protocol: {}
f:resources:
.: {}
f:requests:
.: {}
f:cpu: {}
f:memory: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
k:{"name":"php-fpm"}:
.: {}
f:image: {}
f:imagePullPolicy: {}
f:lifecycle:
.: {}
f:preStop:
.: {}
f:exec:
.: {}
f:command: {}
f:name: {}
f:ports:
.: {}
k:{"containerPort":9000,"protocol":"TCP"}:
.: {}
f:containerPort: {}
f:name: {}
f:protocol: {}
f:readinessProbe:
.: {}
f:exec:
.: {}
f:command: {}
f:failureThreshold: {}
f:initialDelaySeconds: {}
f:periodSeconds: {}
f:successThreshold: {}
f:timeoutSeconds: {}
f:resources:
.: {}
f:limits:
.: {}
f:cpu: {}
f:memory: {}
f:requests:
.: {}
f:cpu: {}
f:memory: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:volumeMounts:
.: {}
k:{"mountPath":"/app/log"}:
.: {}
f:mountPath: {}
f:name: {}
f:dnsPolicy: {}
f:enableServiceLinks: {}
f:imagePullSecrets:
.: {}
k:{"name":"docker-registry-landings-fake-fake"}:
.: {}
f:name: {}
f:restartPolicy: {}
f:schedulerName: {}
f:securityContext: {}
f:shareProcessNamespace: {}
f:terminationGracePeriodSeconds: {}
f:volumes:
.: {}
k:{"name":"logs-folder"}:
.: {}
f:emptyDir: {}
f:name: {}
manager: kube-controller-manager
operation: Update
time: "2022-06-29T12:45:22Z"
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:conditions:
k:{"type":"ContainersReady"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
k:{"type":"Initialized"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
k:{"type":"Ready"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
f:containerStatuses: {}
f:hostIP: {}
f:phase: {}
f:podIP: {}
f:podIPs:
.: {}
k:{"ip":"100.64.65.231"}:
.: {}
f:ip: {}
f:startTime: {}
manager: kubelet
operation: Update
time: "2022-06-29T12:45:52Z"
name: landings-fake-php-fpm-77f788b5cb-kg6m4
namespace: pl-stage
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: ReplicaSet
name: landings-fake-php-fpm-77f788b5cb
uid: 0d782b01-6971-4356-bc2e-e32c17e4b15a
resourceVersion: "29027826"
uid: fd219e99-0b71-493b-ab3c-a38fe09e2d04
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: landings-fake-php-fpm
app.kubernetes.io/name: app-php-fpm-nginx
topologyKey: kubernetes.io/hostname
weight: 1
containers:
- image: fake:5001/fake/app-php-fpm:v0-1-1
imagePullPolicy: Always
lifecycle:
preStop:
exec:
command:
- sh
- -c
- echo "Stopping container by k8s...">/proc/1/fd/1 && /bin/kill -QUIT 1
name: php-fpm
ports:
- containerPort: 9000
name: socket
protocol: TCP
readinessProbe:
exec:
command:
- php-fpm-healthcheck
failureThreshold: 10
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 5
resources:
limits:
cpu: 300m
memory: 400Mi
requests:
cpu: 15m
memory: 20Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /app/log
name: logs-folder
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-csfrm
readOnly: true
- env:
- name: PHP_FPM_SCRAPE_URI
value: tcp://127.0.0.1:9000/status
- name: PHP_FPM_FIX_PROCESS_COUNT
value: "true"
image: docker.io/hipages/php-fpm_exporter:2.0.4
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- sh
- -c
- echo "Stopping container by k8s...">/proc/1/fd/1 && /bin/kill -SIGTERM
1
name: monitoring
ports:
- containerPort: 9253
name: monitoring
protocol: TCP
resources:
requests:
cpu: 15m
memory: 20Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-csfrm
readOnly: true
- args:
- -ec
- |
apk add inotify-tools
logDir=/app/log/
while true; do
( find "$logDir" -type f -print0 | xargs -0 tail -v -f -n 0 )&
tailPid=$!
inotifywait --recursive --quiet --event create --format=%w%f "$logDir" | tr \\n \\0 | xargs -0 tail -v
kill $tailPid
done
command:
- /bin/sh
image: alpine:edge
imagePullPolicy: IfNotPresent
name: app-logs
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /app/log
name: logs-folder
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-csfrm
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
imagePullSecrets:
- name: docker-registry-landings-fake-fake
nodeName: worker2.fake.fake.fake.fake.org
preemptionPolicy: PreemptLowerPriority
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: default
serviceAccountName: default
shareProcessNamespace: true
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 60
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 60
volumes:
- emptyDir: {}
name: logs-folder
- name: kube-api-access-csfrm
projected:
defaultMode: 420
sources:
- serviceAccountToken:
expirationSeconds: 3607
path: token
- configMap:
items:
- key: ca.crt
path: ca.crt
name: kube-root-ca.crt
- downwardAPI:
items:
- fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
path: namespace
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2022-06-29T12:45:22Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2022-06-29T12:45:52Z"
status: "True"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2022-06-29T12:45:52Z"
status: "True"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2022-06-29T12:45:22Z"
status: "True"
type: PodScheduled
containerStatuses:
- containerID: containerd://f636ac26f9e311dd862576824483588f1b3ebc0f9085298f7ce28ee0fceb9bff
image: docker.io/library/alpine:edge
imageID: docker.io/library/alpine@sha256:c8420124adc6f31031a88c85f53e1e78f419b1ac46b827fd1d4d0fdae2c7e3aa
lastState: {}
name: app-logs
ready: true
restartCount: 0
started: true
state:
running:
startedAt: "2022-06-29T12:45:46Z"
- containerID: containerd://68d5c26b4aa5563e5d70b2b8c4f4409edab9aff43ed86ad5f96a03321adda980
image: docker.io/hipages/php-fpm_exporter:2.0.4
imageID: docker.io/hipages/php-fpm_exporter@sha256:45576174b4e0caae2ae3d67bd124b7d29531de77c94385e9dbb08062660bc112
lastState: {}
name: monitoring
ready: true
restartCount: 0
started: true
state:
running:
startedAt: "2022-06-29T12:45:46Z"
- containerID: containerd://cf4a5d0a19bc8f8c88eaac86a8b5a65a49b47dd3cde138338f9bb423296a845f
image: fake:5001/fake/app-php-fpm:v0-1-1
imageID: fake:5001/fake/app-php-fpm@sha256:e2b56b8d26e60d9e8e0cf3e651317816461c8143b9562f560f81dafdc4572f2a
lastState: {}
name: php-fpm
ready: true
restartCount: 0
started: true
state:
running:
startedAt: "2022-06-29T12:45:46Z"
hostIP: 10.135.129.40
phase: Running
podIP: 100.64.65.231
podIPs:
- ip: 100.64.65.231
qosClass: Burstable
startTime: "2022-06-29T12:45:22Z"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment