Skip to content

Commit c087f59

Browse files
committed
PEER-244,245: Add ingress controller and instructions
Signed-off-by: SeeuSim <[email protected]>
1 parent e188b94 commit c087f59

33 files changed

+88
-849
lines changed

k8s/README.md

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,30 @@
1414
2. For Minikube:
1515

1616
```sh
17+
# For Horizontal Pod Autoscaling
1718
minikube addons enable metric-server
19+
20+
# For Nginx Ingress Controller
21+
# Install
22+
minikube addons enable ingress
23+
# Verify
24+
kubectl get pods -n ingress-nginx
1825
```
1926

2027
3. For Kubernetes:
2128

2229
```sh
30+
# Metric Server
2331
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
32+
33+
# Ingress Controller
34+
# Install
35+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
36+
# Deploy with load balancer (GKE, AKS, EKS)
37+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
38+
# Validate
39+
kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx
40+
kubectl get services ingress-nginx-controller --namespace=ingress-nginx
2441
```
2542

2643
4. Run the command from the project root:
@@ -29,7 +46,9 @@
2946
make k8s-up
3047
```
3148

32-
5. Run the load test script:
49+
## Load Testing
50+
51+
1. Run the load test script:
3352

3453
```sh
3554
./scripts/k8s-load-test.sh
@@ -40,7 +59,7 @@
4059

4160
Also, this will ping the service's `/health` endpoint, if configured. Else, it will not work.
4261
43-
6. Run the command:
62+
2. Run the command:
4463
4564
```sh
4665
kubectl -n peerprep get all
@@ -49,5 +68,49 @@
4968
You should be able to see the Horizontal Pod AutoScaler scaling up the services in respond to
5069
resource demand.
5170
52-
7. Run <kbd>Ctrl</kbd>+<kbd>C</kbd> to interrupt and
71+
3. Run <kbd>Ctrl</kbd>+<kbd>C</kbd> to interrupt and
5372
terminate the load tester.
73+
74+
## Exposing the Ingress Controller
75+
76+
1. If you haven't already, run the command from the project root:
77+
78+
```sh
79+
make k8s-up
80+
```
81+
82+
2. Run the command to set up the ingress controller:
83+
84+
```sh
85+
kubectl apply -f ./k8s/ingress/06-nginx-ingress.yaml
86+
```
87+
88+
3. Run the command to expose the ingress controller:
89+
90+
```sh
91+
minikube tunnel
92+
```
93+
94+
4. Edit your `/etc/hosts` file and add the following at the bottom:
95+
96+
```txt
97+
127.0.0.1 peerprep-g16.net
98+
```
99+
100+
5. Visit `http://peerprep-g16.net` in your browser.
101+
102+
## Running the Minikube Service without Ingress
103+
104+
1. Run the command to set up the cluster:
105+
106+
```sh
107+
make k8s-up
108+
```
109+
110+
2. Expose the service:
111+
112+
```sh
113+
minikube -n peerprep service frontend
114+
```
115+
116+
A browser window should launch, directing you to the application's frontend.

k8s/_legacy/base/0-code-namespace.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

k8s/_legacy/base/frontend-deployment.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

k8s/_legacy/base/frontend-expose.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

k8s/_legacy/base/frontend-service.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

k8s/_legacy/base/kustomization.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

k8s/_legacy/base/match-api-network-network-policy.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

k8s/_legacy/base/match-db-deployment.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

k8s/_legacy/base/match-db-expose.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

k8s/_legacy/base/match-db-match-db-docker-persistentVolumeClaim.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)