CentOS 7 下 minikube 部署 && 配置

CentOS 7 下 minikube 部署 && 配置

文章目录

  • CentOS 7 下 minikube 部署 && 配置
      • 下载 && 安装
          • 下载安装脚本
          • 安装 minikube
      • 启动 minikube 环境
          • 安装 kubectl 工具
          • 启动 minikube 版本
      • 查看 minikube 环境
          • 查看 minikube 版本
          • 查看 minikube 状态
          • minikube 节点信息
          • minikube kubectl 版本
          • minikube 插件操作
      • 参考

下载 && 安装

下载安装脚本
# latest stable release on x86-64 using binary
[root@minikube ~]# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
安装 minikube
[root@minikube ~]# sudo install minikube-linux-amd64 /usr/local/bin/minikube

启动 minikube 环境

安装 kubectl 工具
[root@minikube ~]# minikube kubectl 
> kubectl.sha256:  64 B / 64 B [-------------------------] 100.00% ? p/s 0s
> kubectl:  43.59 MiB / 43.59 MiB [--------------] 100.00% 1.18 MiB p/s 37s
kubectl controls the Kubernetes cluster manager.
启动 minikube 版本
  • 默认启动
[docker@minikube ~]$ minikube start
  • 自定义启动
[docker@minikube ~]$ minikube start \
						--kubernetes-version=v1.23.3 \
						--image-mirror-country='cn' \
						--image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'

  minikube v1.26.1 on Centos 7.7.1908
✨  Automatically selected the docker driver
✅  Using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
  Using Docker driver with root privileges
  Starting control plane node minikube in cluster minikube
  Pulling base image ...
  Creating docker container (CPUs=2, Memory=2200MB) ...
❗  This container is having trouble accessing https://registry.cn-hangzhou.aliyuncs.com/google_containers
  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
  Preparing Kubernetes v1.23.3 on Docker 20.10.17 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
  Verifying Kubernetes components...
    ▪ Using image registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner:v5
  Enabled addons: default-storageclass, storage-provisioner
  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

查看 minikube 环境

查看 minikube 版本
[root@minikube ~]# minikube version
minikube version: v1.26.1
commit: 62e108c3dfdec8029a890ad6d8ef96b6461426dc
查看 minikube 状态
[docker@minikube ~]$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
minikube 节点信息
[docker@minikube ~]$ minikube node list
minikube        192.168.49.2
minikube kubectl 版本
[docker@minikube ~]$ kubectl version --short
Client Version: v1.23.3
Server Version: v1.23.3
minikube 插件操作
  • 查看状态
[docker@minikube ~]$ minikube addons list
|-----------------------------|----------|--------------|--------------------------------|
|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |
| auto-pause                  | minikube | disabled     | Google                         |
| csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |
| dashboard                   | minikube | disabled     | Kubernetes                     |
| default-storageclass        | minikube | enabled ✅   | Kubernetes                     |
| efk                         | minikube | disabled     | 3rd party (Elastic)            |
| freshpod                    | minikube | disabled     | Google                         |
| gcp-auth                    | minikube | disabled     | Google                         |
| gvisor                      | minikube | disabled     | Google                         |
| headlamp                    | minikube | disabled     | 3rd party (kinvolk.io)         |
| helm-tiller                 | minikube | disabled     | 3rd party (Helm)               |
| inaccel                     | minikube | disabled     | 3rd party (InAccel             |
|                             |          |              | [[email protected]])            |
| ingress                     | minikube | disabled     | Kubernetes                     |
| ingress-dns                 | minikube | disabled     | Google                         |
| istio                       | minikube | disabled     | 3rd party (Istio)              |
| istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |
| kong                        | minikube | disabled     | 3rd party (Kong HQ)            |
| kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |
| logviewer                   | minikube | disabled     | 3rd party (unknown)            |
| metallb                     | minikube | disabled     | 3rd party (MetalLB)            |
| metrics-server              | minikube | disabled     | Kubernetes                     |
| nvidia-driver-installer     | minikube | disabled     | Google                         |
| nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (Nvidia)             |
| olm                         | minikube | disabled     | 3rd party (Operator Framework) |
| pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |
| portainer                   | minikube | disabled     | 3rd party (Portainer.io)       |
| registry                    | minikube | disabled     | Google                         |
| registry-aliases            | minikube | disabled     | 3rd party (unknown)            |
| registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |
| storage-provisioner         | minikube | enabled ✅   | Google                         |
| storage-provisioner-gluster | minikube | disabled     | 3rd party (Gluster)            |
| volumesnapshots             | minikube | disabled     | Kubernetes                     |
|-----------------------------|----------|--------------|--------------------------------|
  • 启动插件 – dashboard
[docker@minikube ~]$ minikube addons enable dashboard

  dashboard is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
    ▪ Using image registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.6.0
    ▪ Using image registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.8
  Some dashboard features require the metrics-server addon. To enable all features please run:

        minikube addons enable metrics-server


  The 'dashboard' addon is enabled
  • 停止插件 – dashboard
[docker@minikube ~]$ minikube addons disable dashboard

  "The 'dashboard' addon is disabled

参考

  • minikube 官网
  • minikube 官网 – 文档
  • Minikube 一键开启国内镜像加速
  • minikube 国内在线部署体验

你可能感兴趣的:(Docker,K8s,centos,docker,kubernetes,minikube)