Browse Source

增加prod,测试deployment-prod

4228306 5 years ago
parent
commit
27a2cc06c2
3 changed files with 57 additions and 5 deletions
  1. 2 0
      deploy.sh
  2. 50 0
      deployment-prod.yaml
  3. 5 5
      deployment.yaml

+ 2 - 0
deploy.sh

@@ -4,4 +4,6 @@ docker build -t feick/diagnosis:$date .
 echo "current tag is $date"
 sed -i "s/\${date}/$(echo $date)/g" deployment.yaml
 kubectl apply -f deployment.yaml
+sed -i "s/\${date}/$(echo $date)/g" deployment-prod.yaml
+kubectl apply -f deployment-prod.yaml
 echo "build finish."

+ 50 - 0
deployment-prod.yaml

@@ -0,0 +1,50 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: diagnosis
+  namespace: prod
+spec:
+  minReadySeconds: 60
+  progressDeadlineSeconds: 600
+  replicas: 2
+  revisionHistoryLimit: 10
+  selector:
+    matchLabels:
+      workload.user.cattle.io/workloadselector: deployment-prod-diagnosis
+  strategy:
+    rollingUpdate:
+      maxSurge: 1
+      maxUnavailable: 0
+    type: RollingUpdate
+  template:
+    metadata:
+      annotations:
+        field.cattle.io/ports: '[[{"containerPort":8080,"dnsName":"diagnosis","kind":"ClusterIP","name":"8080tcp02","protocol":"TCP","sourcePort":0}]]'
+      creationTimestamp: null
+      labels:
+        workload.user.cattle.io/workloadselector: deployment-prod-diagnosis
+    spec:
+      containers:
+        - image: feick/diagnosis:${date}
+          imagePullPolicy: IfNotPresent
+          name: diagnosis
+          ports:
+            - containerPort: 8080
+              name: 8080tcp02
+              protocol: TCP
+          resources: {}
+          securityContext:
+            allowPrivilegeEscalation: false
+            capabilities: {}
+            privileged: false
+            readOnlyRootFilesystem: false
+            runAsNonRoot: false
+          stdin: true
+          terminationMessagePath: /dev/termination-log
+          terminationMessagePolicy: File
+          tty: true
+      dnsPolicy: ClusterFirst
+      restartPolicy: Always
+      schedulerName: default-scheduler
+      securityContext: {}
+      terminationGracePeriodSeconds: 30

+ 5 - 5
deployment.yaml

@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: diagnosis1
+  name: diagnosis
   namespace: dev
 spec:
   progressDeadlineSeconds: 600
@@ -9,7 +9,7 @@ spec:
   revisionHistoryLimit: 10
   selector:
     matchLabels:
-      workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
+      workload.user.cattle.io/workloadselector: deployment-dev-diagnosis
   strategy:
     rollingUpdate:
       maxSurge: 1
@@ -18,17 +18,17 @@ spec:
   template:
     metadata:
       annotations:
-        field.cattle.io/ports: '[[{"containerPort":8080,"dnsName":"diagnosis1-nodeport","kind":"NodePort","name":"8080tcp01","protocol":"TCP","sourcePort":0}]]'
+        field.cattle.io/ports: '[[{"containerPort":8080,"dnsName":"diagnosis-nodeport","kind":"NodePort","name":"8080tcp01","protocol":"TCP","sourcePort":0}]]'
       creationTimestamp: null
       labels:
-        workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
+        workload.user.cattle.io/workloadselector: deployment-dev-diagnosis
     spec:
       containers:
         - args:
             - --spring.profiles.active=docker
           image: feick/diagnosis:${date}
           imagePullPolicy: IfNotPresent
-          name: diagnosis1
+          name: diagnosis
           ports:
             - containerPort: 8080
               name: 8080tcp01