1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| $ kubectl get deployment test-k8s -o json { "apiVersion": "apps/v1", "kind": "Deployment", "metadata": { "annotations": { "deployment.kubernetes.io/revision": "4", "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test-k8s\",\"namespace\":\"default\"},\"spec\":{\"replicas\":5,\"selector\":{\"matchLabels\":{\"app\":\"test-k8s\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"test-k8s\"}},\"spec\":{\"containers\":[{\"image\":\"ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1\",\"name\":\"test-k8s\"}]}}}}\n" }, "creationTimestamp": "2022-01-07T06:16:44Z", "generation": 6, "name": "test-k8s", "namespace": "default", "resourceVersion": "16052", "uid": "ac382819-09e6-415b-a021-5110e94a5c1c" }, "spec": { "progressDeadlineSeconds": 600, "replicas": 5, "revisionHistoryLimit": 10, "selector": { "matchLabels": { "app": "test-k8s" } }, "strategy": { "rollingUpdate": { "maxSurge": "25%", "maxUnavailable": "25%" }, "type": "RollingUpdate" }, "template": { "metadata": { "annotations": { "kubectl.kubernetes.io/restartedAt": "2022-01-07T14:19:35+08:00" }, "creationTimestamp": null, "labels": { "app": "test-k8s" } }, "spec": { "containers": [ { "image": "ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1", "imagePullPolicy": "IfNotPresent", "name": "test-k8s", "resources": {}, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File" } ], "dnsPolicy": "ClusterFirst", "restartPolicy": "Always", "schedulerName": "default-scheduler", "securityContext": {}, "terminationGracePeriodSeconds": 30 } } }, "status": { "availableReplicas": 5, "conditions": [ { "lastTransitionTime": "2022-01-07T06:16:47Z", "lastUpdateTime": "2022-01-07T06:16:47Z", "message": "Deployment has minimum availability.", "reason": "MinimumReplicasAvailable", "status": "True", "type": "Available" }, { "lastTransitionTime": "2022-01-07T06:28:51Z", "lastUpdateTime": "2022-01-07T06:28:51Z", "message": "ReplicaSet \"test-k8s-cf5b7766c\" has successfully progressed.", "reason": "NewReplicaSetAvailable", "status": "True", "type": "Progressing" } ], "observedGeneration": 6, "readyReplicas": 5, "replicas": 5, "updatedReplicas": 5 } }
$ kubectl get deployment test-k8s -o json >> deployment2.json
$ ll 总用量 12 -rw-r--r-- 1 root root 3252 1月 7 14:36 deployment2.json -rw-r--r-- 1 root root 2093 1月 7 14:33 deployment2.yaml -rw-r--r-- 1 root root 549 1月 7 14:16 deployment.yaml
|