[Kubernetes (K8S)] Helm install PlantUML Server to generate UML diagrams on-the-fly within Kubernetes (K8S)

PlantUML

PlantUML is an open-source tool allowing users to create diagrams from a plain text language that allows to quickly write :

  • Sequence diagram

  • Usecase diagram

  • Class diagram

  • Activity diagram (here is the legacy syntax)

  • Component diagram

  • State diagram

  • Object diagram

  • Deployment diagram

  • Timing diagram

PlantUML Server is a web application to generate UML diagrams on-the-fly.

This article is about how to use Helm to deploy PlantUML Server on Kubernetes (K8S).

Prerequisites

  • Kubernetes (K8S)
    Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

    For more information about installing and using Kubernetes (K8s), see the Kubernetes (K8s) Docs.

  • Helm
    Helm is the best way to find, share, and use software built for Kubernetes.

    For more information about installing and using Helm, see the Helm Docs.

Installation

Custom Values.yaml

Remember to replace content within {{ }} with your prefer values.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# values.yaml

# ingress:
# enabled: true

# annotations:
# kubernetes.io/ingress.class: "nginx"
# kubernetes.io/tls-acme: "true"

# cert-manager.io/acme-challenge-type: dns01
# cert-manager.io/cluster-issuer: cert-manager-webhook-dnspod-cluster-issuer

# hostname: {{ .Values.ingress.host }}

# tls:
# - secretName: {{ .Values.tls.secretName }}
# hosts:
# - {{ .Values.ingress.host }}

Install by Helm

Helm install plantuml into plantuml namespace.

1
2
3
4
5
6
7
8
9
10
11
# crate namespace:
$ kubectl create namespace plantuml

# Add the Helm repository:
$ helm repo add stevehipwell https://stevehipwell.github.io/helm-charts/

# Update your local Helm chart repository cache:
$ helm repo update

# To install Helm chart:
$ helm install plantuml stevehipwell/plantuml --namespace plantuml -f values.yaml

See Helm release about plantuml.

1
2
3
$ helm list --namespace plantuml
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
plantuml plantuml 3 2020-09-19 05:47:51.671588 +0800 +0800 deployed plantuml-1.2.0 1.2020.19

See pods about plantuml.

1
2
3
$ kubectl get pods -n plantuml
NAME READY STATUS RESTARTS AGE
plantuml-84d86c9dc6-wrc6h 1/1 Running 0 14md

Ingress

Create Ingress for plantuml.

Remember to replace content within {{ }} with your prefer values.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Ingress.plantuml.yaml

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"

# cert-manager.io/acme-challenge-type: dns01
# cert-manager.io/cluster-issuer: cert-manager-webhook-dnspod-cluster-issuer

# ingress.kubernetes.io/auth-type: "basic"
# ingress.kubernetes.io/auth-secret: {{ .Values.ingress.basic.secret }}
name: plantuml
namespace: plantuml
spec:
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- backend:
serviceName: plantuml
servicePort: 80
tls:
- secretName: {{ .Values.tls.secretName }}
hosts:
- {{ .Values.ingress.host }}

Apply manifest file.

1
$ kubectl apply -f Ingress.plantuml.yaml

Then, you can visit plantuml server with https://{{ .Values.ingress.host }}.

References

[1] plantuml 1.2.0 · steve.hipwell/stevehipwell - https://artifacthub.io/packages/helm/stevehipwell/plantuml/1.2.0

[2] Open-source tool that uses simple textual descriptions to draw beautiful UML diagrams. - https://plantuml.com/

[3] plantuml/plantuml-server: PlantUML Online Server - https://github.com/plantuml/plantuml

[4] Helm - https://helm.sh/

[5] Kubernetes - https://kubernetes.io/