You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You might want to have a look at the descriptor file; it contains some useful comments along the way and also the security setup to allow the controller to watch resources and to restart `Pods`.
@@ -57,45 +56,52 @@ Before we deploy this app, we should tail on the log of our controller (e.g. `ku
57
56
58
57
[source,bash]
59
58
----
60
-
controller_pod=$(kubectl get pod -o name | grep config-watcher-controller | sed -e "s/^pods\///")
If you look into this descriptor, you will find a `Deployment` using our dumb HTTP server which references the content environment variable via a `ConfigMap`.
73
70
The `ConfigMap` itself is annotated with a pod selector `k8spatterns.io/podDeleteSelector: "app=webapp"` which directly select the webapp `Pod`.
74
71
75
72
This resource file also includes the definition of a Service and an Ingress object so that we can access the server from the outside.
76
73
74
+
Before accessing the web-app we need to path the Ingress object to point to our minikube installation:
75
+
76
+
[source, bash]
77
+
----
78
+
kubectl patch ingress webapp --type=json \
79
+
-p "[{op: replace, \
80
+
path: /spec/rules/0/host, \
81
+
value: webapp.$(minikube ip).nip.io}]"
82
+
----
83
+
84
+
NOTE: `nip.io` is a nice DNS reflector service, that as result of a DNS lookup just returns the IP address that is added before as subdomain just before the `.nip.io` part.
77
85
78
86
You can access our web app directly
79
87
80
88
[source,bash]
81
89
----
82
-
# Access webapp via the included Ingress obect
83
90
curl -sk https://webapp.$(minikube ip).nip.io
84
91
----
85
92
86
93
Now change the content of `ConfigMap` and watch the log of your controller:
87
94
88
95
[source,bash]
89
96
----
90
-
# Patch config-map to update the web content
91
-
kubectl patch configmap webapp-config -p '{"data":{"message":"Take this update!"}}'
97
+
kubectl patch configmap webapp-config \
98
+
-p '{"data":{"message":"Take this update!"}}'
92
99
----
93
100
94
101
and then finally call the URL again to check that the content has been updated to
0 commit comments