本地测试搭建了私有镜像,但是没有配置https,默认是不能远程拉取的。所以直接不让触发远程而是寻找本地,imagePullPolicy: Never
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-go
namespace: go-test
labels:
app: my-go
spec:
replicas: 3
revisionHistoryLimit: 5
selector:
matchLabels:
app: my-go
template:
metadata:
labels:
app: my-go
spec:
containers:
- name: my-go
image: 192.168.3.121:5000/my-go:v3
imagePullPolicy: Never # 用于设置镜像拉取策
ports:
- containerPort: 8888
readinessProbe:
tcpSocket:
port: 8888
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 8888
........
标签:8888,私有,app,本地,go,镜像,k8s,my
From: https://www.cnblogs.com/qcy-blog/p/17926603.html