Skip to content

Commit 3b7ed2a

Browse files
feat: NIC demo files and README (#6)
Co-authored-by: Alessandro Fael Garcia <[email protected]>
1 parent 682fdc8 commit 3b7ed2a

File tree

3 files changed

+159
-0
lines changed

3 files changed

+159
-0
lines changed

nic/appworld/README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# NGINX Ingress Controller Demo
2+
3+
## Prerequisites
4+
5+
### Install VSCode
6+
7+
1. Go to the [VSCode download page](https://code.visualstudio.com/download).
8+
2. Download the installer for your operating system.
9+
3. Run the installer and follow the on-screen instructions to complete the installation.
10+
11+
### Install Git
12+
13+
1. Open a terminal or command prompt.
14+
2. Run the following command to install Git using Winget:
15+
```shell
16+
winget install -e --id Git.Git
17+
```
18+
19+
### Authenticate with GitHub
20+
21+
1. Open a terminal or command prompt.
22+
2. Configure your GitHub email:
23+
```shell
24+
git config --global user.email "[email protected]"
25+
```
26+
3. Configure your GitHub username:
27+
```shell
28+
git config --global user.name "Your Name"
29+
```
30+
31+
### Install Docker Desktop
32+
33+
1. Open a terminal or command prompt.
34+
2. Run the following command to install Docker Desktop using Winget:
35+
```shell
36+
winget install -e --id Docker.DockerDesktop
37+
```
38+
3. Follow the on-screen instructions to complete the installation.
39+
40+
### Install Helm
41+
42+
1. Open a terminal or command prompt.
43+
2. Run the following command to install Helm using Winget:
44+
```shell
45+
winget install -e --id Helm.Helm
46+
```
47+
3. Follow the on-screen instructions to complete the installation.
48+
49+
## Demo Commands
50+
51+
### Add NGINX Helm Repository
52+
53+
1. Open a terminal or command prompt.
54+
2. Run the following command to add the NGINX stable Helm repository:
55+
```bash
56+
helm repo add nginx-stable https://helm.nginx.com/stable
57+
```
58+
59+
### Update Helm Repositories
60+
61+
1. Open a terminal or command prompt.
62+
2. Run the following command to update your Helm repositories:
63+
```bash
64+
helm repo update
65+
```
66+
67+
### Apply Kubernetes CRDs
68+
69+
1. Open a terminal or command prompt.
70+
2. Run the following command to apply the NGINX Kubernetes CRDs:
71+
```bash
72+
kubectl apply -f https://raw.githubusercontent.com/nginx/kubernetes-ingress/v4.0.1/deploy/crds.yaml
73+
```
74+
75+
### Install NGINX Ingress Controller
76+
77+
1. Open a terminal or command prompt.
78+
2. Run the following command to install the NGINX Ingress Controller using Helm:
79+
```bash
80+
helm install nginx-ingress nginx-stable/nginx-ingress --namespace default
81+
```
82+
83+
### Deploy NGINX Application
84+
85+
1. Open a terminal or command prompt.
86+
2. Run the following command to apply the NGINX deployment configuration:
87+
```bash
88+
kubectl apply -f nginx-deployment.yaml
89+
```
90+
91+
### Apply NGINX Ingress Configuration
92+
93+
1. Open a terminal or command prompt.
94+
2. Run the following command to apply the NGINX ingress configuration:
95+
```bash
96+
kubectl apply -f nginx-ingress.yaml
97+
```
98+
99+
## Demo Take Aways
100+
101+
- Intalling NGINX Ingress Controller (NIC) is quick and simple to get up and functional in Kubernetes (K8s)
102+
- NGINX web server and NIC on K8s on Docker Desktop provides a light weight low stress K8s dev environment to experiment and lean.
103+
- Recovery from issues is as simple as performing a quick reset of K8s and a few minutes to stand up the envionment again.
104+
- Join the community and become a contributor.

nic/appworld/nginx-deployment.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: nginx
10+
template:
11+
metadata:
12+
labels:
13+
app: nginx
14+
spec:
15+
containers:
16+
- name: nginx
17+
image: nginx:latest
18+
ports:
19+
- containerPort: 80
20+
resources:
21+
limits:
22+
memory: "128Mi"
23+
cpu: "500m"
24+
requests:
25+
memory: "64Mi"
26+
cpu: "250m"
27+
---
28+
apiVersion: v1
29+
kind: Service
30+
metadata:
31+
name: nginx-service
32+
spec:
33+
selector:
34+
app: nginx
35+
ports:
36+
- protocol: TCP
37+
port: 80
38+
targetPort: 80

nic/appworld/nginx-ingress.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: nginx-ingress
5+
spec:
6+
ingressClassName: nginx
7+
rules:
8+
- host: localhost
9+
http:
10+
paths:
11+
- path: /
12+
pathType: Prefix
13+
backend:
14+
service:
15+
name: nginx-service
16+
port:
17+
number: 80

0 commit comments

Comments
 (0)