You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to set config to use cluster
kubectl config set-cluster gke_flowkind-325606_us-central1-c_flowkind
to set config to use context
kubectl config --kubeconfig=config use-context gke_flowkind-325606_us-central1-c_flowkind
kubectl get namespace
kubectl get secrets
kubectl config set-context --current --namespace=<namespace> -- to switch between namespace
kubectl delete secret gitlab-auth -- to delete secret that created
kubectl get services --namespace flowkind
kubectl get pod --namespace flowkind
kubectl get deployments --namespace flowkind
watch -n 1 kubectl get all
to install nginx-controller , i followed some tutorial from gcloud -Doc Link
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx
kubectl get deployment nginx-ingress-nginx-ingress
kubectl get service nginx-ingress-nginx-ingress
kubectl get service nginx-ingress-nginx-ingress
how to check watch -n 1 kubectl get all
watch -n 1 kubectl get all
NAME READY STATUS RESTARTS AGE
pod/kubernetes-native-app-6d49d8fb5f-28dzg 1/1 Running 0 48m
pod/nginx-ingress-ingress-nginx-controller-5bbd94d775-wjtfc 1/1 Running 0 12m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes-native-app ClusterIP 10.108.13.102 <none> 80/TCP 47m
service/nginx-ingress-ingress-nginx-controller LoadBalancer 10.108.1.221 104.198.39.59 80:30597/TCP,443:30950/TCP 13m
service/nginx-ingress-ingress-nginx-controller-admission ClusterIP 10.108.15.225 <none> 443/TCP 13m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/kubernetes-native-app 1/1 1 1 48m
deployment.apps/nginx-ingress-ingress-nginx-controller 1/1 1 1 13m
NAME DESIRED CURRENT READY AGE
replicaset.apps/kubernetes-native-app-6d49d8fb5f 1 1 1 48m
replicaset.apps/nginx-ingress-ingress-nginx-controller-5bbd94d775 1 1 1 13m
preconfiguration to use google kubernetes
1. gcloud init - it will give you option to set your project
2. gcloud auth login will do the same
3. gcloud container clusters get-credentials my-first-cluster-1 --zone us-central1-c --project flowkind-app - to get credentials
it will add the cluster configuration to your ~/.kube/config file
4. kubectl get nodes - will give all the nodes that are present on cluster
5. if you have multiple clusters that are running on - you need to check
i) kubectl config view - give you all the cluster and their context details
ii) kubectl config set-cluster cluster_name
iii) the namespace default will auto created in cluster
iii) to create new namespace and switch to use that namespace
kubectl create namespace namespace_name
kubectl config set-context --current --namespace namespace_name
6.) Remove
kubectl delete -f k8s/ingress.yaml - will delete the ingress
helm del nginx-ingress
- this command will delete the service - to see all the services - kubectl get services
kubectl delete service kubernetes-native-app
- this command will delete the deployment - to see all the deployment kubectl get deployments
kubectl delete deployment kubernetes-native-app
- this command will delete the cluster
gcloud container clusters delete my-first-cluster-1 --zone us-central1-c --project flowkind-app