Kubernetes (EKS) Deployment Guide¶
Deploying IOSetu on Amazon EKS or any Kubernetes cluster.
Deployment Manifest¶
Save as iosetu-deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: iosetu
namespace: default
labels:
app: iosetu
spec:
replicas: 2
selector:
matchLabels:
app: iosetu
template:
metadata:
labels:
app: iosetu
spec:
containers:
- name: iosetu
image: priyaiosystems/iosetu:latest
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "1000m"
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 20
env:
- name: IOSETU_LOG_LEVEL
value: "info"
---
apiVersion: v1
kind: Service
metadata:
name: iosetu
namespace: default
spec:
selector:
app: iosetu
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
Apply¶
kubectl apply -f iosetu-deployment.yaml
License Management¶
Use a Kubernetes Secret to manage your license securely and enable hot-reloading.
1. Create Secret¶
kubectl create secret generic iosetu-license --from-file=license.key=./your-license.key
2. Update Deployment to Mount Secret¶
Update your iosetu-deployment.yaml to mount the secret:
spec:
containers:
- name: iosetu
# ... existing config ...
volumeMounts:
- name: license-volume
mountPath: /etc/iosetu
readOnly: true
env:
- name: IOSETU_LICENSE_FILE
value: "/etc/iosetu/license.key"
volumes:
- name: license-volume
secret:
secretName: iosetu-license
For more details on hot-reloading and monitoring, see the License Monitoring guide.
AWS Load Balancer Controller (Ingress)¶
To expose the service externally on EKS:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: iosetu-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: iosetu
port:
number: 80
Horizontal Pod Autoscaling (HPA)¶
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: iosetu-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: iosetu
minReplicas: 2
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70