Category: Kubernetes
-
Local K8s cluster: kind
Use kind to spin up a new cluster brew install kind Create an ha cluster, 3 control-plane, 3 nodes $ mkdir kind-cluster $ cd kind-cluster $ bash -x ha-bootstrap.sh kubectl cluster-info –context kind-ha-dev It’s not stable after docker desktop restarted $ kubectx Switched to context “kind-ha-dev”. $ kubectl get pods E0515 09:10:08.836178 38742 memcache.go:265] couldn’t…
-
K8s lifecycle preStop for nginx pod
Trigger pre stop, to let the nginx pod consume the transactions while no new incoming connections lifecycle: preStop: exec: command: – /bin/sh – -c – curl test.xxx.com/prestop-sleep –resolve test.xxx.com:80:127.0.0.1; sleep 60; /wait-shutdown
-
Local K8s cluster: minikube
Learn minikube Intel Chips: Mac mini 2018 Apple Chips: 13-inch, M2, 2022 MacBook Pro know drivers: https://minikube.sigs.k8s.io/docs/drivers/ — I use docker desktop, but not enable kubernetes https://minikube.sigs.k8s.io/docs/start/ Drivers: Docker – VM + Container (preferred) https://minikube.sigs.k8s.io/docs/drivers/docker/ turn off the docker => kubernetes feature. “` # remove minikube $ minikube delete 💀 Removed all traces of the…
-
letsencrypt and cert-manager in k8s
letsencrypt 入门文档 https://letsencrypt.org/getting-started/ acme 意思 Automatic Certificate Management Environment https://datatracker.ietf.org/doc/html/rfc8555 签发站点可用状态 https://letsencrypt.status.io/ 检查证书工具 https://letsdebug.net/ certbot 手动更新证书, 不推荐,但可以了解运行原理 We don’t recommend this option because it is time-consuming and you will need to repeat it several times per year as your certificate expires. https://certbot.eff.org/docs/using.html#manual k8s 里的 cert-manager kubectl get Issuer,ClusterIssuers -A NAMESPACE NAME READY AGE clusterissuer.cert-manager.io/letsencrypt-production True…
-
kubernetes kill pod fail
Warning FailedKillPod 34s (x396 over 26h) kubelet error killing pod: [failed to “KillContainer” for “fluentd” with KillContainerError: “rpc error: code = Unknown desc = operation timeout: context deadline exceeded”, failed to “KillPodSandbox” for “bd1bd397-b8fe-4118-8149-869e18ac4034” with KillPodSandboxError: “rpc error: code = DeadlineExceeded desc = context deadline exceeded”]