k8s使用本地私有仓库镜像

本地测试搭建了私有镜像,但是没有配置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
   ........
posted @ 2023-12-25 17:32  朝阳1  阅读(136)  评论(0编辑  收藏  举报