Skip to content

feat: NIC demo files and README #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions nic/appworld/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# NGINX Ingress Controller Demo

## Prerequisites

### Install VSCode

1. Go to the [VSCode download page](https://code.visualstudio.com/download).
2. Download the installer for your operating system.
3. Run the installer and follow the on-screen instructions to complete the installation.

### Install Git

1. Open a terminal or command prompt.
2. Run the following command to install Git using Winget:
```shell
winget install -e --id Git.Git
```

### Authenticate with GitHub

1. Open a terminal or command prompt.
2. Configure your GitHub email:
```shell
git config --global user.email "[email protected]"
```
3. Configure your GitHub username:
```shell
git config --global user.name "Your Name"
```

### Install Docker Desktop

1. Open a terminal or command prompt.
2. Run the following command to install Docker Desktop using Winget:
```shell
winget install -e --id Docker.DockerDesktop
```
3. Follow the on-screen instructions to complete the installation.

### Install Helm

1. Open a terminal or command prompt.
2. Run the following command to install Helm using Winget:
```shell
winget install -e --id Helm.Helm
```
3. Follow the on-screen instructions to complete the installation.

## Demo Commands

### Add NGINX Helm Repository

1. Open a terminal or command prompt.
2. Run the following command to add the NGINX stable Helm repository:
```bash
helm repo add nginx-stable https://helm.nginx.com/stable
```

### Update Helm Repositories

1. Open a terminal or command prompt.
2. Run the following command to update your Helm repositories:
```bash
helm repo update
```

### Apply Kubernetes CRDs

1. Open a terminal or command prompt.
2. Run the following command to apply the NGINX Kubernetes CRDs:
```bash
kubectl apply -f https://raw.githubusercontent.com/nginx/kubernetes-ingress/v4.0.1/deploy/crds.yaml
```

### Install NGINX Ingress Controller

1. Open a terminal or command prompt.
2. Run the following command to install the NGINX Ingress Controller using Helm:
```bash
helm install nginx-ingress nginx-stable/nginx-ingress --namespace default
```

### Deploy NGINX Application

1. Open a terminal or command prompt.
2. Run the following command to apply the NGINX deployment configuration:
```bash
kubectl apply -f nginx-deployment.yaml
```

### Apply NGINX Ingress Configuration

1. Open a terminal or command prompt.
2. Run the following command to apply the NGINX ingress configuration:
```bash
kubectl apply -f nginx-ingress.yaml
```

## Demo Take Aways

- Intalling NGINX Ingress Controller (NIC) is quick and simple to get up and functional in Kubernetes (K8s)
- NGINX web server and NIC on K8s on Docker Desktop provides a light weight low stress K8s dev environment to experiment and lean.
- Recovery from issues is as simple as performing a quick reset of K8s and a few minutes to stand up the envionment again.
- Join the community and become a contributor.
38 changes: 38 additions & 0 deletions nic/appworld/nginx-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
resources:
limits:
memory: "128Mi"
cpu: "500m"
requests:
memory: "64Mi"
cpu: "250m"
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
17 changes: 17 additions & 0 deletions nic/appworld/nginx-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
spec:
ingressClassName: nginx
rules:
- host: localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-service
port:
number: 80