macbook m1 安装 minikube

下载

curl -LO [https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-arm64](https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-arm64)

安装

sudo install minikube-darwin-arm64 /usr/local/bin/minikube

启动

minikube start --driver=docker

测试

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
  name: web-service
spec:
  ports:
  - name: http
    port: 80
  selector:
    app: web
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - image: nginx:1.14.2
        name: nginx
        ports:
        - containerPort: 80
EOF
kubectl get all

NAME                                 READY   STATUS    RESTARTS        AGE
pod/web-deployment-9ccc44df8-pkhmc   1/1     Running   1 (3m59s ago)   5m24s
pod/web-deployment-9ccc44df8-tsl4p   1/1     Running   1 (3m59s ago)   5m24s

NAME                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
service/kubernetes    ClusterIP   10.96.0.1      <none>        443/TCP        8m21s
service/web-service   NodePort    10.97.28.153   <none>        80:31710/TCP   5m24s

NAME                             READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/web-deployment   2/2     2            2           5m24s

NAME                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/web-deployment-9ccc44df8   2         2         2       5m24s

查看 dashboard

minikube dashboard

  Verifying dashboard health ...
  Launching proxy ...
  Verifying proxy health ...
  Opening http://127.0.0.1:59582/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

停止

minikube stop

你可能感兴趣的:(kubernetes,macbook,m1,安装,minikube)