Adds mock-requests
This commit is contained in:
parent
9d072d6b80
commit
9c1f349c97
165
mock-payloads/deployments/test-deploy01.json
Normal file
165
mock-payloads/deployments/test-deploy01.json
Normal file
@ -0,0 +1,165 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "d6a539c0-8605-4923-8b57-ed54313e359a",
|
||||
"kind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"resource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"name": "test-deploy01",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "test-deploy01",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test-deploy01\",\"namespace\":\"test1\"},\"spec\":{\"replicas\":3,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"image\":\"jmsearcy/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}]}}}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "apps/v1",
|
||||
"time": "2020-10-11T07:23:53Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:progressDeadlineSeconds": {},
|
||||
"f:replicas": {},
|
||||
"f:revisionHistoryLimit": {},
|
||||
"f:selector": {
|
||||
"f:matchLabels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:strategy": {
|
||||
"f:rollingUpdate": {
|
||||
".": {},
|
||||
"f:maxSurge": {},
|
||||
"f:maxUnavailable": {}
|
||||
},
|
||||
"f:type": {}
|
||||
},
|
||||
"f:template": {
|
||||
"f:metadata": {
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 3,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "RollingUpdate",
|
||||
"rollingUpdate": {
|
||||
"maxUnavailable": "25%",
|
||||
"maxSurge": "25%"
|
||||
}
|
||||
},
|
||||
"revisionHistoryLimit": 10,
|
||||
"progressDeadlineSeconds": 600
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
165
mock-payloads/deployments/test-deploy02.json
Normal file
165
mock-payloads/deployments/test-deploy02.json
Normal file
@ -0,0 +1,165 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "29df64b9-da70-4044-ac07-4fcff7c3eb5c",
|
||||
"kind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"resource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"name": "test-deploy02",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "test-deploy02",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test-deploy02\",\"namespace\":\"test1\"},\"spec\":{\"replicas\":3,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}]}}}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "apps/v1",
|
||||
"time": "2020-10-11T07:25:27Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:progressDeadlineSeconds": {},
|
||||
"f:replicas": {},
|
||||
"f:revisionHistoryLimit": {},
|
||||
"f:selector": {
|
||||
"f:matchLabels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:strategy": {
|
||||
"f:rollingUpdate": {
|
||||
".": {},
|
||||
"f:maxSurge": {},
|
||||
"f:maxUnavailable": {}
|
||||
},
|
||||
"f:type": {}
|
||||
},
|
||||
"f:template": {
|
||||
"f:metadata": {
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 3,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "RollingUpdate",
|
||||
"rollingUpdate": {
|
||||
"maxUnavailable": "25%",
|
||||
"maxSurge": "25%"
|
||||
}
|
||||
},
|
||||
"revisionHistoryLimit": 10,
|
||||
"progressDeadlineSeconds": 600
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
197
mock-payloads/deployments/test-deploy03.json
Normal file
197
mock-payloads/deployments/test-deploy03.json
Normal file
@ -0,0 +1,197 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "2f95b6dc-0dd9-4729-9cd3-d5577d2b0621",
|
||||
"kind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"resource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"name": "test-deploy03",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "test-deploy03",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test-deploy03\",\"namespace\":\"test1\"},\"spec\":{\"replicas\":3,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"image\":\"jmsearcy/twrtools:latest\",\"name\":\"toolbox\",\"ports\":[{\"containerPort\":8080}]}],\"initContainers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}]}}}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "apps/v1",
|
||||
"time": "2020-10-11T07:26:36Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:progressDeadlineSeconds": {},
|
||||
"f:replicas": {},
|
||||
"f:revisionHistoryLimit": {},
|
||||
"f:selector": {
|
||||
"f:matchLabels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:strategy": {
|
||||
"f:rollingUpdate": {
|
||||
".": {},
|
||||
"f:maxSurge": {},
|
||||
"f:maxUnavailable": {}
|
||||
},
|
||||
"f:type": {}
|
||||
},
|
||||
"f:template": {
|
||||
"f:metadata": {
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"toolbox\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:initContainers": {
|
||||
".": {},
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 3,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"initContainers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "toolbox",
|
||||
"image": "jmsearcy/twrtools:latest",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "Always"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "RollingUpdate",
|
||||
"rollingUpdate": {
|
||||
"maxUnavailable": "25%",
|
||||
"maxSurge": "25%"
|
||||
}
|
||||
},
|
||||
"revisionHistoryLimit": 10,
|
||||
"progressDeadlineSeconds": 600
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
197
mock-payloads/deployments/test-deploy04.json
Normal file
197
mock-payloads/deployments/test-deploy04.json
Normal file
@ -0,0 +1,197 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "2d213641-c136-49d5-b162-a0d2593639f7",
|
||||
"kind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"resource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"kind": "Deployment"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "apps",
|
||||
"version": "v1",
|
||||
"resource": "deployments"
|
||||
},
|
||||
"name": "test-deploy04",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "test-deploy04",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test-deploy04\",\"namespace\":\"test1\"},\"spec\":{\"replicas\":3,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}],\"initContainers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes-init\",\"ports\":[{\"containerPort\":8080}]}]}}}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "apps/v1",
|
||||
"time": "2020-10-11T07:30:11Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:progressDeadlineSeconds": {},
|
||||
"f:replicas": {},
|
||||
"f:revisionHistoryLimit": {},
|
||||
"f:selector": {
|
||||
"f:matchLabels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:strategy": {
|
||||
"f:rollingUpdate": {
|
||||
".": {},
|
||||
"f:maxSurge": {},
|
||||
"f:maxUnavailable": {}
|
||||
},
|
||||
"f:type": {}
|
||||
},
|
||||
"f:template": {
|
||||
"f:metadata": {
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:app": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:initContainers": {
|
||||
".": {},
|
||||
"k:{\"name\":\"hello-kubernetes-init\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 3,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"app": "hello-kubernetes"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"initContainers": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "RollingUpdate",
|
||||
"rollingUpdate": {
|
||||
"maxUnavailable": "25%",
|
||||
"maxSurge": "25%"
|
||||
}
|
||||
},
|
||||
"revisionHistoryLimit": 10,
|
||||
"progressDeadlineSeconds": 600
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
183
mock-payloads/deployments/test-deploy05.json
Normal file
183
mock-payloads/deployments/test-deploy05.json
Normal file
@ -0,0 +1,183 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "a1b56548-759b-4d44-afd1-d4aae8714d04",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"namespace": "test2",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "system:serviceaccount:kube-system:replicaset-controller",
|
||||
"uid": "b2066843-0bb9-49d3-af8c-17408cc11b3b",
|
||||
"groups": [
|
||||
"system:serviceaccounts",
|
||||
"system:serviceaccounts:kube-system",
|
||||
"system:authenticated"
|
||||
]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"generateName": "test-deploy05-6bbdbd8bc6-",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"app": "hello-kubernetes",
|
||||
"k8s.twr.io/imageswap": "disabled",
|
||||
"pod-template-hash": "6bbdbd8bc6"
|
||||
},
|
||||
"ownerReferences": [
|
||||
{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "ReplicaSet",
|
||||
"name": "test-deploy05-6bbdbd8bc6",
|
||||
"uid": "73ceb99f-9bca-42c8-95c6-0c7a08f33c81",
|
||||
"controller": true,
|
||||
"blockOwnerDeletion": true
|
||||
}
|
||||
],
|
||||
"managedFields": [
|
||||
{
|
||||
"manager": "kube-controller-manager",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2021-02-02T07:03:41Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:generateName": {},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:app": {},
|
||||
"f:k8s.twr.io/imageswap": {},
|
||||
"f:pod-template-hash": {}
|
||||
},
|
||||
"f:ownerReferences": {
|
||||
".": {},
|
||||
"k:{\"uid\":\"73ceb99f-9bca-42c8-95c6-0c7a08f33c81\"}": {
|
||||
".": {},
|
||||
"f:apiVersion": {},
|
||||
"f:blockOwnerDeletion": {},
|
||||
"f:controller": {},
|
||||
"f:kind": {},
|
||||
"f:name": {},
|
||||
"f:uid": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "default-token-4hrkz",
|
||||
"secret": {
|
||||
"secretName": "default-token-4hrkz"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "default-token-4hrkz",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}
|
||||
],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [
|
||||
{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
},
|
||||
{
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}
|
||||
],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
147
mock-payloads/pods/test-pod01.json
Normal file
147
mock-payloads/pods/test-pod01.json
Normal file
@ -0,0 +1,147 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "60df4b0b-8856-4ce7-9fb3-bc8034856995",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"name": "test-pod01",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod01",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod01\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"jmsearcy/toolbox:latest\",\"name\":\"toolbox\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T05:15:41Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"toolbox\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf"
|
||||
}
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "toolbox",
|
||||
"image": "jmsearcy/toolbox:latest",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "Always"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
350
mock-payloads/pods/test-pod02.json
Normal file
350
mock-payloads/pods/test-pod02.json
Normal file
@ -0,0 +1,350 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "8350e416-408e-4d89-b219-4c6811a2e099",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"name": "test-pod02",
|
||||
"namespace": "test1",
|
||||
"operation": "UPDATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod02",
|
||||
"namespace": "test1",
|
||||
"uid": "7a918920-ae2a-4226-bd6d-ee7ba972842e",
|
||||
"resourceVersion": "169045",
|
||||
"creationTimestamp": "2020-10-11T03:33:21Z",
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod02\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubelet",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T03:33:21Z",
|
||||
"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\":\"10.244.0.59\"}": {
|
||||
".": {},
|
||||
"f:ip": {}
|
||||
}
|
||||
},
|
||||
"f:startTime": {}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T05:18:19Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf",
|
||||
"defaultMode": 420
|
||||
}
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"nodeName": "kind-control-plane",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Running",
|
||||
"conditions": [{
|
||||
"type": "Initialized",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "Ready",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "ContainersReady",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "PodScheduled",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}],
|
||||
"hostIP": "172.18.0.2",
|
||||
"podIP": "10.244.0.59",
|
||||
"podIPs": [{
|
||||
"ip": "10.244.0.59"
|
||||
}],
|
||||
"startTime": "2020-10-11T03:33:21Z",
|
||||
"containerStatuses": [{
|
||||
"name": "hello-kubernetes",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2020-10-11T03:33:21Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": true,
|
||||
"restartCount": 0,
|
||||
"image": "docker.io/jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "docker.io/jmsearcy/hello-kubernetes@sha256:88193b1092d70d8b0e38ea8aef69ae642366cde7be0b1bdb449f68bce51fc04d",
|
||||
"containerID": "containerd://b10db945c621733b13bf37a1548af65d5db743493f3bca81ba178f6dd9df62c1",
|
||||
"started": true
|
||||
}],
|
||||
"qosClass": "BestEffort"
|
||||
}
|
||||
},
|
||||
"oldObject": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod02",
|
||||
"namespace": "test1",
|
||||
"uid": "7a918920-ae2a-4226-bd6d-ee7ba972842e",
|
||||
"resourceVersion": "169045",
|
||||
"creationTimestamp": "2020-10-11T03:33:21Z",
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod02\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf",
|
||||
"defaultMode": 420
|
||||
}
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"nodeName": "kind-control-plane",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Running",
|
||||
"conditions": [{
|
||||
"type": "Initialized",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "Ready",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "ContainersReady",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}, {
|
||||
"type": "PodScheduled",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:33:21Z"
|
||||
}],
|
||||
"hostIP": "172.18.0.2",
|
||||
"podIP": "10.244.0.59",
|
||||
"podIPs": [{
|
||||
"ip": "10.244.0.59"
|
||||
}],
|
||||
"startTime": "2020-10-11T03:33:21Z",
|
||||
"containerStatuses": [{
|
||||
"name": "hello-kubernetes",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2020-10-11T03:33:21Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": true,
|
||||
"restartCount": 0,
|
||||
"image": "docker.io/jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "docker.io/jmsearcy/hello-kubernetes@sha256:88193b1092d70d8b0e38ea8aef69ae642366cde7be0b1bdb449f68bce51fc04d",
|
||||
"containerID": "containerd://b10db945c621733b13bf37a1548af65d5db743493f3bca81ba178f6dd9df62c1",
|
||||
"started": true
|
||||
}],
|
||||
"qosClass": "BestEffort"
|
||||
}
|
||||
},
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "UpdateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
184
mock-payloads/pods/test-pod03.json
Normal file
184
mock-payloads/pods/test-pod03.json
Normal file
@ -0,0 +1,184 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "82a5b842-0cfb-4293-abea-0c2603d8a16a",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"name": "test-pod03",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod03",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod03\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"jmsearcy/toolbox:latest\",\"name\":\"toolbox\",\"ports\":[{\"containerPort\":8080}]}],\"initContainers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes-init\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T05:19:34Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"toolbox\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:initContainers": {
|
||||
".": {},
|
||||
"k:{\"name\":\"hello-kubernetes-init\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf"
|
||||
}
|
||||
}],
|
||||
"initContainers": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "toolbox",
|
||||
"image": "jmsearcy/toolbox:latest",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "Always"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
448
mock-payloads/pods/test-pod04.json
Normal file
448
mock-payloads/pods/test-pod04.json
Normal file
@ -0,0 +1,448 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "ffeb2e4a-a440-4f70-90cb-9e960f7471c4",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"name": "test-pod04",
|
||||
"namespace": "test1",
|
||||
"operation": "UPDATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod04",
|
||||
"namespace": "test1",
|
||||
"uid": "191d5498-9053-49c1-b106-46a73e1ae9d7",
|
||||
"resourceVersion": "173491",
|
||||
"creationTimestamp": "2020-10-11T03:41:20Z",
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod04\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}],\"initContainers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes-init\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubelet",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T03:41:21Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:status": {
|
||||
"f:conditions": {
|
||||
"k:{\"type\":\"ContainersReady\"}": {
|
||||
".": {},
|
||||
"f:lastProbeTime": {},
|
||||
"f:lastTransitionTime": {},
|
||||
"f:message": {},
|
||||
"f:reason": {},
|
||||
"f:status": {},
|
||||
"f:type": {}
|
||||
},
|
||||
"k:{\"type\":\"Initialized\"}": {
|
||||
".": {},
|
||||
"f:lastProbeTime": {},
|
||||
"f:lastTransitionTime": {},
|
||||
"f:message": {},
|
||||
"f:reason": {},
|
||||
"f:status": {},
|
||||
"f:type": {}
|
||||
},
|
||||
"k:{\"type\":\"Ready\"}": {
|
||||
".": {},
|
||||
"f:lastProbeTime": {},
|
||||
"f:lastTransitionTime": {},
|
||||
"f:message": {},
|
||||
"f:reason": {},
|
||||
"f:status": {},
|
||||
"f:type": {}
|
||||
}
|
||||
},
|
||||
"f:containerStatuses": {},
|
||||
"f:hostIP": {},
|
||||
"f:initContainerStatuses": {},
|
||||
"f:podIP": {},
|
||||
"f:podIPs": {
|
||||
".": {},
|
||||
"k:{\"ip\":\"10.244.0.61\"}": {
|
||||
".": {},
|
||||
"f:ip": {}
|
||||
}
|
||||
},
|
||||
"f:startTime": {}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T05:21:38Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"hello-kubernetes\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:initContainers": {
|
||||
".": {},
|
||||
"k:{\"name\":\"hello-kubernetes-init\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf",
|
||||
"defaultMode": 420
|
||||
}
|
||||
}],
|
||||
"initContainers": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"nodeName": "kind-control-plane",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Pending",
|
||||
"conditions": [{
|
||||
"type": "Initialized",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotInitialized",
|
||||
"message": "containers with incomplete status: [hello-kubernetes-init]"
|
||||
}, {
|
||||
"type": "Ready",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotReady",
|
||||
"message": "containers with unready status: [hello-kubernetes]"
|
||||
}, {
|
||||
"type": "ContainersReady",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotReady",
|
||||
"message": "containers with unready status: [hello-kubernetes]"
|
||||
}, {
|
||||
"type": "PodScheduled",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z"
|
||||
}],
|
||||
"hostIP": "172.18.0.2",
|
||||
"podIP": "10.244.0.61",
|
||||
"podIPs": [{
|
||||
"ip": "10.244.0.61"
|
||||
}],
|
||||
"startTime": "2020-10-11T03:41:20Z",
|
||||
"initContainerStatuses": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2020-10-11T03:41:21Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": false,
|
||||
"restartCount": 0,
|
||||
"image": "docker.io/jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "docker.io/jmsearcy/hello-kubernetes@sha256:88193b1092d70d8b0e38ea8aef69ae642366cde7be0b1bdb449f68bce51fc04d",
|
||||
"containerID": "containerd://27139565511a49753f7415f27803c446fe7b852facebd72af06e27b1cd4aa536"
|
||||
}],
|
||||
"containerStatuses": [{
|
||||
"name": "hello-kubernetes",
|
||||
"state": {
|
||||
"waiting": {
|
||||
"reason": "PodInitializing"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": false,
|
||||
"restartCount": 0,
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "",
|
||||
"started": false
|
||||
}],
|
||||
"qosClass": "BestEffort"
|
||||
}
|
||||
},
|
||||
"oldObject": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod04",
|
||||
"namespace": "test1",
|
||||
"uid": "191d5498-9053-49c1-b106-46a73e1ae9d7",
|
||||
"resourceVersion": "173491",
|
||||
"creationTimestamp": "2020-10-11T03:41:20Z",
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod04\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes\",\"ports\":[{\"containerPort\":8080}]}],\"initContainers\":[{\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"name\":\"hello-kubernetes-init\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf",
|
||||
"defaultMode": 420
|
||||
}
|
||||
}],
|
||||
"initContainers": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"image": "paulbouwer/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "hello-kubernetes",
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "IfNotPresent"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"nodeName": "kind-control-plane",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Pending",
|
||||
"conditions": [{
|
||||
"type": "Initialized",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotInitialized",
|
||||
"message": "containers with incomplete status: [hello-kubernetes-init]"
|
||||
}, {
|
||||
"type": "Ready",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotReady",
|
||||
"message": "containers with unready status: [hello-kubernetes]"
|
||||
}, {
|
||||
"type": "ContainersReady",
|
||||
"status": "False",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z",
|
||||
"reason": "ContainersNotReady",
|
||||
"message": "containers with unready status: [hello-kubernetes]"
|
||||
}, {
|
||||
"type": "PodScheduled",
|
||||
"status": "True",
|
||||
"lastProbeTime": null,
|
||||
"lastTransitionTime": "2020-10-11T03:41:20Z"
|
||||
}],
|
||||
"hostIP": "172.18.0.2",
|
||||
"podIP": "10.244.0.61",
|
||||
"podIPs": [{
|
||||
"ip": "10.244.0.61"
|
||||
}],
|
||||
"startTime": "2020-10-11T03:41:20Z",
|
||||
"initContainerStatuses": [{
|
||||
"name": "hello-kubernetes-init",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2020-10-11T03:41:21Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": false,
|
||||
"restartCount": 0,
|
||||
"image": "docker.io/jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "docker.io/jmsearcy/hello-kubernetes@sha256:88193b1092d70d8b0e38ea8aef69ae642366cde7be0b1bdb449f68bce51fc04d",
|
||||
"containerID": "containerd://27139565511a49753f7415f27803c446fe7b852facebd72af06e27b1cd4aa536"
|
||||
}],
|
||||
"containerStatuses": [{
|
||||
"name": "hello-kubernetes",
|
||||
"state": {
|
||||
"waiting": {
|
||||
"reason": "PodInitializing"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": false,
|
||||
"restartCount": 0,
|
||||
"image": "jmsearcy/hello-kubernetes:1.5",
|
||||
"imageID": "",
|
||||
"started": false
|
||||
}],
|
||||
"qosClass": "BestEffort"
|
||||
}
|
||||
},
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "UpdateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
147
mock-payloads/pods/test-pod05.json
Normal file
147
mock-payloads/pods/test-pod05.json
Normal file
@ -0,0 +1,147 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "2ca21f3f-a77f-4145-b7ac-bf656a976f46",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"name": "test-pod05",
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "test-pod05",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"annotations": {
|
||||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"run\":\"toolbox\"},\"name\":\"test-pod05\",\"namespace\":\"test1\"},\"spec\":{\"containers\":[{\"image\":\"nginx:latest\",\"name\":\"nginx\",\"ports\":[{\"containerPort\":8080}]}]}}\n"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T07:48:03Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:annotations": {
|
||||
".": {},
|
||||
"f:kubectl.kubernetes.io/last-applied-configuration": {}
|
||||
},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"nginx\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf"
|
||||
}
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "nginx",
|
||||
"image": "nginx:latest",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "Always"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
140
mock-payloads/pods/test-pod06.json
Normal file
140
mock-payloads/pods/test-pod06.json
Normal file
@ -0,0 +1,140 @@
|
||||
{
|
||||
"kind": "AdmissionReview",
|
||||
"apiVersion": "admission.k8s.io/v1beta1",
|
||||
"request": {
|
||||
"uid": "1ee8aaf2-d96b-401e-9db6-76282587df24",
|
||||
"kind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"resource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"requestKind": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"kind": "Pod"
|
||||
},
|
||||
"requestResource": {
|
||||
"group": "",
|
||||
"version": "v1",
|
||||
"resource": "pods"
|
||||
},
|
||||
"namespace": "test1",
|
||||
"operation": "CREATE",
|
||||
"userInfo": {
|
||||
"username": "kubernetes-admin",
|
||||
"groups": ["system:masters", "system:authenticated"]
|
||||
},
|
||||
"object": {
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"generateName": "test-pod06-",
|
||||
"namespace": "test1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"run": "toolbox"
|
||||
},
|
||||
"managedFields": [{
|
||||
"manager": "kubectl",
|
||||
"operation": "Update",
|
||||
"apiVersion": "v1",
|
||||
"time": "2020-10-11T08:18:39Z",
|
||||
"fieldsType": "FieldsV1",
|
||||
"fieldsV1": {
|
||||
"f:metadata": {
|
||||
"f:generateName": {},
|
||||
"f:labels": {
|
||||
".": {},
|
||||
"f:run": {}
|
||||
}
|
||||
},
|
||||
"f:spec": {
|
||||
"f:containers": {
|
||||
"k:{\"name\":\"nginx\"}": {
|
||||
".": {},
|
||||
"f:image": {},
|
||||
"f:imagePullPolicy": {},
|
||||
"f:name": {},
|
||||
"f:ports": {
|
||||
".": {},
|
||||
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
|
||||
".": {},
|
||||
"f:containerPort": {},
|
||||
"f:protocol": {}
|
||||
}
|
||||
},
|
||||
"f:resources": {},
|
||||
"f:terminationMessagePath": {},
|
||||
"f:terminationMessagePolicy": {}
|
||||
}
|
||||
},
|
||||
"f:dnsPolicy": {},
|
||||
"f:enableServiceLinks": {},
|
||||
"f:restartPolicy": {},
|
||||
"f:schedulerName": {},
|
||||
"f:securityContext": {},
|
||||
"f:terminationGracePeriodSeconds": {}
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"secret": {
|
||||
"secretName": "default-token-b9kpf"
|
||||
}
|
||||
}],
|
||||
"containers": [{
|
||||
"name": "nginx",
|
||||
"image": "nginx:latest",
|
||||
"ports": [{
|
||||
"containerPort": 8080,
|
||||
"protocol": "TCP"
|
||||
}],
|
||||
"resources": {},
|
||||
"volumeMounts": [{
|
||||
"name": "default-token-b9kpf",
|
||||
"readOnly": true,
|
||||
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
|
||||
}],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"terminationMessagePolicy": "File",
|
||||
"imagePullPolicy": "Always"
|
||||
}],
|
||||
"restartPolicy": "Always",
|
||||
"terminationGracePeriodSeconds": 30,
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"serviceAccountName": "default",
|
||||
"serviceAccount": "default",
|
||||
"securityContext": {},
|
||||
"schedulerName": "default-scheduler",
|
||||
"tolerations": [{
|
||||
"key": "node.kubernetes.io/not-ready",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}, {
|
||||
"key": "node.kubernetes.io/unreachable",
|
||||
"operator": "Exists",
|
||||
"effect": "NoExecute",
|
||||
"tolerationSeconds": 300
|
||||
}],
|
||||
"priority": 0,
|
||||
"enableServiceLinks": true
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
"oldObject": null,
|
||||
"dryRun": false,
|
||||
"options": {
|
||||
"kind": "CreateOptions",
|
||||
"apiVersion": "meta.k8s.io/v1"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user