diff --git a/k8s-specifications/db-deployment.yaml b/k8s-specifications/db-deployment.yaml deleted file mode 100644 index 55622bb4b1..0000000000 --- a/k8s-specifications/db-deployment.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: db - name: db - namespace: vote -spec: - replicas: 1 - selector: - matchLabels: - app: db - template: - metadata: - labels: - app: db - spec: - containers: - - image: postgres:9.4 - name: postgres - env: - - name: POSTGRES_USER - value: postgres - - name: POSTGRES_PASSWORD - value: postgres - ports: - - containerPort: 5432 - name: postgres - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: db-data - volumes: - - name: db-data - emptyDir: {} diff --git a/k8s-specifications/db-service.yaml b/k8s-specifications/db-service.yaml deleted file mode 100644 index ba64baf4cc..0000000000 --- a/k8s-specifications/db-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: db - name: db - namespace: vote -spec: - type: ClusterIP - ports: - - name: "db-service" - port: 5432 - targetPort: 5432 - selector: - app: db - diff --git a/k8s-specifications/postgres-deploy.yaml b/k8s-specifications/postgres-deploy.yaml new file mode 100644 index 0000000000..a3edb2a279 --- /dev/null +++ b/k8s-specifications/postgres-deploy.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres-deploy + labels: + name: postgres-deploy + app: demo-voting-app +spec: + replicas: 1 + selector: + matchLabels: + name: postgres-pod + app: demo-voting-app + + template: + metadata: + name: postgres-pod + labels: + name: postgres-pod + app: demo-voting-app + spec: + containers: + - name: postgres:12 + image: postgres + ports: + - containerPort: 5432 + env: + - name: POSTGRES_USER + value: "postgres" + - name: POSTGRES_PASSWORD + value: "postgres" + diff --git a/k8s-specifications/postgres-service.yaml b/k8s-specifications/postgres-service.yaml new file mode 100644 index 0000000000..fc8ed3efbf --- /dev/null +++ b/k8s-specifications/postgres-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: db + labels: + name: postgres-service + app: demo-voting-app +spec: + ports: + - port: 5432 + targetPort: 5432 + selector: + name: postgres-pod + app: demo-voting-app \ No newline at end of file diff --git a/k8s-specifications/redis-deploy.yaml b/k8s-specifications/redis-deploy.yaml new file mode 100644 index 0000000000..1071960780 --- /dev/null +++ b/k8s-specifications/redis-deploy.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redis-deploy + labels: + name: redis-deploy + app: demo-voting-app +spec: + replicas: 1 + selector: + matchLabels: + name: redis-pod + app: demo-voting-app + + template: + metadata: + name: redis-pod + labels: + name: redis-pod + app: demo-voting-app + spec: + containers: + - name: redis + image: redis + ports: + - containerPort: 6379 + \ No newline at end of file diff --git a/k8s-specifications/redis-deployment.yaml b/k8s-specifications/redis-deployment.yaml deleted file mode 100644 index 53fe35c99c..0000000000 --- a/k8s-specifications/redis-deployment.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: redis - name: redis - namespace: vote -spec: - replicas: 1 - selector: - matchLabels: - app: redis - template: - metadata: - labels: - app: redis - spec: - containers: - - image: redis:alpine - name: redis - ports: - - containerPort: 6379 - name: redis - volumeMounts: - - mountPath: /data - name: redis-data - volumes: - - name: redis-data - emptyDir: {} diff --git a/k8s-specifications/redis-service.yaml b/k8s-specifications/redis-service.yaml index 050c66cb73..1645c0894f 100644 --- a/k8s-specifications/redis-service.yaml +++ b/k8s-specifications/redis-service.yaml @@ -1,16 +1,14 @@ apiVersion: v1 kind: Service metadata: - labels: - app: redis name: redis - namespace: vote + labels: + name: redis-service + app: demo-voting-app spec: - type: ClusterIP ports: - - name: "redis-service" - port: 6379 - targetPort: 6379 + - port: 6379 + targetPort: 6379 selector: - app: redis - + name: redis-pod + app: demo-voting-app \ No newline at end of file diff --git a/k8s-specifications/result-app-deploy.yaml b/k8s-specifications/result-app-deploy.yaml new file mode 100644 index 0000000000..c9ed7a8b03 --- /dev/null +++ b/k8s-specifications/result-app-deploy.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: result-app-deploy + labels: + name: result-app-deploy + app: demo-voting-app +spec: + replicas: 1 + selector: + matchLabels: + name: result-app-pod + app: demo-voting-app + + template: + metadata: + name: result-app-pod + labels: + name: result-app-pod + app: demo-voting-app + spec: + containers: + - name: result-app + image: kodekloud/examplevotingapp_result:v1 + ports: + - containerPort: 80 + \ No newline at end of file diff --git a/k8s-specifications/result-app-service.yaml b/k8s-specifications/result-app-service.yaml new file mode 100644 index 0000000000..e73e691989 --- /dev/null +++ b/k8s-specifications/result-app-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: result-service + labels: + name: result-service + app: demo-voting-app +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 80 + selector: + name: result-app-pod + app: demo-voting-app diff --git a/k8s-specifications/result-deployment.yaml b/k8s-specifications/result-deployment.yaml deleted file mode 100644 index 9939db1a34..0000000000 --- a/k8s-specifications/result-deployment.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: result - name: result - namespace: vote -spec: - replicas: 1 - selector: - matchLabels: - app: result - template: - metadata: - labels: - app: result - spec: - containers: - - image: dockersamples/examplevotingapp_result:before - name: result - ports: - - containerPort: 80 - name: result diff --git a/k8s-specifications/result-service.yaml b/k8s-specifications/result-service.yaml deleted file mode 100644 index 14a8760bc1..0000000000 --- a/k8s-specifications/result-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: result - name: result - namespace: vote -spec: - type: NodePort - ports: - - name: "result-service" - port: 5001 - targetPort: 80 - nodePort: 31001 - selector: - app: result diff --git a/k8s-specifications/vote-deployment.yaml b/k8s-specifications/vote-deployment.yaml deleted file mode 100644 index c2120d4aa0..0000000000 --- a/k8s-specifications/vote-deployment.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: vote - name: vote - namespace: vote -spec: - replicas: 1 - selector: - matchLabels: - app: vote - template: - metadata: - labels: - app: vote - spec: - containers: - - image: dockersamples/examplevotingapp_vote:before - name: vote - ports: - - containerPort: 80 - name: vote diff --git a/k8s-specifications/vote-service.yaml b/k8s-specifications/vote-service.yaml deleted file mode 100644 index c9d4972b53..0000000000 --- a/k8s-specifications/vote-service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: vote - name: vote - namespace: vote -spec: - type: NodePort - ports: - - name: "vote-service" - port: 5000 - targetPort: 80 - nodePort: 31000 - selector: - app: vote - diff --git a/k8s-specifications/voting-app-deploy.yaml b/k8s-specifications/voting-app-deploy.yaml new file mode 100644 index 0000000000..1f35fa5fbd --- /dev/null +++ b/k8s-specifications/voting-app-deploy.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: voting-app-deploy + labels: + name: voting-app-deploy + app: demo-voting-app +spec: + replicas: 1 + selector: + matchLabels: + name: voting-app-pod + app: demo-voting-app + + template: + metadata: + name: voting-app-pod + labels: + name: voting-app-pod + app: demo-voting-app + spec: + containers: + - name: voting-app + image: kodekloud/examplevotingapp_vote:v1 + ports: + - containerPort: 80 + \ No newline at end of file diff --git a/k8s-specifications/voting-app-service.yaml b/k8s-specifications/voting-app-service.yaml new file mode 100644 index 0000000000..e667482f20 --- /dev/null +++ b/k8s-specifications/voting-app-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: voting-service + labels: + name: voting-service + app: demo-voting-app +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 80 + selector: + name: voting-app-pod + app: demo-voting-app diff --git a/k8s-specifications/worker-app-deploy.yaml b/k8s-specifications/worker-app-deploy.yaml new file mode 100644 index 0000000000..3a6f8cdc70 --- /dev/null +++ b/k8s-specifications/worker-app-deploy.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: worker-app-deploy + labels: + name: worker-app-deploy + app: demo-voting-app +spec: + replicas: 1 + selector: + matchLabels: + name: worker-app-pod + app: demo-voting-app + + template: + metadata: + name: worker-app-pod + labels: + name: worker-app-pod + app: demo-voting-app + spec: + containers: + - name: worker-app + image: kodekloud/examplevotingapp_worker:v1 + \ No newline at end of file diff --git a/k8s-specifications/worker-deployment.yaml b/k8s-specifications/worker-deployment.yaml deleted file mode 100644 index ebec08d356..0000000000 --- a/k8s-specifications/worker-deployment.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: worker - name: worker - namespace: vote -spec: - replicas: 1 - selector: - matchLabels: - app: worker - template: - metadata: - labels: - app: worker - spec: - containers: - - image: dockersamples/examplevotingapp_worker - name: worker