Sunday, April 7, 2024
DevOps Kubernetes Rancher

Cara Remote Rancher kubctl dari local environtment

rancher

Pada hari ini saya akan membahas Cara Remote Rancher kubctl dari local environtment . Berikut cara nya .

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

 install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

kubectl version --client
  • Setelah itu masuk ke Rancher -> pilih Global -> pilih cluster yang ingin di remote
  • Pilh menu cluster
  • Pilh menu Kubeconfig File
  • Nanti muncul menu config
  • copy file tersebut
  • Buat file di envi local
nano .kube/config
masukan file tersebut
  • test kalo sudah connect ke cluster rancher
kubectl get node
NAME           STATUS   ROLES               AGE   VERSION
kube-manager   Ready    controlplane,etcd   22d   v1.17.17
kube-worker1   Ready    etcd,worker         22d   v1.17.17
kube-worker2   Ready    etcd,worker         22d   v1.17.17
  • Ketika sudah bisa remote , kalian bisa deploy dari local misal :
kubectl create -f metricbeat-kubernetes.yaml
kubectl delete -f metricbeat-kubernetes.yaml
  • nanti hasil nya bisa di cek di rancher sudah terdeploy
  • Sekian untuk cara nya

Sumber : https://rancher.com/docs/rancher/v2.x/en/cluster-admin/cluster-access/kubectl/

(Visited 216 times, 1 visits today)
Baca Juga :  Install LAMP Stack di Centos 7

Similar Posts