forked from plantuml/plantuml-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d011e2
commit 820fcca
Showing
3 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# PlantUML Kubernetes Deployment | ||
|
||
In this example, PlantUML is deployed on an Kubernetes cluster using a `Deployment`, a `Service` and an `Ingress`. | ||
|
||
## Quick start | ||
|
||
Install: | ||
|
||
```bash | ||
# Hint: Adjust the Ingress host to your URL | ||
|
||
kubectl create ns plantuml | ||
kubectl -n plantuml apply -f deployment.yaml | ||
``` | ||
|
||
Uninstall: | ||
|
||
```bash | ||
kubectl -n plantuml delete -f deployment.yaml | ||
kubectl delete ns plantuml | ||
``` | ||
|
||
## TLS configuration | ||
|
||
Create a TLS `Secret` and extend the `Ingress` spec with a TLS configuration: | ||
|
||
```bash | ||
[...] | ||
tls: | ||
- hosts: | ||
- plantuml-example.localhost | ||
secretName: plantuml-tls | ||
``` | ||
|
||
Since the `Ingress Controller` terminates the TLS and routes `http` to the application, we might need to tell the application explicitly that it got a forwarded request. | ||
|
||
This configuration changes depending on the `Ingress Controller`. Here an nginx example: | ||
|
||
``` | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/configuration-snippet: | | ||
more_set_headers "X-Forwarded-Proto: https"; | ||
``` | ||
|
||
## Useful commands | ||
|
||
```bash | ||
# see whats going on inside your Deployment | ||
kubectl -n plantuml logs -l "app.kubernetes.io/name=plantuml" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: plantuml | ||
labels: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
spec: | ||
replicas: 3 # Can be adjusted | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
spec: | ||
containers: | ||
- name: plantuml | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
image: plantuml/plantuml-server:jetty-v1.2022.6 | ||
imagePullPolicy: Always | ||
# env: # In case of different base URL | ||
# - name: BASE_URL | ||
# value: plantuml | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
livenessProbe: | ||
tcpSocket: | ||
port: http | ||
readinessProbe: | ||
tcpSocket: | ||
port: http | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 2048Mi | ||
requests: | ||
cpu: 250m | ||
memory: 1024Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: plantuml | ||
labels: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: plantuml | ||
labels: | ||
app.kubernetes.io/name: plantuml | ||
app.kubernetes.io/instance: plantuml | ||
spec: | ||
rules: | ||
- host: plantuml-example.localhost | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: plantuml | ||
port: | ||
number: 80 | ||
path: / | ||
pathType: Prefix |