Kubernetes Cookbook
1. Kubectl
1.1. Change current cluster
kubectl config get-contexts kubectl cnofig use-context CONTEXT_NAME
2. Dashboard
Dashboard 是基于网页的 Kubernetes 用户界面。 你可以使用 Dashboard 将容器应用部署到 Kubernetes 集群中,也可以对容器应用排错, 还能管理集群资源。 你可以使用 Dashboard 获取运行在集群中的应用的概览信息, 也可以创建或者修改 Kubernetes 资源 (如 Deployment,Job,DaemonSet 等等)。 例如,你可以对 Deployment 实现弹性伸缩、发起滚动升级、重启 Pod 或者使用向导创建新的应用。
Dashboard 同时展示了 Kubernetes 集群中的资源状态信息和所有报错信息。
2.1. Deploy
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
2.2. Usage
2.3. Create Sample User
kubectl -n kubernetes-dashboard create token admin-user
3. Kind
DOC,
3.1. Configuring Your Kind Cluster
kind create cluster --config kind-example-config.yaml
Muiti-node clusters
kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane - role: worker - role: worker - role: worker - role: worker
4. Minio
Multi-Cloud Object Storage
MinIO offers high-performance, S3 compatible object storage. Native to Kubernetes, MinIO is the only object storage suite available on every public cloud, every Kubernetes distribution, the private cloud and the edge. MinIO is software-defined and is 100% open source under GNU AGPL v3. QuickStart
4.1. Install
kubectl krew update kubectl krew install minio
z*** Init
kubectl minio init kubectl get all --namespace minio-operator
4.2. Open the Operator Console
kubectl minio proxy
5. Helm
helm repo add bitnami https://charts.bitnami.com/bitnami helm search repo bitnami helm repo update helm install bitnami/mysql --generate-name helm list
6. Krew
Krew helps you discover and install kubectl plugins on your machine. QuickStart
kubectl krew update kubectl krew search kubectl krew install access-matrix kubectl krew uninstall access-matrix