Examples
Sample applications and use cases
Podinfo App
Deploy a sample application with Istio ingress.
# Deploy
kubectl apply -f examples/podinfo-app.yaml
# Get Ingress IP
INGRESS_IP=$(kubectl get svc -n istio-system istio-ingressgateway \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Add to /etc/hosts
echo "$INGRESS_IP podinfo.local" | sudo tee -a /etc/hosts
# Test
curl http://podinfo.local
NFS Storage Examples
Dynamic Storage (Automatic PV)
# Deploy example with dynamic provisioning
kubectl apply -f examples/nfs-pv-pvc.yaml
# Check resources
kubectl get pvc -n dynamic-demo
kubectl get pods -n dynamic-demo
The PV is created automatically by the NFS provisioner.
Static Storage (Manual PV)
# Check static example
kubectl get pv
kubectl get pvc -n static-demo
kubectl get pods -n static-demo
Httpbin (Complete Istio Example)
Deploy httpbin with Gateway and VirtualService.
Create Namespace
# Create namespace with Istio injection
kubectl create namespace demo
kubectl label namespace demo istio-injection=enabled
Deploy Httpbin
kubectl apply -n demo -f https://raw.githubusercontent.com/istio/istio/release-1.28/samples/httpbin/httpbin.yaml
Create Gateway and VirtualService
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
name: httpbin-gateway
namespace: demo
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "httpbin.local"
---
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: httpbin
namespace: demo
spec:
hosts:
- "httpbin.local"
- "httpbin.demo.svc.cluster.local"
gateways:
- httpbin-gateway
- mesh
http:
- route:
- destination:
host: httpbin
port:
number: 8000
EOF
Access Httpbin
# Get Ingress IP
INGRESS_IP=$(kubectl get svc -n istio-system istio-ingressgateway \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Add to /etc/hosts
echo "$INGRESS_IP httpbin.local" | sudo tee -a /etc/hosts
# Test endpoints
curl http://httpbin.local/headers
curl http://httpbin.local/ip
curl http://httpbin.local/get
curl -X POST http://httpbin.local/post -d "test=data"
Monitoring Access
Grafana
# Get Ingress IP
INGRESS_IP=$(kubectl get svc -n istio-system istio-ingressgateway \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Add to /etc/hosts
echo "$INGRESS_IP grafana.local prometheus.local" | sudo tee -a /etc/hosts
# Access
open http://grafana.local
Credentials: admin / admin123
Prometheus
open http://prometheus.local
Karpor Access
# Get Ingress IP
INGRESS_IP=$(kubectl get svc -n istio-system istio-ingressgateway \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Add to /etc/hosts
echo "$INGRESS_IP karpor.local" | sudo tee -a /etc/hosts
# Access
open http://karpor.local
All Hosts Summary
Add all hosts at once:
INGRESS_IP=$(kubectl get svc -n istio-system istio-ingressgateway \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "$INGRESS_IP grafana.local prometheus.local karpor.local podinfo.local httpbin.local" | sudo tee -a /etc/hosts
| Host | Service |
|---|---|
| grafana.local | Grafana dashboards |
| prometheus.local | Prometheus metrics |
| karpor.local | Kubernetes Explorer |
| podinfo.local | Sample app |
| httpbin.local | HTTP test service |