Deploy Docker image to Azure Kubernetes Service (AKS)
Prerequisites
- Azure account and Azure CLI installed.
- Sign in to Azure
az loginStep 1: Create a resource group.
az group create --name pdfviewerresourcegroup --location "East US"Step 2: Create an AKS cluster.
az aks create --resource-group pdfviewerresourcegroup --name pdfviewercluster --node-count 1Step 3: Connect to the cluster.
Install kubectl and configure access.
az aks install-cli
az aks get-credentials --resource-group pdfviewerresourcegroup --name pdfviewerclusterStep 4: Create services and deployments.
Create a pdfviewer-server.yaml file with a Deployment and a Service.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pdfviewerserver
name: pdfviewerserver
spec:
replicas: 1
selector:
matchLabels:
app: pdfviewerserver
strategy: {}
template:
metadata:
labels:
app: pdfviewerserver
spec:
containers:
- image: syncfusion/pdfviewerserver:latest
name: pdfviewerserver
ports:
- containerPort: 80
env:
- name: SYNCFUSION_LICENSE_KEY
value: "YOUR_LICENSE_KEY"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pdfviewerserver
name: pdfviewerserver
spec:
ports:
- port: 80
targetPort: 80
selector:
app: pdfviewerserver
type: LoadBalancerStep 5: Apply the configuration and get the external IP.
kubectl create -f ./pdfviewer-server.yaml
kubectl get allBrowse to http://
Step 6: Use the service endpoint (for example, http://
For production guidance, see Azure Kubernetes Service documentation.