| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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: "8080"
- spec:
- imagePullSecrets:
- - name: harbor-registry-secret
- containers:
- - name: {{.repo_name}}
- 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: 8080
- targetPort: 8080
- nodePort: 30016
- ---
- # 私有仓库
- apiVersion: v1
- kind: Secret
- metadata:
- name: harbor-registry-secret
- namespace: {{.repo_namespace}}
- type: kubernetes.io/dockerconfigjson
- data:
- .dockerconfigjson: eyJhdXRocyI6eyJoYXJib3Iuc3hpZGMuY29tIjp7InVzZXJuYW1lIjoiZHJvbmUiLCJwYXNzd29yZCI6IkRyb25lMTIzNDU2IiwiYXV0aCI6IlpISnZibVU2UkhKdmJtVXhNak0wTlRZPSJ9fX0=
|