INT 21h

Hi, I am Vladimir Smagin, SysAdmin and Kaptain. Telegram Email / GIT / RSS / GPG

Vaultwarden fast start in Kubernetes

№ 11409 В разделе "Sysadmin" от November 2nd, 2021,
В подшивках: ,

Сразу с персистентностью на sqlite. Ingress ресурс и storage class поправьте под ваши нужды.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: vaultwarden
spec:
  selector:
    matchLabels:
      name: vaultwarden
      instance: test
  replicas: 1
  template:
    metadata:
      labels:
        name: vaultwarden
        instance: test
    spec:
      containers:
      - name: vaultwarden
        image: vaultwarden/server:latest
        ports:
        - name: vaultwarden
          containerPort: 80
        volumeMounts:
        - mountPath: /data
          name: data
        env:
        - name: WEBSOCKET_ENABLED
          value: "true"
        - name: ADMIN_TOKEN
          value: "some_admin_token"
        resources:
          limits:
            cpu: 100m
            memory: 200Mi
          requests:
            cpu: 50m
            memory: 50Mi
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: vaultwarden-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: vaultwarden-data
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: microk8s-hostpath
  volumeMode: Filesystem

---
apiVersion: v1
kind: Service
metadata:
  name: vaultwarden
spec:
  ports:
  - port: 80
    targetPort: vaultwarden
    protocol: TCP
    name: vaultwarden
  selector:
    name: vaultwarden
    instance: test
  type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    certmanager.k8s.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
  name: vaultwarden
spec:
  rules:
  - host: vaultwarden.home
    http:
      paths:
      - backend:
          service:
            name: vaultwarden
            port:
              name: vaultwarden
        path: /
        pathType: ImplementationSpecific

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Яндекс.Метрика

Fortune cookie: monotony, n.: Marriage to one woman at a time.