用get命令导出已部署资源的配置,然后我们也可以据此修改把不熟悉的,没有的删除掉
[root@mcwk8s03 demo]# kubectl get deployNAMEREADYUP-TO-DATEAVAILABLEAGEnginx-deployment3/33351m[root@mcwk8s03 demo]# kubectl get deploy/nginx-deployment --export -o yamlFlag --export has been deprecated, This flag is deprecated and will be removed in future.apiVersion: extensions/v1beta1kind: Deploymentmetadata:annotations:deployment.kubernetes.io/revision: "1"creationTimestamp: nullgeneration: 1labels:app: nginxname: nginx-deploymentselfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deploymentspec:progressDeadlineSeconds: 600replicas: 3revisionHistoryLimit: 10selector:matchLabels:app: nginxstrategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdatetemplate:metadata:creationTimestamp: nulllabels:app: nginxspec:containers:- image: nginx:1.14.2imagePullPolicy: IfNotPresentname: nginxports:- containerPort: 80protocol: TCPresources: {}terminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30status: {}[root@mcwk8s03 demo]#[root@mcwk8s03 demo]#[root@mcwk8s03 demo]#[root@mcwk8s03 demo]# kubectl get deploy/nginx-deployment --export -o=yamlFlag --export has been deprecated, This flag is deprecated and will be removed in future.apiVersion: extensions/v1beta1kind: Deploymentmetadata:annotations:deployment.kubernetes.io/revision: "1"creationTimestamp: nullgeneration: 1labels:app: nginxname: nginx-deploymentselfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deploymentspec:progressDeadlineSeconds: 600replicas: 3revisionHistoryLimit: 10selector:matchLabels:app: nginxstrategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdatetemplate:metadata:creationTimestamp: nulllabels:app: nginxspec:containers:- image: nginx:1.14.2imagePullPolicy: IfNotPresentname: nginxports:- containerPort: 80protocol: TCPresources: {}terminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30status: {}[root@mcwk8s03 demo]# kubectl get deploy/nginx-deployment --export -o=yaml >myGet.yamlFlag --export has been deprecated, This flag is deprecated and will be removed in future.[root@mcwk8s03 demo]# head -3 myGet.yamlapiVersion: extensions/v1beta1kind: Deploymentmetadata:[root@mcwk8s03 demo]# Pod容器的字段拼写忘记了explain比如我们忘了哪个字段是怎么拼写了可以像下面这样找到
[root@mcwk8s03 demo]# kubectl explain pods.spec.containersKIND:PodVERSION:v1RESOURCE: containers <[]Object>DESCRIPTION:List of containers belonging to the pod. Containers cannot currently beadded or removed. There must be at least one container in a Pod. Cannot beupdated.A single application container that you want to run within a pod.FIELDS:args<[]string>Arguments to the entrypoint. The docker image's CMD is
经验总结扩展阅读
- 丝绸之路开辟于什么朝代
- 流放之路S20卡兰德之湖赛季上线时间说明
- 2023年7月9日适不适合搬新家
- 回门酒的请帖怎么写 诚邀贵宾之请
- 真正“搞”懂HTTP协议03之时间穿梭
- 网络协议之:redis protocol 详解
- 信号量 C# 多线程访问之 SemaphoreSlim【C# 进阶】
- JavaScript之数组高阶API—reduce
- 奥比岛暗夜袭击第一轮金块失踪之谜通关攻略
- 青蟹为什么那么贵