@@ -41,6 +41,13 @@ Create the volume claim:
4141$ kubectl apply -f ./kubernetes/persistent-volume-claim.yml
4242```
4343
44+ ### Secrets
45+
46+ Create the secret object:
47+
48+ ``` sh
49+ $ kubectl apply -f ./kubernetes/secret.yml
50+ ```
4451
4552### Postgres
4653
@@ -60,8 +67,7 @@ Create the database:
6067
6168``` sh
6269$ kubectl get pods
63- $ kubectl exec postgres-< POD_IDENTIFIER> \
64- --stdin --tty -- createdb -U postgres books
70+ $ kubectl exec postgres-< POD_IDENTIFIER> --stdin --tty -- createdb -U postgres books
6571```
6672
6773### Flask
@@ -81,65 +87,63 @@ Create the deployment:
8187$ kubectl create -f ./kubernetes/flask-deployment.yml
8288```
8389
84- Create (and expose) the service:
90+ Create the service:
8591
8692``` sh
87- $ kubectl expose deployment flask --type=NodePort --port 5000
93+ $ kubectl create -f ./kubernetes/ flask-service.yml
8894```
8995
90- Try it out :
96+ Apply the migrations and seed the database :
9197
9298``` sh
93- $ open $( minikube service flask --url) /books/ping
94- $ open $( minikube service flask --url) /books
99+ $ kubectl get pods
100+ $ kubectl exec flask-< POD_IDENTIFIER> --stdin --tty -- python manage.py recreate_db
101+ $ kubectl exec flask-< POD_IDENTIFIER> --stdin --tty -- python manage.py seed_db
95102```
96103
97- ### Vue
104+ ### Ingress
98105
99- Build and push the image to Docker Hub :
106+ Enable and apply :
100107
101108``` sh
102- $ docker build -t mjhea0/vue-kubernetes ./services/client \
103- -f ./services/client/Dockerfile-minikube
104- $ docker push mjhea0/vue-kubernetes
109+ $ minikube addons enable ingress
110+ $ kubectl apply -f ./kubernetes/minikube-ingress.yml
105111```
106112
107- > Again, replace ` mjhea0 ` with your Docker Hub namespace in the above commands as well as in * kubernetes/vue-deployment.yml*
108-
109- Create the deployment:
113+ Add entry to * /etc/hosts* file:
110114
111- ``` sh
112- $ kubectl create -f ./kubernetes/vue-deployment.yml
113115```
114-
115- Create (and expose) the service:
116-
117- ``` sh
118- $ kubectl expose deployment vue --type=NodePort --port 8080
116+ <MINIKUBE_IP> hello.world
119117```
120118
121119Try it out:
122120
121+ 1 . [ http://hello.world/books/ping ] ( http://hello.world/books/ping )
122+ 1 . [ http://hello.world/books ] ( http://hello.world/books )
123+
124+
125+ ### Vue
126+
127+ Build and push the image to Docker Hub:
128+
123129``` sh
124- $ open $( minikube service vue --url)
130+ $ docker build -t mjhea0/vue-kubernetes ./services/client \
131+ -f ./services/client/Dockerfile-minikube
132+ $ docker push mjhea0/vue-kubernetes
125133```
126134
127- ### Ingress
135+ > Again, replace ` mjhea0 ` with your Docker Hub namespace in the above commands as well as in * kubernetes/vue-deployment.yml *
128136
129- Enable and apply :
137+ Create the deployment :
130138
131139``` sh
132- $ minikube addons enable ingress
133- $ kubectl apply -f ./kubernetes/minikube-ingress.yml
140+ $ kubectl create -f ./kubernetes/vue-deployment.yml
134141```
135142
136- Add entry to * /etc/hosts * file :
143+ Create the service :
137144
145+ ``` sh
146+ $ kubectl create -f ./kubernetes/vue-service.yml
138147```
139- <MINIKUBE_IP> hello.world
140- ```
141-
142- Try it out:
143148
144- 1 . http://hello.world
145- 1 . http://hello.world/books
149+ Try it out at [ http://hello.world/ ] ( http://hello.world/ ) .
0 commit comments