vSphere 7 使用Tanzu Kubernetes集群

在vSphere 7 with K8S的整体架构中,Tanzu Kubernetes集群是完全由开发人员建立/维护/销毁。运维人员无法从wcp的控制平台对其进行操作。同时,Tanzu Kubernetes集群还可以用于多租户场景。
有关Tanzu Kubernetes集群的备置(建立),请参考vSphere 7 Kubernetes 初体验中的:使用 Tanzu Kubernetes Grid 服务置备Tanzu Kubernetes 集群。
首先,我们还是对vSphere 7 with K8S的整体逻辑视图进行复习:
在这里插入图片描述
我们可以看到,Tanzu Kubernetes集群存在于Superior Namespace内。
继续使用上一篇vSphere 7 Kubernetes 初体验中备置的Tanzu Kubernetes集群。

1.改变yaml文件,弹性扩容Tanzu Kubernetes集群。

[root@localhost ~]# cat tz-cluster.yaml 
apiVersion: run.tanzu.vmware.com/v1alpha1      #TKG API endpoint
kind: TanzuKubernetesCluster                   #required parameter
metadata:
  name: tkg-cluster-vmlab                          #cluster name, user defined
  namespace: ns-tkg                       #supervisor namespace
spec:
  distribution:
    version: v1.16                             #resolved kubernetes version
  topology:
    controlPlane:
      count: 3                                 #number of control plane nodes
      class: guaranteed-small                 #vmclass for control plane nodes
      storageClass: wcp-policy         #storageclass for control plane
    workers:
      count: 4                                 #number of worker nodes
      class: guaranteed-small                 #vmclass for worker nodes
      storageClass: wcp-policy         #storageclass for worker nodes
  将controlPlane的数量改为3,worker的数量改为4.
  应用以后,从vCenter的界面可以看到:

在这里插入图片描述
值得注意的是,在集群名字旁,指名了该集群的管理:开发人员管理。

如我们想在Tanzu Kubernetes集群进行缩容,将controlPlane的数量改为1,worker的数量改为3,执行之后:

[root@localhost ~]# kubectl apply -f tz-cluster.yaml 
Error from server (control plane scale-in not supported, worker scale-in not supported): error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"run.tanzu.vmware.com/v1alpha1\",\"kind\":\"TanzuKubernetesCluster\",\"metadata\":{\"annotations\":{},\"name\":\"tkg-cluster-vmlab\",\"namespace\":\"ns-vpods\"},\"spec\":{\"distribution\":{\"version\":\"v1.16\"},\"topology\":{\"controlPlane\":{\"class\":\"guaranteed-small\",\"count\":1,\"storageClass\":\"wcp-normal\"},\"workers\":{\"class\":\"guaranteed-small\",\"count\":3,\"storageClass\":\"wcp-normal\"}}}}\n"}},"spec":{"topology":{"controlPlane":{"count":1},"workers":{"count":3}}}}
to:
Resou
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值