1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- apiVersion: v1
- kind: Namespace
- metadata:
- name: {{.repo_namespace}}
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: {{.repo_name}}
- namespace: {{.repo_namespace}}
- spec:
- selector:
- matchLabels:
- app: {{.repo_name}}
- replicas: 1
- template:
- metadata:
- labels:
- app: {{.repo_name}}
- annotations:
- dapr.io/enabled: "true"
- dapr.io/app-id: {{.repo_name}}
- dapr.io/app-port: "80"
- spec:
- imagePullSecrets:
- - name: harbor-registry-secret
- containers:
- - name: {{.repo_name}}
- imagePullPolicy: Always
- image: {{.image_addr}}
- ports:
- - containerPort: 80
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: {{.repo_name}}-svc
- namespace: {{.repo_namespace}}
- spec:
- selector:
- app: {{.repo_name}}
- type: NodePort
- ports:
- - protocol: TCP
- port: 80
- targetPort: 80
- nodePort: 30016
- ---
- # 私有仓库
- apiVersion: v1
- kind: Secret
- metadata:
- name: harbor-registry-secret
- namespace: {{.repo_namespace}}
- type: kubernetes.io/dockerconfigjson
- data:
- .dockerconfigjson: eyJhdXRocyI6eyJoYXJib3Iuc3hpZGMuY29tIjp7InVzZXJuYW1lIjoiZHJvbmUiLCJwYXNzd29yZCI6IkRyb25lMTIzNDU2IiwiYXV0aCI6IlpISnZibVU2UkhKdmJtVXhNak0wTlRZPSJ9fX0=
|