apiVersion: apps/v1
kind: Deployment
metadata:
  name: devtool
spec:
  replicas: 1
  selector:
    matchLabels:
      app: devtool
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: devtool
    spec:
      containers:
        - name: devtool
          image: ghcr.io/eve0415/devtool
          imagePullPolicy: Always
          securityContext:
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - NET_RAW
          resources:
            limits:
              memory: 256M
              cpu: 500m
          env:
            - name: DISCORD_TOKEN
              valueFrom:
                secretKeyRef:
                  name: discord
                  key: token
          readinessProbe:
            httpGet:
              path: /healtz
              port: 8080
            failureThreshold: 1
            initialDelaySeconds: 5
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 5
          livenessProbe:
            httpGet:
              path: /healtz
              port: 8080
            failureThreshold: 3
            initialDelaySeconds: 10
            periodSeconds: 30
            successThreshold: 1
            timeoutSeconds: 5
