部署 minikube v1.32.0

minikube 介绍

minikube 是一个可让您在本地运行 Kubernetes 的工具。 minikube 在您的个人计算机(包括 Windows、macOS 和 Linux PC)上运行单节点或多节点本地 Kubernetes 集群,以便您可以试用 Kubernetes,或进行日常开发工作。

minikube 环境要求

1. 2 核CPUs 
2. 2GB 内存
3. 20GB 磁盘
4. 可以访问外网
5. 容器或虚拟机管理器, such as: Docker, QEMU, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation

minikube 下载 

# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

minikube 安装

# sudo install minikube-linux-amd64 /usr/local/bin/minikube

minikube 工作目录

# tree /root/.minikube
/root/.minikube
├── addons
├── ca.crt
├── ca.key
├── ca.pem
├── cache
│   ├── images
│   │   └── amd64
│   │       └── registry.aliyuncs.com
│   │           └── google_containers
│   │               ├── coredns
│   │               ├── etcd_3.5.9-0
│   │               ├── k8s-minikube
│   │               ├── kube-apiserver_v1.28.3
│   │               ├── kube-controller-manager_v1.28.3
│   │               ├── kube-proxy_v1.28.3
│   │               ├── kube-scheduler_v1.28.3
│   │               └── pause_3.9
│   ├── kic
│   │   └── amd64
│   │       └── stable_v0.0.42@sha256_d35ac07dfda971cabee05e0deca8aeac772f885a5348e1a0c0b0a36db20fcfc0.tar
│   ├── linux
│   │   └── amd64
│   │       └── v1.28.3
│   │           ├── kubeadm
│   │           ├── kubectl
│   │           └── kubelet
│   └── preloaded-tarball
│       ├── preloaded-images-k8s-v18-v1.28.3-docker-overlay2-amd64.tar.lz4
│       └── preloaded-images-k8s-v18-v1.28.5-docker-overlay2-amd64.tar.lz4
├── cert.pem
├── certs
│   ├── ca-key.pem
│   ├── ca.pem
│   ├── cert.pem
│   └── key.pem
├── config
│   └── config.json
├── files
├── key.pem
├── logs
│   ├── audit.json
│   └── lastStart.txt
├── machine_client.lock
├── machines
│   ├── minikube
│   │   ├── config.json
│   │   ├── id_rsa
│   │   └── id_rsa.pub
│   ├── server-key.pem
│   └── server.pem
├── profiles
│   └── minikube
│       ├── apiserver.crt
│       ├── apiserver.crt.dd3b5fb2
│       ├── apiserver.key
│       ├── apiserver.key.dd3b5fb2
│       ├── client.crt
│       ├── client.key
│       ├── config.json
│       ├── events.json
│       ├── proxy-client.crt
│       └── proxy-client.key
├── proxy-client-ca.crt
└── proxy-client-ca.key

25 directories, 40 files

minikube 创建集群

# minikube start -p c1 --kubernetes-version=v1.28.3 

minikube 集群管理

登录minikube环境

minikube ssh

暂停 Kubernetes

minikube pause

取消暂停已暂停的实例

minikube unpause

停止集群

minikube stop

更改默认内存限制(需要重新启动)

minikube config set memory 9001

查看 addons 列表

minikube addons list

minikube 删除集群

# minikube delete --all
* Deleting "minikube" in docker ...
* Removing /root/.minikube/machines/minikube ...
* Removed all traces of the "minikube" cluster.
* Successfully deleted all profiles

参考文档

https://minikube.sigs.k8s.io/docs/start/

posted @ 2023-12-24 12:14  小吉猫  阅读(170)  评论(0编辑  收藏  举报