Browse Source

添加 'deployment-app.yaml'

rentianliang 1 year ago
parent
commit
89438feca0
1 changed files with 61 additions and 0 deletions
  1. 61 0
      deployment-app.yaml

+ 61 - 0
deployment-app.yaml

@@ -0,0 +1,61 @@
+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=