From c76fbd6494d89604b26b1c55fbf783eab9a18c3d Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Fri, 16 Dec 2022 22:12:11 -0500 Subject: [PATCH] Remove namespace from k8s example (#275) * remove namespace from k8s example * add remove step --- README.md | 21 ++++++++------------- k8s-specifications/db-deployment.yaml | 1 - k8s-specifications/db-service.yaml | 1 - k8s-specifications/redis-deployment.yaml | 1 - k8s-specifications/redis-service.yaml | 1 - k8s-specifications/result-deployment.yaml | 1 - k8s-specifications/result-service.yaml | 1 - k8s-specifications/vote-deployment.yaml | 1 - k8s-specifications/vote-namespace.yml | 5 ----- k8s-specifications/vote-service.yaml | 1 - k8s-specifications/worker-deployment.yaml | 1 - 11 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 k8s-specifications/vote-namespace.yml diff --git a/README.md b/README.md index 496be3d..082d04b 100644 --- a/README.md +++ b/README.md @@ -32,24 +32,19 @@ docker stack deploy --compose-file docker-stack.yml vote The folder k8s-specifications contains the YAML specifications of the Voting App's services. -Run the following command to create the deployments and services objects in the vote namespace: +Run the following command to create the deployments and services. Note it will create these resources in your current namespace (`default` if you haven't changed it.) ```shell kubectl create -f k8s-specifications/ -vote "vote" created -deployment "db" created -deployment "db" created -service "db" created -deployment "redis" created -service "redis" created -deployment "result" created -service "result" created -deployment "vote" created -service "vote" created -deployment "worker" created ``` -The vote interface is then available on port 31000 on each host of the cluster, the result one is available on port 31001. +The `vote` web app is then available on port 31000 on each host of the cluster, the `result` web app is available on port 31001. + +To remove them, run: + +```shell +kubectl delete -f k8s-specifications/ +``` ## Architecture diff --git a/k8s-specifications/db-deployment.yaml b/k8s-specifications/db-deployment.yaml index f08a22d..bc94ca7 100644 --- a/k8s-specifications/db-deployment.yaml +++ b/k8s-specifications/db-deployment.yaml @@ -4,7 +4,6 @@ metadata: labels: app: db name: db - namespace: vote spec: replicas: 1 selector: diff --git a/k8s-specifications/db-service.yaml b/k8s-specifications/db-service.yaml index ba64baf..104f1e8 100644 --- a/k8s-specifications/db-service.yaml +++ b/k8s-specifications/db-service.yaml @@ -4,7 +4,6 @@ metadata: labels: app: db name: db - namespace: vote spec: type: ClusterIP ports: diff --git a/k8s-specifications/redis-deployment.yaml b/k8s-specifications/redis-deployment.yaml index 53fe35c..24aa521 100644 --- a/k8s-specifications/redis-deployment.yaml +++ b/k8s-specifications/redis-deployment.yaml @@ -4,7 +4,6 @@ metadata: labels: app: redis name: redis - namespace: vote spec: replicas: 1 selector: diff --git a/k8s-specifications/redis-service.yaml b/k8s-specifications/redis-service.yaml index 050c66c..809d31d 100644 --- a/k8s-specifications/redis-service.yaml +++ b/k8s-specifications/redis-service.yaml @@ -4,7 +4,6 @@ metadata: labels: app: redis name: redis - namespace: vote spec: type: ClusterIP ports: diff --git a/k8s-specifications/result-deployment.yaml b/k8s-specifications/result-deployment.yaml index 55aeae9..b85488a 100644 --- a/k8s-specifications/result-deployment.yaml +++ b/k8s-specifications/result-deployment.yaml @@ -4,7 +4,6 @@ metadata: labels: app: result name: result - namespace: vote spec: replicas: 1 selector: diff --git a/k8s-specifications/result-service.yaml b/k8s-specifications/result-service.yaml index 14a8760..f20e3b1 100644 --- a/k8s-specifications/result-service.yaml +++ b/k8s-specifications/result-service.yaml @@ -4,7 +4,6 @@ metadata: labels: app: result name: result - namespace: vote spec: type: NodePort ports: diff --git a/k8s-specifications/vote-deployment.yaml b/k8s-specifications/vote-deployment.yaml index e052e6d..165a947 100644 --- a/k8s-specifications/vote-deployment.yaml +++ b/k8s-specifications/vote-deployment.yaml @@ -4,7 +4,6 @@ metadata: labels: app: vote name: vote - namespace: vote spec: replicas: 1 selector: diff --git a/k8s-specifications/vote-namespace.yml b/k8s-specifications/vote-namespace.yml deleted file mode 100644 index a071655..0000000 --- a/k8s-specifications/vote-namespace.yml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: vote - diff --git a/k8s-specifications/vote-service.yaml b/k8s-specifications/vote-service.yaml index c9d4972..eae29ff 100644 --- a/k8s-specifications/vote-service.yaml +++ b/k8s-specifications/vote-service.yaml @@ -4,7 +4,6 @@ metadata: labels: app: vote name: vote - namespace: vote spec: type: NodePort ports: diff --git a/k8s-specifications/worker-deployment.yaml b/k8s-specifications/worker-deployment.yaml index ebec08d..9e35450 100644 --- a/k8s-specifications/worker-deployment.yaml +++ b/k8s-specifications/worker-deployment.yaml @@ -4,7 +4,6 @@ metadata: labels: app: worker name: worker - namespace: vote spec: replicas: 1 selector: