diff --git a/p2/confs/app1.yaml b/p2/confs/app1.yaml index 5023773..d53ee11 100644 --- a/p2/confs/app1.yaml +++ b/p2/confs/app1.yaml @@ -17,11 +17,22 @@ spec: containers: - name: app1 image: nginx:1.14.2 + volumeMounts: + - name: indexes + mountPath: /usr/share/nginx/html/index.html + subPath: app1 + volumes: + - name: indexes + configMap: + name: indexes + items: + - key: app1 + path: app1 --- apiVersion: v1 kind: Service metadata: - name: app1 + name: app1-service spec: type: NodePort selector: @@ -29,4 +40,3 @@ spec: ports: - port: 80 targetPort: 80 - nodePort: 30080 diff --git a/p2/confs/app2.yaml b/p2/confs/app2.yaml new file mode 100644 index 0000000..c5c560e --- /dev/null +++ b/p2/confs/app2.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app2-deployment + labels: + app: app2 +spec: + replicas: 3 + selector: + matchLabels: + app: app2 + template: + metadata: + labels: + app: app2 + spec: + containers: + - name: app2 + image: nginx:1.14.2 + volumeMounts: + - name: indexes + mountPath: /usr/share/nginx/html/index.html + subPath: app2 + volumes: + - name: indexes + configMap: + name: indexes + items: + - key: app2 + path: app2 +--- +apiVersion: v1 +kind: Service +metadata: + name: app2-service +spec: + type: NodePort + selector: + app: app2 + ports: + - port: 80 + targetPort: 80 diff --git a/p2/confs/app3.yaml b/p2/confs/app3.yaml new file mode 100644 index 0000000..0bfffcb --- /dev/null +++ b/p2/confs/app3.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app3-deployment + labels: + app: app3 +spec: + replicas: 1 + selector: + matchLabels: + app: app3 + template: + metadata: + labels: + app: app3 + spec: + containers: + - name: app3 + image: nginx:1.14.2 + volumeMounts: + - name: indexes + mountPath: /usr/share/nginx/html/index.html + subPath: app3 + volumes: + - name: indexes + configMap: + name: indexes + items: + - key: app3 + path: app3 +--- +apiVersion: v1 +kind: Service +metadata: + name: app3-service +spec: + type: NodePort + selector: + app: app3 + ports: + - port: 80 + targetPort: 80 diff --git a/p2/confs/indexes.yaml b/p2/confs/indexes.yaml new file mode 100644 index 0000000..65db653 --- /dev/null +++ b/p2/confs/indexes.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: indexes +data: + app1: | +