Setup in Kubernetes
You can deploy Eclipse Dirigible Docker images, for example dirigiblelabs/dirigible
, in a Kubernetes cluster.
Prerequisites
- Install kubectl.
- Access to Kubernetes Cluster on IaaS provider of your choice.
Steps
Tip
This guide describes the generic steps on how to deploy Eclipse Dirigible in a Kubernetes cluster. For more detailed deployment guides go to:
- Setup in Google Kubernetes Engine.
- Setup in Azure Kubernetes Service.
- Setup in Red Hat OpenShift.
- Setup in SAP BTP Kyma.
For additional deployment guides go to:
-
Create deployment configuration file:
deployment.yaml
apiVersion: v1 kind: Pod metadata: name: dirigible spec: containers: - name: dirigible image: dirigiblelabs/dirigible:latest imagePullPolicy: Always ports: - name: http containerPort: 8080
apiVersion: apps/v1 kind: Deployment metadata: name: dirigible spec: replicas: 1 selector: matchLabels: app: dirigible template: metadata: labels: app: dirigible spec: containers: - name: dirigible image: dirigiblelabs/dirigible:latest imagePullPolicy: Always resources: requests: memory: "1Gi" cpu: "0.5" limits: memory: "4Gi" cpu: "2" ports: - name: http containerPort: 8080 env: - name: DIRIGIBLE_THEME_DEFAULT value: "fiori"
apiVersion: apps/v1 kind: Deployment metadata: name: dirigible spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: dirigible template: metadata: labels: app: dirigible spec: containers: - name: dirigible image: dirigiblelabs/dirigible:latest imagePullPolicy: Always resources: requests: memory: "1Gi" cpu: "0.5" limits: memory: "4Gi" cpu: "2" ports: - name: http containerPort: 8080 env: - name: DIRIGIBLE_THEME_DEFAULT value: "fiori" volumeMounts: - name: dirigible-data mountPath: /usr/local/tomcat/target/dirigible/repository volumes: - name: dirigible-data persistentVolumeClaim: claimName: "dirigible-data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: dirigible-data spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
-
Create service configuration file:
service.yaml
apiVersion: v1 kind: Service metadata: name: dirigible labels: app: dirigible spec: ports: - name: http port: 8080 type: ClusterIP selector: app: dirigible
apiVersion: v1 kind: Service metadata: name: dirigible labels: app: dirigible spec: ports: - name: http port: 8080 type: NodePort selector: app: dirigible
apiVersion: v1 kind: Service metadata: name: dirigible labels: app: dirigible spec: ports: - name: http port: 80 targetPort: 8080 - name: https port: 443 targetPort: 8080 type: LoadBalancer selector: app: dirigible
apiVersion: v1 kind: Service metadata: name: dirigible labels: app: dirigible spec: ports: - name: http port: 8080 type: ClusterIP selector: app: dirigible --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: dirigible spec: rules: - host: dirigible.<kubernetes-ingress-host> http: paths: - path: / pathType: Prefix backend: service: name: dirigible port: number: 8080
Note
Replace
<kubernetes-ingress-host>
with your Ingress host. -
Deploy to the Kubernetes Cluster with:
kubectl apply -f deployment.yml kubectl apply -f service.yml
-
Open a web browser and go to:
http://dirigible.<kubernetes-ingress-host>
Note
- Replace
<kubernetes-ingress-host>
with your Ingress host. - Login with user
dirigible
and passworddirigible
, which are set by default in the Docker image (dirigiblelabs/dirigible) used above.
- Replace
Maintenance
Version Update
To update the Eclipse Dirigible version either use the kubectl or update the Deployment YAML as follows:
kubectl set image deployment/dirigible dirigible=dirigiblelabs/dirigible:<dirigible-version>
spec:
containers:
- name: dirigible
image: dirigiblelabs/dirigible:<dirigible-version>
imagePullPolicy: Always
Eclipse Dirigible versions
Update the <dirigible-version>
placeholder with a stable release version:
Scaling
The Eclipse Dirigible Deployment could be scaled horizontally by adding/removing Pods as follows:
kubectl scale deployment/dirigible --replicas=0
kubectl scale deployment/dirigible --replicas=<number-of-replicas>
Note
To learn more about application scaling in Kubernetes, see Horizontal Pod Autoscaling.
Debugging
To debug the Eclipse Dirigible engine via Remote Java Debugging execute the following commands:
-
Scale the deployment to zero:
kubectl scale deployment/dirigible --replicas=0
-
Set debug environment variables:
kubectl set env deployment/dirigible -e JPDA_ADDRESS=0.0.0.0:8000 kubectl set env deployment/dirigible -e JPDA_TRANSPORT=dt_socket
-
Edit the deployment and add
command
andargs
:kubectl edit deployment dirigible
containers: - name: dirigible image: dirigiblelabs/dirigible:latest imagePullPolicy: Always command: ["/bin/sh"] args: ["/usr/local/tomcat/bin/catalina.sh", "jpda", "run"]
-
Scale up the deployment:
kubectl scale deployment/dirigible --replicas=1
-
Forward the debug port:
kubectl port-forward deployment/dirigible 8000:8000
Clean-up
To clean-up the environment after the debugging is done:
- Stop the port forwarding.
- Scale the deployment to zero.
-
Remove the debug environment variables:
kubectl set env deployment/dirigible -e JPDA_ADDRESS- kubectl set env deployment/dirigible -e JPDA_TRANSPORT-
-
Edit the deployment and remove
command
andargs
. - Scale up the deployment.