apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    meta.helm.sh/release-name: my-rhdh-helm
    meta.helm.sh/release-namespace: my-ns
  creationTimestamp: "2024-07-04T10:33:16Z"
  generation: 1
  labels:
    app.kubernetes.io/component: backstage
    app.kubernetes.io/instance: my-rhdh-helm
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: backstage
    helm.sh/chart: upstream-1.9.1
  name: my-rhdh-helm-backstage
  namespace: my-ns
  resourceVersion: "18076"
  uid: b5215eee-a8bf-4a04-aba8-665a45f7e4ee
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/component: backstage
      app.kubernetes.io/instance: my-rhdh-helm
      app.kubernetes.io/name: backstage
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        checksum/app-config: d7cd3b6a134f201d0af824bb9fd37b620dbe2a87e8cf1782548e12bff284f610
        checksum/dynamic-plugins: f1f9a92f14a31362d7eb30e67ac1458faf1c685765610f93a8967194d8bc1a5f
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: backstage
        app.kubernetes.io/instance: my-rhdh-helm
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: backstage
        helm.sh/chart: upstream-1.9.1
    spec:
      containers:
      - args:
        - --config
        - dynamic-plugins-root/app-config.dynamic-plugins.yaml
        - --config
        - /opt/app-root/src/app-config-from-configmap.yaml
        env:
        - name: APP_CONFIG_backend_listen_port
          value: "7007"
        - name: POSTGRES_HOST
          value: my-rhdh-helm-postgresql
        - name: POSTGRES_PORT
          value: "5432"
        - name: POSTGRES_USER
          value: bn_backstage
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: my-rhdh-helm-postgresql
        - name: BACKEND_SECRET
          valueFrom:
            secretKeyRef:
              key: backend-secret
              name: my-rhdh-helm-auth
        - name: POSTGRESQL_ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              key: postgres-password
              name: my-rhdh-helm-postgresql
        image: quay.io/rhdh/rhdh-hub-rhel9:1.2
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthcheck
            port: 7007
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2
        name: backstage-backend
        ports:
        - containerPort: 7007
          name: backend
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthcheck
            port: 7007
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 2
          timeoutSeconds: 2
        resources:
          limits:
            cpu: "1"
            ephemeral-storage: 5Gi
            memory: 2560Mi
          requests:
            cpu: 250m
            memory: 1Gi
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /opt/app-root/src/app-config-from-configmap.yaml
          name: backstage-app-config
          subPath: app-config.yaml
        - mountPath: /opt/app-root/src/dynamic-plugins-root
          name: dynamic-plugins-root
        - mountPath: /opt/app-root/src/packages/app/dist/static
          name: diststatic
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - ./install-dynamic-plugins.sh
        - /dynamic-plugins-root
        env:
        - name: NPM_CONFIG_USERCONFIG
          value: /opt/app-root/src/.npmrc.dynamic-plugins
        image: quay.io/rhdh/rhdh-hub-rhel9:1.2
        imagePullPolicy: Always
        name: install-dynamic-plugins
        resources:
          limits:
            cpu: "1"
            ephemeral-storage: 5Gi
            memory: 2560Mi
          requests:
            cpu: 250m
            memory: 256Mi
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /dynamic-plugins-root
          name: dynamic-plugins-root
        - mountPath: /opt/app-root/src/dynamic-plugins.yaml
          name: dynamic-plugins
          readOnly: true
          subPath: dynamic-plugins.yaml
        - mountPath: /opt/app-root/src/.npmrc.dynamic-plugins
          name: dynamic-plugins-npmrc
          readOnly: true
          subPath: .npmrc
        - mountPath: /opt/app-root/src/.npm/_cacache
          name: npmcacache
        workingDir: /opt/app-root/src
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: default
      serviceAccountName: default
      terminationGracePeriodSeconds: 30
      volumes:
      - ephemeral:
          volumeClaimTemplate:
            metadata:
              creationTimestamp: null
            spec:
              accessModes:
              - ReadWriteOnce
              resources:
                requests:
                  storage: 2Gi
              volumeMode: Filesystem
        name: dynamic-plugins-root
      - configMap:
          defaultMode: 420
          name: dynamic-plugins
          optional: true
        name: dynamic-plugins
      - name: dynamic-plugins-npmrc
        secret:
          defaultMode: 420
          optional: true
          secretName: dynamic-plugins-npmrc
      - emptyDir: {}
        name: npmcacache
      - emptyDir: {}
        name: diststatic
      - configMap:
          defaultMode: 420
          name: my-rhdh-helm-backstage-app-config
        name: backstage-app-config
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: "2024-07-04T10:36:41Z"
    lastUpdateTime: "2024-07-04T10:36:41Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2024-07-04T10:33:16Z"
    lastUpdateTime: "2024-07-04T10:36:41Z"
    message: ReplicaSet "my-rhdh-helm-backstage-5795ff5c9" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1
