Go to file
Sangmin Kim 5db594f568 modified: README.md 2024-04-08 23:05:22 +09:00
app learn 2024-03-19 22:04:32 +09:00
origin33 new file: origin33/deployment.yml 2024-04-08 17:24:58 +09:00
volumes/learn new file: origin33/deployment.yml 2024-04-08 17:24:58 +09:00
.DS_Store app 2024-03-19 21:48:13 +09:00
LICENSE Initial commit 2024-03-19 12:26:17 +00:00
README.md modified: README.md 2024-04-08 23:05:22 +09:00
compose.yml compose.yml 2024-03-19 22:06:56 +09:00

README.md

origin33

Sample Workflow

  • Alice : Content Creator
  • Bob : Lab Administrator

1. Servers vs Clients

Alice ->> Bob: I'd like to create a new lab for ION.
Bob ->> Alice: Do you want servers or clients? 
Alice ->> Bob: I just need a web server that will be shared by learners.

OPTION 1: Bob can create diverse types of servers (Linux only!) such as, web servers, application servers, database servers, and so on.

Sample server: https://origin-akashop.akamai-lab.com/

OPTION 2: Bob can create one type of clients based on Visual Studio Code. Clients can be assigned to learners one to one or one to many.

Sample client: https://training.akamai.com/ewp

2. Software

Bob ->> Alice: Do you have any prefered web server software, like apache or nginx?
Alice ->> Bob: nginx with php would be good.
Bob ->> Alice: Do you need any other softwares?
Alice ->> Bob: Yes. Please install python3 and flask, too.

Bob can install other softwares or tools such as akamai cli, based on the lab scenario.

3. Infrastructure

Alice ->> Bob: Can you upload my files(html, css, js, images, app.py,...) to the server?
Bob ->> Alice: Certainly. We will have multiple server instances for high availability. Do you want all server instances to access the same files, or should each server have its own copy?
Alice ->> Bob: All server instances should be able to read or write the same files.

Bob needs to use ReadWriteMany persistent volume access mode. However, Linode block storage does NOT support ReadWriteMany mode and NFS can be a good alternative. In this sample scenario, we will use NFS.

4. Docker Image

Bob ->> Alice: Do you have a custom docker image for this lab?
Alice ->> Bob: No.  
Bob ->> Alice: OK. Then I will build a docker image based on public nginx docker image.

Bob builds a docker image and Alice validates it iteratively until they finalize the image. After the docker image is ready, Bob push it to a docker repository.

$ docker login gitea-ptl.akamai-lab.com
$ docker tag origin33 gitea-ptl.akamai-lab.com/akamai/origin33
$ docker push gitea-ptl.akamai-lab.com/akamai/origin33

5. Staging Deployment

Bob builds kubernetes yaml files and Alice validates them iteratively until they finalize the yaml files. They might need more discussion on the technical details such as health check, auto scaling, and etc.

Bob applies the yaml files to Kubernetes staging environment.

$ kubectl create namespace origin33
$ kubectl apply -f pvc.yml -f deployment.yml -f service.yml -f traefik-ingressR.yml -n origin33

6. Staging Test

Bob finds the IP address of the LoadBalancer. In the following example, it is {traefik-web-EXTERNAL-IP} (172.233.168.36).

$ kubectl get services -n traefik
NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                      AGE
traefik-dashboard-service   LoadBalancer   10.128.46.205   172.233.169.40   8080:32174/TCP               18h
traefik-web                 LoadBalancer   10.128.2.58     172.233.168.36   80:31310/TCP,443:32696/TCP   18h

Bob tests the server by DNS spoofing.

$ http http://{traefik-web-EXTERNAL-IP} Host:origin-33.akamai-lab.com
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Mon, 08 Apr 2024 14:01:08 GMT
Server: nginx/1.24.0
Set-Cookie: _30cb3=9435af3328ab4cfe; Path=/; HttpOnly; SameSite=Strict
Transfer-Encoding: chunked
X-Powered-By: PHP/8.1.22

Bob commits and pushes files to git repository.(https://gitea-ptl.akamai-lab.com)

6. Production Deployment & Test

Bob create or update DNS record for the hostname.

origin-33.akamai-lab.com. 600   IN      A       172.233.168.36

Bob applies the yaml files to Kubernetes staging environment.

Alice validates the environment by end-to-end test.

More Sample Codes

How to use HTTPS

How to redirect HTTP to HTTPS

How to maintain Session Stickyness

How to use ReadWriteMany pvc