This guide covers deploying Azure IPAM to a Kubernetes cluster.
- Kubernetes cluster (1.24+)
- kubectl configured to access your cluster
- Container registry with pushed images
- Ingress controller installed (nginx-ingress recommended)
kubernetes/
├── base/ # Base Kustomize configuration
│ ├── kustomization.yaml
│ ├── namespace.yaml
│ ├── configmap.yaml
│ ├── secret.yaml
│ ├── api-deployment.yaml
│ ├── frontend-deployment.yaml
│ ├── ingress.yaml
│ ├── hpa.yaml
│ ├── pdb.yaml
│ └── network-policy.yaml
└── overlays/
├── dev/ # Development environment
└── prod/ # Production environment
# Build images
cd deploy/docker
docker-compose build
# Tag for your registry
docker tag azure-ipam-api:latest yourregistry.azurecr.io/azure-ipam-api:v1.0.0
docker tag azure-ipam-frontend:latest yourregistry.azurecr.io/azure-ipam-frontend:v1.0.0
# Push to registry
docker push yourregistry.azurecr.io/azure-ipam-api:v1.0.0
docker push yourregistry.azurecr.io/azure-ipam-frontend:v1.0.0Create the secret with your Azure credentials:
kubectl create namespace azure-ipam
kubectl create secret generic azure-ipam-secrets \
--namespace azure-ipam \
--from-literal=AZURE_TENANT_ID=<your-tenant-id> \
--from-literal=AZURE_CLIENT_ID=<your-sp-client-id> \
--from-literal=AZURE_CLIENT_SECRET=<your-sp-secret> \
--from-literal=VITE_AZURE_TENANT_ID=<your-tenant-id> \
--from-literal=VITE_AZURE_CLIENT_ID=<your-app-client-id> \
--from-literal=AZURE_STORAGE_CONNECTION="UseDevelopmentStorage=true"Edit base/kustomization.yaml to point to your registry:
images:
- name: azure-ipam-api
newName: yourregistry.azurecr.io/azure-ipam-api
newTag: v1.0.0
- name: azure-ipam-frontend
newName: yourregistry.azurecr.io/azure-ipam-frontend
newTag: v1.0.0# Preview the manifests
kubectl kustomize deploy/kubernetes/base
# Apply to cluster
kubectl apply -k deploy/kubernetes/base
# Check status
kubectl get all -n azure-ipamUpdate base/ingress.yaml with your domain:
spec:
rules:
- host: ipam.yourdomain.com
http:
paths:
... ┌─────────────┐
│ Ingress │
│ Controller │
└──────┬──────┘
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ │
┌─────────┐ ┌─────────┐ │
│ /api/* │ │ /* │ │
└────┬────┘ └────┬────┘ │
│ │ │
▼ ▼ │
┌───────────────┐ ┌───────────────┐ │
│ API Service │ │Frontend Svc │ │
│ (ClusterIP) │ │ (ClusterIP) │ │
└───────┬───────┘ └───────┬───────┘ │
│ │ │
┌───────▼───────┐ ┌───────▼───────┐ │
│ API Pods │ │ Frontend Pods │ │
│ (2-10) │ │ (2-5) │ │
└───────┬───────┘ └───────────────┘ │
│ │
▼ │
┌───────────────┐ │
│ Azure │◄───────────────────┘
│ Resources │
└───────────────┘
Create environment-specific configurations using Kustomize overlays:
Development Overlay (overlays/dev/kustomization.yaml):
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: azure-ipam-dev
patches:
- patch: |
- op: replace
path: /spec/replicas
value: 1
target:
kind: Deployment
images:
- name: azure-ipam-api
newName: yourregistry.azurecr.io/azure-ipam-api
newTag: dev-latestProduction Overlay (overlays/prod/kustomization.yaml):
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: azure-ipam
patches:
- patch: |
- op: replace
path: /spec/replicas
value: 3
target:
kind: Deployment
name: azure-ipam-api
images:
- name: azure-ipam-api
newName: yourregistry.azurecr.io/azure-ipam-api
newTag: v1.0.0Adjust resource requests/limits in api-deployment.yaml and frontend-deployment.yaml:
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"# Deploy
kubectl apply -k deploy/kubernetes/base
# Check status
kubectl get all -n azure-ipam
kubectl get ingress -n azure-ipam
# View logs
kubectl logs -n azure-ipam -l app.kubernetes.io/component=api -f
kubectl logs -n azure-ipam -l app.kubernetes.io/component=frontend -f
# Scale manually
kubectl scale deployment azure-ipam-api -n azure-ipam --replicas=3
# Update image
kubectl set image deployment/azure-ipam-api \
api=yourregistry.azurecr.io/azure-ipam-api:v1.1.0 \
-n azure-ipam
# Rollback
kubectl rollout undo deployment/azure-ipam-api -n azure-ipam
# Delete
kubectl delete -k deploy/kubernetes/base- Install cert-manager
- Create a ClusterIssuer for Let's Encrypt
- Update ingress annotations and TLS section
metadata:
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- ipam.yourdomain.com
secretName: azure-ipam-tlskubectl create secret tls azure-ipam-tls \
--namespace azure-ipam \
--cert=path/to/cert.pem \
--key=path/to/key.pem# Check pod status
kubectl describe pod -n azure-ipam -l app.kubernetes.io/component=api
# Check events
kubectl get events -n azure-ipam --sort-by='.lastTimestamp'# Check API logs
kubectl logs -n azure-ipam -l app.kubernetes.io/component=api --tail=100
# Exec into pod for debugging
kubectl exec -it -n azure-ipam deployment/azure-ipam-api -- sh# Check ingress status
kubectl describe ingress azure-ipam-ingress -n azure-ipam
# Check ingress controller logs
kubectl logs -n ingress-nginx -l app.kubernetes.io/component=controller