diff --git a/petclinic-config.yaml b/petclinic-config.yaml new file mode 100644 index 000000000..1c3ca4aeb --- /dev/null +++ b/petclinic-config.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: petclinic-configmap +data: + application.yml: | + server: + port: 8081 diff --git a/petclinic-deployment.yaml b/petclinic-deployment.yaml new file mode 100644 index 000000000..3b1b416a9 --- /dev/null +++ b/petclinic-deployment.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: petclinic +spec: + replicas: 2 + selector: + matchLabels: + app: spring-petclinic + template: + metadata: + labels: + app: spring-petclinic + spec: + containers: + - name: petclinic + image: spring-petclinic + imagePullPolicy: Never + ports: + - containerPort: 8081 + name: "http" + volumeMounts: + - name: app-config + mountPath: /application.yml + subPath: application.yml + readOnly: true + volumes: + - name: app-config + configMap: + name: petclinic-configmap diff --git a/petclinic-service.yaml b/petclinic-service.yaml new file mode 100644 index 000000000..843e9356c --- /dev/null +++ b/petclinic-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: petclinic-service +spec: + selector: + app: spring-petclinic + ports: + - name: http + protocol: TCP + port: 8081 + targetPort: 8081 + type: NodePort