minikube start --force --container-runtime=containerd --driver=docker --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers --image-mirror-country cn --base-image=kicbase/stable:v0.0.37 --nodes 2
开始使用的是v1.29.0
国内各种镜像下载不了,降到v1.28.0就可以使用阿里的镜像了,--image-repository
指定国内仓库
minikube tunnel
cat hellok8s-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hellok8s-deployment
spec:
replicas: 2
selector:
matchLabels:
app: hellok8s
template:
metadata:
labels:
app: hellok8s
spec:
containers:
- name: hellok8s
image: docker.io/library/hellok8s:v1.0
ports:
- containerPort: 8080
cat hellok8s-service.yaml
apiVersion: v1
kind: Service
metadata:
name: hellok8s-service
spec:
type: LoadBalancer
selector:
app: hellok8s
ports:
- port: 8080
targetPort: 8080
# nodePort: 3000
understanding-kubernetes-networking-model值得读三遍
https://aly.arriqaaq.com/linux-networking-bridge-iptables-and-docker/
Posted in: Linux
Comments are closed.