|
80 | 80 | </li> |
81 | 81 | <li class="toctree-l2"><a class="reference internal" href="#roll-out-a-new-version">Roll Out a New Version</a> |
82 | 82 | </li> |
| 83 | + <li class="toctree-l2"><a class="reference internal" href="#launching-and-connecting-to-redis">Launching and connecting to Redis</a> |
| 84 | + </li> |
83 | 85 | <li class="toctree-l2"><a class="reference internal" href="#exercise-deploy-complete-instavote-app">Exercise - Deploy Complete Instavote App</a> |
84 | 86 | <ul> |
85 | 87 | <li class="toctree-l3"><a class="reference internal" href="#cleaning-up">Cleaning up</a> |
@@ -383,6 +385,43 @@ <h3 id="roll-out-a-new-version">Roll Out a New Version</h3> |
383 | 385 | <p>watch the rolling update in action</p> |
384 | 386 | <pre><code>kubectl rollout status deploy/vote |
385 | 387 | </code></pre> |
| 388 | +<h3 id="launching-and-connecting-to-redis">Launching and connecting to Redis</h3> |
| 389 | +<p>If you try to connect to the frontend vote app (available on port 30300) created above, andtry to submit the vote, it thrown an error. </p> |
| 390 | +<p>Thats because there is no backend service <code>redis</code> available. </p> |
| 391 | +<p>You couldcreate a redis service with <code>clusterip</code> and the deployment for it using the following commands, </p> |
| 392 | +<pre><code>kubectl create service clusterip redis --tcp=6379 |
| 393 | +kubectl create deployment redis --image=redis:alpine |
| 394 | + |
| 395 | +</code></pre> |
| 396 | +<p>validate pods, deployment and service for redis is available, and service has discovered the pods as endpoints with, </p> |
| 397 | +<pre><code>kubectl get all,ep |
| 398 | + |
| 399 | +</code></pre> |
| 400 | +<p>[sample output]</p> |
| 401 | +<pre><code>NAME READY STATUS RESTARTS AGE |
| 402 | +pod/redis-59bc74f5b5-fgv9m 1/1 Running 0 8m45s |
| 403 | +pod/vote-5cbbf546d8-9c624 1/1 Running 0 41m |
| 404 | +pod/vote-5cbbf546d8-zwg89 1/1 Running 0 39m |
| 405 | + |
| 406 | +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE |
| 407 | +service/redis ClusterIP 10.96.179.131 <none> 6379/TCP 9m11s |
| 408 | +service/vote NodePort 10.96.233.140 <none> 80:30300/TCP 51m |
| 409 | + |
| 410 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 411 | +deployment.apps/redis 1/1 1 1 8m45s |
| 412 | +deployment.apps/vote 2/2 2 2 66m |
| 413 | + |
| 414 | +NAME DESIRED CURRENT READY AGE |
| 415 | +replicaset.apps/redis-59bc74f5b5 1 1 1 8m45s |
| 416 | +replicaset.apps/vote-5cbbf546d8 2 2 2 41m |
| 417 | +replicaset.apps/vote-75cfd886bc 0 0 0 43m |
| 418 | +replicaset.apps/vote-9c55988f4 0 0 0 66m |
| 419 | + |
| 420 | +NAME ENDPOINTS AGE |
| 421 | +endpoints/redis 10.244.2.33:6379 9m11s |
| 422 | +endpoints/vote 10.244.1.30:80,10.244.2.27:80 51m |
| 423 | +</code></pre> |
| 424 | +<p>If you see output similar to above, redis is now setup along with vote and at this time, if you submit the vote, it should go through and show you a check mark. </p> |
386 | 425 | <h3 id="exercise-deploy-complete-instavote-app">Exercise - Deploy Complete Instavote App</h3> |
387 | 426 | <p>Deploy the services with the following spec to complete this application stack.</p> |
388 | 427 | <table> |
|
0 commit comments