# Install Ingress nginx

## Create namespace & vpc

To install Ingress on nginx first, you need to create a namespace and a vpc.

```bash
kubectl create ns ingress-nginx
```

Next, create a YAML file named **cvpc-ingress-nginx**.

```bash
nano cvpc-ingress-nginx.yaml
```

Copy and paste the following YAML contents

```yaml
apiVersion: tenants.cloudeka.ai/v1alpha2
kind: CloudekaVPC
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
spec:
  isolate: false
```

After pasting the syntax, save the file by pressing Ctrl + O, then press the Enter key and exit the editor by pressing Ctrl + X. The next step is to apply this configuration.

```bash
kubectl apply -f cvpc-ingress-nginx.yaml
```

## Add the Helm Repository

Add a Helm repository by running the following command.

```bash
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx --force-update
```

Create values.yaml file from the helm repository

```bash
helm show values ingress-nginx --repo ingress-nginx/ingress-nginx > values.yaml
```

Modify values.yaml file.

```bash
nano values.yaml
```

Set resources ingress controller.

```yaml
controller:
  resources:
    limits:
      cpu: 1
      memory: 1Gi
    requests:
      cpu: 1
      memory: 1Gi
```

Set resources create secret job.

```yaml
controller:
  admissionwebhooks:
    createSecretJob:
      resources:
        limits:
          cpu: 1
          memory: 1Gi
        requests:
          cpu: 1
          memory: 1Gi
```

Set resources patch webhook job.

```yaml
controller:
  admissionwebhooks:
    patchWebhookJob:
      resources:
        limits:
          cpu: 1
          memory: 1Gi
        requests:
          cpu: 1
          memory: 1Gi
```

Deploy ingress nginx.

```bash
helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --values values.yaml
```
