k8s part done

This commit is contained in:
ivan_chuvakhin 2021-07-01 21:03:46 +03:00
parent bb42fb739b
commit 2dab087dda
3 changed files with 51 additions and 0 deletions

8
petclinic-config.yaml Normal file
View file

@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: petclinic-configmap
data:
application.yml: |
server:
port: 8081

30
petclinic-deployment.yaml Normal file
View file

@ -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

13
petclinic-service.yaml Normal file
View file

@ -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