Commit f5c5aaeb authored by David Yu Yuan's avatar David Yu Yuan
Browse files

Porting apps into clouds updated.

parent b75caf28
......@@ -3,7 +3,7 @@ Kubernetes Demo
The new and improved Kubernetes cluster on Embassy is now available. You can request one by opening a `ticket <mailto:vac@ebi.ac.uk>`_ with VAC. Here is the `documentation <https://www.ebi.ac.uk/seqdb/confluence/display/EMBCLOUD/Embassy+Hosted+Kubernetes>`_ by VAC.
In this demo, we will explore capabilities of Embassy Hosted Kubernetes (EHK) with an simple example slightly beyond "Hello World". We will use Kubernetes to create a StatefulSet of NGINX services. The system has fail-over protection and disaster recovery built in. The web content is stored in a S3 bucket as web servers in clouds would normally do.
In this demo, we will explore capabilities of Embassy Hosted Kubernetes (EHK) with an simple example slightly beyond "Hello World". We will use Kubernetes to create a StatefulSet of NGINX pods. The system has fail-over protection and disaster recovery built in. The web content is stored in a S3 bucket as web servers in clouds would normally do.
.. image:: /static/images/resops2019/Nginx.NFS.Minio.png
......
......@@ -142,7 +142,7 @@ This creates additional resources needed to for a cluster of NGINX servers(persi
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 61m
nginx ClusterIP 10.104.206.229 <none> 80/TCP 76s
You now have a cluster of two NGINX services running in Minicube. They are listening on port 80 with one cluster IP. You have just built a web service infrastructure with redundancy managed by Kubernetes.
You now have a cluster of two NGINX pods running in Minicube. They are listening on port 80 with one cluster IP. You have just built a web service infrastructure with redundancy managed by Kubernetes.
Exercise 2: Adding HTML to pods
-------------------------------
......@@ -220,12 +220,12 @@ Exit out of the pod web-1. Send HTTP request to the cluster IP again. You will f
Note that Kubernetes tend to route the requests to the same pod for better performance. You may keep seeing your HTML page served from the same pod, for example web-0. If this is happening, rename the index.html in web-0. Then you will see the page gets served from the other pod web-1::
ubuntu@resops-1-k8s-node-1:~$ kubectl exec -it web-0 -- /bin/bash
ubuntu@resops-1-k8s-node-nf-1:~$ kubectl exec -it web-0 -- /bin/bash
root@web-0:/# mv /usr/share/nginx/html/index.html /usr/share/nginx/html/index.html.bak
root@web-0:/# exit
exit
ubuntu@resops-1-k8s-node-1:~$ curl 10.97.211.138
ubuntu@resops-1-k8s-node-nf-1:~$ curl http://10.104.206.229
<html>
<head><title>Hello World from web-1</title></head>
<body>
......@@ -236,7 +236,7 @@ Note that Kubernetes tend to route the requests to the same pod for better perfo
Change the index.html page in web-0 back::
ubuntu@resops-1-k8s-node-1:~$ kubectl exec -it web-0 -- /bin/bash
ubuntu@resops-1-k8s-node-nf-1:~$ kubectl exec -it web-0 -- /bin/bash
root@web-0:/# mv /usr/share/nginx/html/index.html.bak /usr/share/nginx/html/index.html
root@web-0:/# exit
exit
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment