Kubernetes 小白学习笔记(23)--kubernetes的运维-管理Pod

本文介绍了如何获取和编辑Kubernetes集群中Pod的YAML配置文件。通过`kubectl get`命令可以得到Pod的详细信息,然后使用`kubectl edit`可以直接在线编辑,或者下载yaml文件本地修改后再应用更新。示例中展示了针对nginx Deployment的更新,包括设置副本数、选择器和容器信息。
摘要由CSDN通过智能技术生成

 

 

得到某个pod的yaml文件信息

 

通过更新yaml文件更新pod

nginx-deployment-limit.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  # Unique key of the Deployment instance
  name: deployment-example
spec:
  # 3 Pods should exist at all times.
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        # Apply this label to pods and default
        # the Deployment label selector to this value
        app: nginx
    spec:
      containers:
      - name: nginx
        # Run this image
        image: nginx:1.10

 

通过edit编辑pod信息

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

内容来自:

https://coding.imooc.com/class/284.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

软件工程小施同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值