浏览代码

增加deployment.yaml

4228306 5 年之前
父节点
当前提交
c332431109
共有 3 个文件被更改,包括 68 次插入2 次删除
  1. 3 1
      buildAndRun.sh
  2. 64 0
      deployment.yaml
  3. 1 1
      pom.xml

+ 3 - 1
buildAndRun.sh

@@ -1,7 +1,9 @@
 #!/bin/bash
 set -e
 date=`date +%Y%m%d_%H%M%S`
-git pull
+#git pull
 mvn -s /etc/maven/settings.xml -DskipTests=true clean package
 docker build -t feick/diagnosis:$date .
+#sed -i "s/\${date}/$(echo $date)/g" diagnosis.yaml
+kubectl apply -f
 #docker run --rm -p 9090:8080 feick/diagnosis:$date --spring.profiles.active=dev

+ 64 - 0
deployment.yaml

@@ -0,0 +1,64 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  annotations:
+    deployment.kubernetes.io/revision: "1"
+    field.cattle.io/creatorId: user-ktj2n
+    field.cattle.io/publicEndpoints: '[{"addresses":["172.18.129.124"],"port":31692,"protocol":"TCP","serviceName":"dev:diagnosis1-nodeport","allNodes":true}]'
+  creationTimestamp: "2020-02-20T08:02:48Z"
+  generation: 2
+  labels:
+    cattle.io/creator: norman
+    workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
+  name: diagnosis1
+  namespace: dev
+  resourceVersion: "27368155"
+  selfLink: /apis/apps/v1/namespaces/dev/deployments/diagnosis1
+  uid: e920a811-f196-4797-b77d-3f180b14edda
+spec:
+  progressDeadlineSeconds: 600
+  replicas: 1
+  revisionHistoryLimit: 10
+  selector:
+    matchLabels:
+      workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
+  strategy:
+    rollingUpdate:
+      maxSurge: 1
+      maxUnavailable: 0
+    type: RollingUpdate
+  template:
+    metadata:
+      annotations:
+        cattle.io/timestamp: "2020-02-20T08:02:48Z"
+        field.cattle.io/ports: '[[{"containerPort":8080,"dnsName":"diagnosis1-nodeport","kind":"NodePort","name":"8080tcp01","protocol":"TCP","sourcePort":0}]]'
+      creationTimestamp: null
+      labels:
+        workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
+    spec:
+      containers:
+        - args:
+            - --spring.profiles.active=docker
+          image: feick/diagnosis:${date}
+          imagePullPolicy: IfNotPresent
+          name: diagnosis1
+          ports:
+            - containerPort: 8080
+              name: 8080tcp01
+              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

+ 1 - 1
pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>edu.math</groupId>
+    <groupId>com.yaoxiang</groupId>
     <artifactId>diagnosis</artifactId>
     <version>1.0</version>
     <packaging>jar</packaging>