Skip to main content

Master ROOT user only

Master ROOT user only

  •  sudo kubeadm init --pod-network-cidr=172.16.0.0/16 --apiserver-advertise-address=192.168.0.100
    ...
       kubeadm join 10.0.1.2:6443 --token nnnnnnnnnnn --discovery-token-ca-cert-hash sha256:nnnnnnnnn <-- 잘 복사할것
    ...
  • 예시
      ... ... 
    Your Kubernetes control-plane has initialized successfully!
    
    To start using your cluster, you need to run the following as a regular user:
    
      mkdir -p $HOME/.kube
      sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
      sudo chown $(id -u):$(id -g) $HOME/.kube/config
    
    You should now deploy a pod network to the cluster.
    Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
      https://kubernetes.io/docs/concepts/cluster-administration/addons/
    
    Then you can join any number of worker nodes by running the following on each as root:
    
    
    kubeadm join 192.168.0.100:6443 --token 2bnj8x.t4odyls0snm1bq8b \
        --discovery-token-ca-cert-hash sha256:a51bfb3121d40d300e0eb5399610511852597bfb3a5391db37d535cce339f2f8
  • Master 일반 유저
    mkdir -p $HOME/.kube
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    sudo chown $(id -u):$(id -g) $HOME/.kube/config
    export KUBECONFIG=$HOME/.kube/config
    export KUBECONFIG=$HOME/.kube/config | tee -a ~/.bashrc
  • Master calico를 사용 일반 유저
    kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
    kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
    •      잘모르겠다 이부분 
      export kubever=$(kubectl version | base64 | tr -d '\n')
      kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"