Remove namespace from k8s example (#275)

* remove namespace from k8s example

* add remove step
This commit is contained in:
Bret Fisher
2022-12-16 22:12:11 -05:00
committed by GitHub
parent 93ee0a516c
commit c76fbd6494
11 changed files with 8 additions and 27 deletions

View File

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

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: db
name: db
namespace: vote
spec:
replicas: 1
selector:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: db
name: db
namespace: vote
spec:
type: ClusterIP
ports:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: redis
name: redis
namespace: vote
spec:
replicas: 1
selector:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: redis
name: redis
namespace: vote
spec:
type: ClusterIP
ports:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: result
name: result
namespace: vote
spec:
replicas: 1
selector:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: result
name: result
namespace: vote
spec:
type: NodePort
ports:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: vote
name: vote
namespace: vote
spec:
replicas: 1
selector:

View File

@@ -1,5 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: vote

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: vote
name: vote
namespace: vote
spec:
type: NodePort
ports:

View File

@@ -4,7 +4,6 @@ metadata:
labels:
app: worker
name: worker
namespace: vote
spec:
replicas: 1
selector: