---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: it-tools
spec:
  interval: 30m
  chart:
    spec:
      chart: app-template
      version: 3.5.1
      interval: 30m
      sourceRef:
        kind: HelmRepository
        name: bjw-s
        namespace: flux-system

  values:
    controllers:
      it-tools:
        replicas: 1
        strategy: RollingUpdate
        annotations:
          reloader.stakater.com/auto: "true"
        pod:
          securityContext:
            runAsUser: 101
            runAsGroup: 101
            fsGroup: 101
            fsGroupChangePolicy: "OnRootMismatch"
        containers:
          app:
            image:
              repository: ghcr.io/bjw-s-labs/it-tools
              tag: 2024.5.13
            resources:
              requests:
                cpu: 5m
                memory: 32Mi
              limits:
                memory: 256Mi
            securityContext:
              allowPrivilegeEscalation: false
              readOnlyRootFilesystem: true
              capabilities:
                drop:
                  - ALL
    service:
      app:
        controller: it-tools
        ports:
          http:
            port: 8080
    ingress:
      app:
        enabled: true
        className: external-nginx
        annotations:
          external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
          external-dns.alpha.kubernetes.io/target: external.hsn.dev

        hosts:
          - host: &host tools.hsn.dev
            paths:
              - path: /
                service:
                  identifier: app
                  port: http
        tls:
          - hosts:
              - *host

    persistence:
      tmp:
        type: emptyDir