👾

PlantUML Server を k8sで実行してVSCodeで使う

2022/02/10に公開

k8sはRancher Desktopでインストールすると楽。時代は進んでいくなぁ。

terminal
$ mkdir ~/docker/plantuml
$ cd ~/docker/plantuml
$ code deployment.yaml
deployment.yml
apiVersion: v1
kind: Service
metadata:
  name: plantuml
spec:
  ports:
    - port: 6655
      targetPort: 8080
  selector:
    app: plantuml
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: plantuml
spec:
  replicas: 2
  selector:
    matchLabels:
      app: plantuml
  template:
    metadata:
      labels:
        app: plantuml
    spec:
      containers:
      - name: plantuml
        image: plantuml/plantuml-server
        ports: 
        - containerPort: 8080
terminal
$ kubectl apply -f deployment.yml
service/plantuml created
$ kubectl get services                                                      
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP      10.43.0.1       <none>        443/TCP          83m
plantuml     LoadBalancer   10.43.146.193   10.0.0.20     6655:30881/TCP   101s

vscodeの設定で PlantUML Serverの設定をする

これで完成。

Discussion