Tanzu Community Edition을 사용해 보았습니다.

Tanzu Community Edition이 출시된 클러스터를 만들려고 했습니다.
  • VMware Tanzu Community Edition
  • (GitHub) Tanzu Community Edition

  • tanzu CLI 설치



    github vmware-tanzu/community-edition에서 tanzu CLI를 다운로드하여 설치하십시오.
    ※ root 유저로 실행하면 install 스크립트의 실행으로 화내므로, 일반 유저로 실행할 필요가 있습니다.
    $ wget https://github.com/vmware-tanzu/community-edition/releases/download/v0.9.1/tce-linux-amd64-v0.9.1.tar.gz
    $ tar zxvf tce-linux-amd64-v0.9.1.tar.gz
    $ cd tce-linux-amd64-v0.9.1
    $ ls
    bin install.sh uninstall.sh
    $ ./install.sh
    

    tanzu CLI가 설치됩니다. 플러그인도 설치되어 있습니다.
    $ which tanzu
    /usr/local/bin/tanzu
    $ tanzu version
    version: v0.2.1
    buildDate: 2021-09-29
    sha: ceaa474
    $ tanzu plugin list
      NAME                LATEST VERSION  DESCRIPTION                                                        REPOSITORY  VERSION  STATUS       
      builder             v0.2.1          Build Tanzu components                                             core-admin  v0.2.1   installed
      cluster             v0.2.1          Kubernetes cluster operations                                      core        v0.2.1   installed
      codegen                             Tanzu code generation tool                                         core-admin           not installed
      conformance         v0.9.0          Run Sonobuoy conformance tests against clusters                    tce         v0.9.1   installed
      diagnostics         v0.9.0          Cluster diagnostics                                                tce         v0.9.1   installed
      kubernetes-release  v0.2.1          Kubernetes release operations                                      core        v0.2.1   installed
      login               v0.2.1          Login to the platform                                              core        v0.2.1   installed
      management-cluster  v0.2.1          Kubernetes management cluster operations                           core        v0.2.1   installed
      package             v0.2.1          Tanzu package management                                           core        v0.2.1   installed
      pinniped-auth       v0.2.1          Pinniped authentication operations (usually not directly invoked)  core        v0.2.1   installed
      standalone-cluster  v0.9.0          Create clusters without a dedicated management cluster             tce         v0.9.1   installed
      test                                Test the CLI                                                       core-admin           not installed
    

    tanzu CLI 사용



    tanzu CLI에서 management-cluster 작성을 시작하면 Tanzu Kubernetes Grid과 비슷한 화면이 표시되지만 관리 클러스터의 배포 대상으로 Docker가 추가되었습니다.
    $ tanzu management-cluster create -b 192.168.0.190:8080 -u --browser=none
    Downloading TKG compatibility file from 'projects.registry.vmware.com/tkg/framework-zshippable/tkg-compatibility'
    Downloading the TKG Bill of Materials (BOM) file from 'projects.registry.vmware.com/tkg/tkg-bom:v1.4.0'
    Downloading the TKr Bill of Materials (BOM) file from 'projects.registry.vmware.com/tkg/tkr-bom:v1.21.2_vmware.1-tkg.1'
    ERROR 2021/10/04 22:24:27 svType != tvType; key=release, st=map[string]interface {}, tt=<nil>, sv=map[version:], tv=<nil>
    
    Validating the pre-requisites...
    Serving kickstart UI at http://192.168.0.190:8080
    



    Standalone Cluster 만들기



    이번에는 Docker 환경에 Standalone Cluster로 Tanzu Kubernetes Cluster를 배포해 보겠습니다. TKG에는 없었던 "standalone-cluster"옵션으로 docker 환경에 클러스터를 작성할 수 있습니다.
    $ tanzu standalone-cluster create mycluster -i docker
    Downloading TKG compatibility file from 'projects.registry.vmware.com/tkg/framework-zshippable/tkg-compatibility'
    Downloading the TKG Bill of Materials (BOM) file from 'projects.registry.vmware.com/tkg/tkg-bom:v1.4.0'
    Downloading the TKr Bill of Materials (BOM) file from 'projects.registry.vmware.com/tkg/tkr-bom:v1.21.2_vmware.1-tkg.1'
    
    Validating the pre-requisites...
    Identity Provider not configured. Some authentication features won't work.
    
    Setting up standalone cluster...
    Validating configuration...
    Using infrastructure provider docker:v0.3.23
    Generating cluster configuration...
    Setting up bootstrapper...
    Bootstrapper created. Kubeconfig: /home/masanara/.kube-tkg/tmp/config_OZsVOxmQ
    Installing providers on bootstrapper...
    Start creating standalone cluster...
    Saving standalone cluster kubeconfig into /home/masanara/.kube/config
    Waiting for bootstrap cluster to get ready for save ...
    Waiting for addons installation...
    Moving all Cluster API objects from bootstrap cluster to standalone cluster...
    Context set for standalone cluster mycluster as 'mycluster-admin@mycluster'.
    Cleaning up unneeded resources (for standalone clusters)...
    
    Standalone cluster created!
    
    
    You can now use Kubectl to access your cluster:
    
      kubectl get pods -A
    
    
    You can also delete the cluster by running the following:
    
      tanzu standalone-cluster delete [name]
    
    
    Some addons might be getting installed! Check their status by running the following:
    
      kubectl get apps -A
    

    클러스터 사용



    클러스터 작성이 완료되면 클러스터에 액세스하기 위한 컨텍스트가 추가되므로 kubectl 명령으로 액세스할 수 있습니다. Standalone Cluter는 master x1/node x1로 구성됩니다.
    $ kubectl config get-contexts
    CURRENT   NAME                        CLUSTER     AUTHINFO          NAMESPACE
              mycluster-admin@mycluster   mycluster   mycluster-admin
    $ kubectl config use-context mycluster-admin@mycluster
    Switched to context "mycluster-admin@mycluster".
    $ kubectl get node -o wide
    NAME                              STATUS   ROLES                  AGE     VERSION                               INTERNAL-IP   EXTERNAL-IP   OS-IMAGE           KERNEL-VERSION     CONTAINER-RUNTIME
    mycluster-control-plane-vznm8     Ready    control-plane,master   2m34s   v1.21.2+vmware.1-360497810732255795   172.18.0.4    <none>        Ubuntu 20.04 LTS   5.4.0-88-generic   containerd://1.3.3-14-g449e9269
    mycluster-md-0-6db57bb9bf-zldgp   Ready    <none>                 111s    v1.21.2+vmware.1-360497810732255795   172.18.0.5    <none>        Ubuntu 20.04 LTS   5.4.0-88-generic   containerd://1.3.3-14-g449e9269
    

    docker를 확인하면 각 노드와 API에 대한 harpoxy가 컨테이너로 시작되고 있음을 알 수 있습니다.
    $ docker ps -a
    CONTAINER ID   IMAGE                                                         COMMAND                  CREATED         STATUS         PORTS                                  NAMES
    54f90cae8e66   projects.registry.vmware.com/tkg/kind/node:v1.21.2_vmware.1   "/usr/local/bin/entr…"   4 minutes ago   Up 4 minutes                                          mycluster-md-0-6db57bb9bf-zldgp
    ea153e9a2792   projects.registry.vmware.com/tkg/kind/node:v1.21.2_vmware.1   "/usr/local/bin/entr…"   5 minutes ago   Up 5 minutes   41789/tcp, 127.0.0.1:41789->6443/tcp   mycluster-control-plane-vznm8
    f9be4b92159e   kindest/haproxy:v20210715-a6da3463                            "haproxy -sf 7 -W -d…"   5 minutes ago   Up 5 minutes   37947/tcp, 0.0.0.0:37947->6443/tcp     mycluster-lb
    

    pod는 이런 식으로 시작하고 있습니다.
    $ kubectl get pod -A
    NAMESPACE     NAME                                                     READY   STATUS    RESTARTS   AGE
    kube-system   antrea-agent-hq2z5                                       2/2     Running   0          25m
    kube-system   antrea-agent-w4psc                                       2/2     Running   0          25m
    kube-system   antrea-controller-86f8988c5f-q76rs                       1/1     Running   0          25m
    kube-system   coredns-8dcb5c56b-k86m4                                  1/1     Running   0          26m
    kube-system   coredns-8dcb5c56b-s9j9l                                  1/1     Running   0          26m
    kube-system   etcd-mycluster-control-plane-vznm8                       1/1     Running   0          26m
    kube-system   kube-apiserver-mycluster-control-plane-vznm8             1/1     Running   0          26m
    kube-system   kube-controller-manager-mycluster-control-plane-vznm8    1/1     Running   0          26m
    kube-system   kube-proxy-pznjm                                         1/1     Running   0          26m
    kube-system   kube-proxy-xsn9b                                         1/1     Running   0          25m
    kube-system   kube-scheduler-mycluster-control-plane-vznm8             1/1     Running   0          26m
    tkg-system    kapp-controller-6499b8866-x7fcn                          1/1     Running   0          25m
    tkg-system    tanzu-capabilities-controller-manager-6ff97656b8-hfhq5   1/1     Running   0          25m
    tkr-system    tkr-controller-manager-6bc455b5d4-5lvdl                  1/1     Running   0          25m
    

    로컬 환경에서도 쉽게 Tanzu Kubernetes Grid를 시도 할 수 있습니다.

    좋은 웹페이지 즐겨찾기