-
|
I'm using the following I'm wondering if there is a way how to achieve the same result with |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
Example of such manifest: {
"apiVersion": "v1",
"items": [
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"cni.projectcalico.org/podIP": "10.11.1.4/32"
},
"creationTimestamp": "2021-02-02T00:23:33Z",
"generateName": "chartmuseum-67d6894689-",
"labels": {
"app": "chartmuseum",
"pod-template-hash": "67d6894689",
"release": "chartmuseum"
},
"managedFields": [
{
"apiVersion": "v1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:generateName": {},
"f:labels": {
".": {},
"f:app": {},
"f:pod-template-hash": {},
"f:release": {}
},
"f:ownerReferences": {
".": {},
"k:{\"uid\":\"af906a9a-1555-40bb-80d6-e87aefa05492\"}": {
".": {},
"f:apiVersion": {},
"f:blockOwnerDeletion": {},
"f:controller": {},
"f:kind": {},
"f:name": {},
"f:uid": {}
}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"chartmuseum\"}": {
".": {},
"f:args": {},
"f:env": {
".": {},
"k:{\"name\":\"CHART_POST_FORM_FIELD_NAME\"}": {
".": {},
"f:name": {},
"f:value": {}
},
"k:{\"name\":\"DISABLE_METRICS\"}": {
".": {},
"f:name": {},
"f:value": {}
},
"k:{\"name\":\"LOG_JSON\"}": {
".": {},
"f:name": {},
"f:value": {}
},
"k:{\"name\":\"PROV_POST_FORM_FIELD_NAME\"}": {
".": {},
"f:name": {},
"f:value": {}
},
"k:{\"name\":\"STORAGE\"}": {
".": {},
"f:name": {},
"f:value": {}
},
"k:{\"name\":\"STORAGE_GOOGLE_BUCKET\"}": {
".": {},
"f:name": {},
"f:value": {}
}
},
"f:image": {},
"f:imagePullPolicy": {},
"f:livenessProbe": {
".": {},
"f:failureThreshold": {},
"f:httpGet": {
".": {},
"f:path": {},
"f:port": {},
"f:scheme": {}
},
"f:initialDelaySeconds": {},
"f:periodSeconds": {},
"f:successThreshold": {},
"f:timeoutSeconds": {}
},
"f:name": {},
"f:ports": {
".": {},
"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": {
".": {},
"f:containerPort": {},
"f:name": {},
"f:protocol": {}
}
},
"f:readinessProbe": {
".": {},
"f:failureThreshold": {},
"f:httpGet": {
".": {},
"f:path": {},
"f:port": {},
"f:scheme": {}
},
"f:initialDelaySeconds": {},
"f:periodSeconds": {},
"f:successThreshold": {},
"f:timeoutSeconds": {}
},
"f:resources": {},
"f:securityContext": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {
".": {},
"f:fsGroup": {}
},
"f:serviceAccount": {},
"f:serviceAccountName": {},
"f:terminationGracePeriodSeconds": {},
"f:volumes": {
".": {},
"k:{\"name\":\"storage-volume\"}": {
".": {},
"f:emptyDir": {},
"f:name": {}
}
}
}
},
"manager": "kube-controller-manager",
"operation": "Update",
"time": "2021-02-02T00:23:31Z"
},
{
"apiVersion": "v1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:cni.projectcalico.org/podIP": {}
}
}
},
"manager": "calico",
"operation": "Update",
"time": "2021-02-02T00:23:34Z"
},
{
"apiVersion": "v1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
".": {},
"k:{\"type\":\"cloud.google.com/load-balancer-neg-ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:message": {},
"f:reason": {},
"f:status": {},
"f:type": {}
}
}
}
},
"manager": "glbc",
"operation": "Update",
"time": "2021-02-02T00:24:02Z"
},
{
"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\":\"10.11.1.4\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"manager": "kubelet",
"operation": "Update",
"time": "2021-02-02T00:24:08Z"
}
],
"name": "chartmuseum-67d6894689-ldpgx",
"namespace": "chartmuseum",
"ownerReferences": [
{
"apiVersion": "apps/v1",
"blockOwnerDeletion": true,
"controller": true,
"kind": "ReplicaSet",
"name": "chartmuseum-67d6894689",
"uid": "af906a9a-1555-40bb-80d6-e87aefa05492"
}
],
"resourceVersion": "58964880",
"selfLink": "/api/v1/namespaces/chartmuseum/pods/chartmuseum-67d6894689-ldpgx",
"uid": "d48351df-147f-47e8-a5dc-034878f1e7ba"
},
"spec": {
"containers": [
{
"args": [
"--port=8080"
],
"env": [
{
"name": "CHART_POST_FORM_FIELD_NAME",
"value": "chart"
},
{
"name": "DISABLE_METRICS",
"value": "true"
},
{
"name": "LOG_JSON",
"value": "true"
},
{
"name": "PROV_POST_FORM_FIELD_NAME",
"value": "prov"
},
{
"name": "STORAGE",
"value": "google"
},
{
"name": "STORAGE_GOOGLE_BUCKET",
"value": "my-chartmuseum-bucket-123456"
}
],
"image": "registry.cn-shanghai.aliyuncs.com/c7n/chartmuseum:v0.12.0-alpha.1",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/health",
"port": "http",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"name": "chartmuseum",
"ports": [
{
"containerPort": 8080,
"name": "http",
"protocol": "TCP"
}
],
"readinessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/health",
"port": "http",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"resources": {},
"securityContext": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"name": "chartmuseum-token-ssdgj",
"readOnly": true
}
]
}
],
"dnsPolicy": "ClusterFirst",
"enableServiceLinks": true,
"nodeName": "gke-myproject-euwe2-pool-1-69a53689-vez2",
"priority": 0,
"readinessGates": [
{
"conditionType": "cloud.google.com/load-balancer-neg-ready"
}
],
"restartPolicy": "Always",
"schedulerName": "default-scheduler",
"securityContext": {
"fsGroup": 1000
},
"serviceAccount": "chartmuseum",
"serviceAccountName": "chartmuseum",
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 300
},
{
"effect": "NoExecute",
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"tolerationSeconds": 300
}
],
"volumes": [
{
"emptyDir": {},
"name": "storage-volume"
},
{
"name": "chartmuseum-token-ssdgj",
"secret": {
"defaultMode": 420,
"secretName": "chartmuseum-token-ssdgj"
}
}
]
},
"status": {
"conditions": [
{
"lastProbeTime": null,
"lastTransitionTime": null,
"message": "Pod has become Healthy in NEG \"Key{\\\"k8s1-4cdd6d80-chartmuseum-chartmuseum-8080-e1c09d27\\\", zone: \\\"europe-west2-b\\\"}\" attached to BackendService \"Key{\\\"k8s1-4cdd6d80-chartmuseum-chartmuseum-8080-e1c09d27\\\", region: \\\"europe-west2\\\"}\". Marking condition \"cloud.google.com/load-balancer-neg-ready\" to True.",
"reason": "LoadBalancerNegReady",
"status": "True",
"type": "cloud.google.com/load-balancer-neg-ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2021-02-02T00:23:33Z",
"status": "True",
"type": "Initialized"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2021-02-02T00:24:08Z",
"status": "True",
"type": "Ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2021-02-02T00:24:08Z",
"status": "True",
"type": "ContainersReady"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2021-02-02T00:23:33Z",
"status": "True",
"type": "PodScheduled"
}
],
"containerStatuses": [
{
"containerID": "docker://a0d808485fe649c5653769e5e0b1fe29fb91e76fda7701ccad66d5ad2617571f",
"image": "registry.cn-shanghai.aliyuncs.com/c7n/chartmuseum:v0.12.0-alpha.1",
"imageID": "docker-pullable://registry.cn-shanghai.aliyuncs.com/c7n/chartmuseum@sha256:b00eeccd3c8bedb63fcf03adccc3b695e64e50c06c96054fa7440539df53f707",
"lastState": {},
"name": "chartmuseum",
"ready": true,
"restartCount": 0,
"started": true,
"state": {
"running": {
"startedAt": "2021-02-02T00:23:55Z"
}
}
}
],
"hostIP": "10.10.0.49",
"phase": "Running",
"podIP": "10.11.1.4",
"podIPs": [
{
"ip": "10.11.1.4"
}
],
"qosClass": "BestEffort",
"startTime": "2021-02-02T00:23:33Z"
}
}
],
"kind": "List",
"metadata": {
"resourceVersion": "",
"selfLink": ""
}
}Expected output: {
"apiVersion": "v1",
"items": [
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"cni.projectcalico.org/podIP": "10.11.1.4/32"
},
"generateName": "chartmuseum-67d6894689-",
"labels": {
"app": "chartmuseum",
"pod-template-hash": "67d6894689",
"release": "chartmuseum"
},
"name": "chartmuseum-67d6894689-ldpgx",
"namespace": "chartmuseum",
"ownerReferences": [
{
"apiVersion": "apps/v1",
"blockOwnerDeletion": true,
"controller": true,
"kind": "ReplicaSet",
"name": "chartmuseum-67d6894689"
}
]
},
"spec": {
"containers": [
{
"args": [
"--port=8080"
],
"env": [
{
"name": "CHART_POST_FORM_FIELD_NAME",
"value": "chart"
},
{
"name": "DISABLE_METRICS",
"value": "true"
},
{
"name": "LOG_JSON",
"value": "true"
},
{
"name": "PROV_POST_FORM_FIELD_NAME",
"value": "prov"
},
{
"name": "STORAGE",
"value": "google"
},
{
"name": "STORAGE_GOOGLE_BUCKET",
"value": "my-chartmuseum-bucket-123456"
}
],
"image": "registry.cn-shanghai.aliyuncs.com/c7n/chartmuseum:v0.12.0-alpha.1",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/health",
"port": "http",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"name": "chartmuseum",
"ports": [
{
"containerPort": 8080,
"name": "http",
"protocol": "TCP"
}
],
"readinessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/health",
"port": "http",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"name": "chartmuseum-token-ssdgj",
"readOnly": true
}
]
}
],
"dnsPolicy": "ClusterFirst",
"enableServiceLinks": true,
"nodeName": "gke-myproject-euwe2-pool-1-69a53689-vez2",
"priority": 0,
"readinessGates": [
{
"conditionType": "cloud.google.com/load-balancer-neg-ready"
}
],
"restartPolicy": "Always",
"schedulerName": "default-scheduler",
"securityContext": {
"fsGroup": 1000
},
"serviceAccount": "chartmuseum",
"serviceAccountName": "chartmuseum",
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 300
},
{
"effect": "NoExecute",
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"tolerationSeconds": 300
}
],
"volumes": [
{
"name": "storage-volume"
},
{
"name": "chartmuseum-token-ssdgj",
"secret": {
"defaultMode": 420,
"secretName": "chartmuseum-token-ssdgj"
}
}
]
}
}
],
"kind": "List"
} |
Beta Was this translation helpful? Give feedback.
-
|
Wow this is a complex example - and the sample is quite large. I think you can do this without For instance instead of: you could (snippet): |
Beta Was this translation helpful? Give feedback.
-
|
I see |
Beta Was this translation helpful? Give feedback.
Wow this is a complex example - and the sample is quite large. I think you can do this without
walkorifby filtering withing the delete expression.For instance instead of:
you could (snippet):