gpt4 book ai didi

kubernetes - Kubernetes list 文件中的status值是什么意思

转载 作者:行者123 更新时间:2023-12-02 12:07:51 25 4
gpt4 key购买 nike

kubernetes list 文件中的“ status:”是什么意思

spec:
type: LoadBalancer
ports:
- name: "7000"
port: 7000
targetPort: 80
selector:
io.kompose.service: ams-app
status:
loadBalancer: {}

最佳答案

参见“Object Spec and Status

Every Kubernetes object includes two nested object fields that govern the object’s configuration: the object spec and the object status.

  • The spec, which you must provide, describes your desired state for the object–the characteristics that you want the object to have.
  • The status describes the actual state of the object, and is supplied and updated by the Kubernetes system.

At any given time, the Kubernetes Control Plane actively manages an object’s actual state to match the desired state you supplied.



所以:

For example, a Kubernetes Deployment is an object that can represent an application running on your cluster.
When you create the Deployment, you might set the Deployment spec to specify that you want three replicas of the application to be running.
The Kubernetes system reads the Deployment spec and starts three instances of your desired application–updating the status to match your spec.
If any of those instances should fail (a status change), the Kubernetes system responds to the difference between spec and status by making a correction–in this case, starting a replacement instance.



在您的情况下,您提到的内容与 Service类型的 LoadBalancer的发布匹配。

The actual creation of the load balancer happens asynchronously, and information about the provisioned balancer will be published in the Service’s status.loadBalancer field.
For example:


kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
clusterIP: 10.0.171.239
loadBalancerIP: 78.11.24.19
type: LoadBalancer
status:
loadBalancer:
ingress:
- ip: 146.148.47.155

关于kubernetes - Kubernetes list 文件中的status值是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48134304/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com