json数据:{"metadata":{"name":"mypod"}} yaml语法格式 metadata: name:mypod 数组嵌套 json数据:{"ports":[{"containerPort":"80",{"containerPort":"443"}}]} yaml语法格式 ports: - containerPort:80 - containerPort:443 资源对象文件策略 镜像
Pod中的初始化容器(Init Container)功能与此类似,它们为那些有先决条件的应用容器完成必要的初始设置,例如设置特殊权限、生成必要的iptables规则、设置数据库模式,以及获取最新的必要数据等。 有很多场景都需要在应用容器启动之前进行部分初始化操作,例如等待其他关联组件服务可用、基于环境变量或配置模板为应用程序生成配置文...
kubernetes.io/pod-name: loki-0 name: loki-0 namespace: loki-stack spec: containers: - args: - -config.file=/etc/loki/loki.yaml image: grafana/loki:2.3.0 livenessProbe: httpGet: path: /ready port: http-metrics initialDelaySeconds: 45 name: loki ports: - containerPort: 3100 name: ...
as schedulabledrain Drain node in preparation for maintenancetaint Update the taints on one or more nodesTroubleshooting and Debugging Commands:describe Show details of a specific resource or group of resourceslogs Print the logs for a container in a podattach Attach to a running containerexec Execut...
expose:获取服务、部署或 pod 并将其公开为新的 Kubernetes 服务。 运行:在集群上运行特定的镜像。 set:在对象上设置特定功能,例如设置环境变量,在 pod 模板中更新 Docker 镜像等。 explain:获取资源的文档,例如部署的文档。 get: 显示一个或多个资源。例如,您可以获取正在运行的 pod 列表或 pod 的 YAML 输出...
loki statefulset.kubernetes.io/pod-name: loki-0 name: loki-0 namespace: loki-stack spec: containers: - args: - -config.file=/etc/loki/loki.yaml image: grafana/loki:2.3.0 livenessProbe: httpGet: path: /ready port: http-metrics initialDelaySeconds: 45 name: loki ports: - containerPort...
kubectl delete pod--all 执行pod 命令 kubectl exec <pod-name>-- date kubectl exec <pod-name>--bash kubectl exec <pod-name>--ping10.24.51.9 通过bash获得 pod 中某个容器的TTY,相当于登录容器 kubectl exec-it <pod-name>-c <container-name>--bash ...
$ kubectl ai "create a foo namespace then create nginx pod in that namespace"✨ Attempting to apply the following manifest:apiVersion: v1kind: Namespacemetadata: name: foo---apiVersion: v1kind: Podmetadata: name: nginx namespace: foospec: containers: - name: nginx image: ng...
logtostderr--tls-server-name--client-certificate=--match-server-version--tls-server-name=--client-key-n--token--client-key=--namespace--token=--cluster--namespace=--tty--cluster=--one-output--user--container--password--user=--container=--password=--username--context--pod-running-time...
$ kubectl debug -it ${pod_name} --image=busybox:1.28 --target=${container_name} 2.2 调试示例一:通过附加调试容器对处于 Running 状态的 Pod 进行调试 创建一个 Pod,该 Pod 功能是从 S3 存储的一个桶 mybucket1 中获取文件 test.txt 并复制到本地目录 /data/test.txt, 再从此目录把 test....