brew install \
helm \
kubectl \
kubectx \
kustomize
gcloud services enable container.googleapis.com
export PROJECT_ID=xxxx
export REGION=asia-northeast1 &&
export ZONE=asia-northeast1-b &&
export CLUSTER_NAME="prod-$REGION-sakabas"
gcloud container clusters create \
--preemptible \
--project=${PROJECT_ID} \
--machine-type=e2-small \
--num-nodes=2 \
--disk-size=10 \
--network=sakabas-tokyo-vpc \
--subnetwork=subnet-asia-northeast-172 \
--zone ${ZONE} \
--cluster-version latest \
${CLUSTER_NAME}
gcloud container clusters list
gcloud container clusters get-credentials ${CLUSTER_NAME} --region ${ZONE} --project ${PROJECT_ID}
kubectx
kubens -c
kubectx ${KUBECTL_CONTEXT}
gcloud container clusters delete ${CLUSTER_NAME}
- Create a new node-pool with more nodes
gcloud container node-pools create ${NEW_POOL_NAME} \
--cluster ${CLUSTER_NAME} --zone ${ZONE} \
--machine-type=e2-small --num-nodes=3 \
--disk-size=10 --preemptible
- Delete the old node-pool
gcloud container node-pools delete ${OLD_POOL_NAME} --cluster ${CLUSTER_NAME} --zone ${ZONE}
kubectl exec --stdin --tty ${POD_NAME} -- /bin/sh
kubectl logs ${POD_NAME}
kubectl top pod --all-namespaces
kubectl delete pod ${POD_NAME}
kubectl delete --all pods --all-namespaces
kubectl get pod --all-namespaces
kubectl port-forward svc/web 8080:8080
- Access http:https://localhost:8080/ to make sure that port-forwarding works.
- New pod with different name is automatically created.
kubectl rollout restart deployment/web
- Old pod is replaced by new pod.
- https://docs.datadoghq.com/containers/kubernetes/installation/?tab=operator
- https://istio.io/latest/docs/setup/install/helm/
- https://cloud.google.com/load-balancing/docs/ssl-certificates/troubleshooting?&_ga=2.28635196.-1210616006.1659620185#certificate-managed-status
- https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs
- https://qiita.com/tontoko/items/33faead6bb14370ecb17