定义Kubernetes资源的类型为Podmetadata: name: demo-web # 定义资源的名称 labels: # 为Pod贴上标签,后面会介绍其用处 app: demo-webspec...Service的类型,在这里使用NodePort来对外访问apiVersion: v1kind: Podmetadata: name: demo-web-copy labels: app: demo-webspec
以下是一个示例:apiVersion: apps/v1kind: StatefulSetmetadata: name: webspec: replicas: 3 serviceName: "nginx
示例服务的部署配置如下:apiVersion: apps/v1kind: Deploymentmetadata: name: webspec: selector: matchLabels:...示例Service资源的部署配置如下:apiVersion: v1kind: Servicemetadata: name: webspec: selector: app: web ports
首先,我们将StatefulSet的副本数量设置为2,将新版本Pod的副本数量设置为1::apiVersion: apps/v1kind: StatefulSetmetadata: name: webspec...resources: requests: storage: 1Gi---apiVersion: v1kind: Servicemetadata: name: webspec
v1metadata: name: &name translate annotations: traefik.ingress.kubernetes.io/router.entrypoints: webspec
更新后的YAML文件如下所示:apiVersion: apps/v1kind: StatefulSetmetadata: name: webspec: replicas: 3 selector:
=nginxappcat > nginx2.yaml << EOF---apiVersion: v1kind: ReplicationControllermetadata: name: nginx-webspec
② StatefulSet 不在手动创建pvc的方式 apiVersion: apps/v1beta1kind: StatefulSetmetadata: name: nfs-webspec: serviceName
v1metadata: name: &name myforum annotations: traefik.ingress.kubernetes.io/router.entrypoints: webspec
定义Kubernetes资源的类型为Podmetadata: name: demo-web # 定义资源的名称 labels: # 为Pod贴上标签,后面会介绍其用处 app: demo-webspec...让我们先再添加一个Pod:apiVersion: v1kind: Podmetadata: name: demo-web-copy labels: app: demo-webspec: containers
如果不配置 behavior,使用示例:apiVersion: autoscaling/v2beta2kind: HorizontalPodAutoscalermetadata: name: webspec
web clusterIP: None selector: app: nginx---apiVersion: apps/v1kind: StatefulSetmetadata: name: webspec
领取专属 10元无门槛券
手把手带您无忧上云