š¤ Kubernetes ScenariosLast updated on Dec 4, 2020 2 min read Kubernetes k8s logoLocal ComputerLocal ComputerSkaffoldSkaffoldsynced filessynced filesCloud VMCloud VMNodeNodePodPodPodPodPodPodPodPodchangeschangesupdate a podupdate a podScenario 1 synced filesScenario 1 synced filesLocal ComputerLocal ComputerSkaffoldSkaffoldunsynced filesunsynced fileschangeschangesupdate a podupdate a podScenario 2 unsynced filesScenario 2 unsynced filesCloud BuildCloud Buildchanged fileschanged filesDockerfileDockerfileDocker builderDocker builderDocker ImageDocker Imagechanged fileschanged filesDockerfileDockerfileRebuild Docker ImageRebuild Docker ImageCloud VMCloud VMNodeNodeDeploymentDeploymentPodPodPodPodPodPodLocal ComputerLocal ComputerKubectlKubectlContext 1Context 1Context 2Context 2Cluster 1Cluster 1Cluster 2Cluster 2google cloud SDKgoogle cloud SDKgoogle cloud SDKrun Local Dockergoogle cloud SDK…Do not run Local DockerDo not run Local Doc…Close Docker DesktopClose Docker Desktopgcloud components install kubectlgcloud components install kubectlRun Local DockerRun Local Dockergcloud container cluster get-credentials <cluster_name>gcloud container cluster get-credentials <cluster_name>Created google cloud projectCreated google cloud projectEnable google cloudĀ BuildTools -> Cloud BuildEnable google cloudĀ Build…Update skaffold.yml to google cloud buildUpdate skaffold.yml…Setup ingress-nginx on cloud clusterkubernetes.github.io/ingress-nginxSetup ingress-nginx on cloud cluster…UpdateĀ domainĀ inĀ hosts to remote clusterUpdateĀ domainĀ inĀ hosts to remote clust…restart Skaffoldskaffold devrestart Skaffold…skaffold.yamlbuild:#Ā local:#Ā Ā push: falseĀ googleCloudBuild:Ā Ā projectId: xxxĀ artifacts:Ā Ā - image: us.gcr.io/xxx/authauth-depl.yamlimage: xxxskaffold.yaml…k8s context on cloud gke_xxxkubectl apply XXXGCE-GKEkubectl apply XXXk8s context on cloud gke_xxx…InternetInternetCloud Provider (AWS GoogleCloud Azure)Cloud Provider (AWS GoogleCloud Azure)Load BalancerNetworking -> Network services -> load balancingIPLoad Balancer…Ingress Controllerrouter rulesIngress Controller…PodPodPodPodPodPodTools -> Cloud Build -> HistoryTools -> Cloud Build -> HistoryViewer does not support full SVG 1.1Zane ZhengFull Stack (Ruby on Rails) / DevopsAn Full Stack / Devops with JS, Ruby, Linux, JAMStack, MicroServices.