> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ahmadraza.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Istio Ingress NLB

helm repo add istio [https://istio-release.storage.googleapis.com/charts](https://istio-release.storage.googleapis.com/charts)
helm repo update

kubectl create namespace istio-system

# Install Istio Base Chart

helm install istio-base istio/base -n istio-system --set defaultRevision=default --create-namespace

# Install Istiod (Control Plane)

helm install istiod istio/istiod -n istio-system --wait

```yaml theme={null}
# values.yaml
service:
  type: LoadBalancer
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
    service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
```

````

```bash
# instll custom values
helm install istio-ingress istio/gateway -n istio-system -f values.yaml --wait
````

```bash theme={null}
# Retrieve NLB DNS and Update DNS Records
kubectl -n istio-system get svc istio-ingress -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
```

# Create Gateway and VirtualService for Your Application

```
# gateway.yaml
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: ai-assistant-gateway
  namespace: ai-assistant
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "assist.ahmadraza.in"
```

***

```
# virtualservice.yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: ai-assistant-vs
  namespace: ai-assistant
spec:
  hosts:
  - "assist.ahmadraza.in"
  gateways:
  - ai-assistant-gateway
  http:
  - match:
    - uri:
        prefix: "/api"
    route:
    - destination:
        host: backend-service
        port:
          number: 80
  - match:
    - uri:
        prefix: "/"
    route:
    - destination:
        host: frontend-service
        port:
          number: 80
```

```bash theme={null}
kubectl apply -f gateway.yaml
kubectl apply -f virtualservice.yaml
```
