github.com/sealerio/sealer@v0.11.1-0.20240507115618-f4f89c5853ae/build/kubefile/parser/test/brigade-github-app/templates/deployment.yaml (about)

     1  # Copyright © 2022 Alibaba Group Holding Ltd.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  {{ $fullname :=  include "gateway.fullname" . }}
    16  {{ $serviceAccount := default $fullname .Values.serviceAccount.name }}
    17  apiVersion: {{ template "deployment.apiVersion" . }}
    18  kind: Deployment
    19  metadata:
    20    name: {{ $fullname }}
    21    labels:
    22      app: {{ $fullname }}
    23      chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    24      release: "{{ .Release.Name }}"
    25      heritage: "{{ .Release.Service }}"
    26      role: gateway
    27      type: github-app
    28  spec:
    29    replicas: 1
    30    selector:
    31      matchLabels:
    32        app: {{ $fullname }}
    33        role: gateway
    34        release: "{{ .Release.Name }}"
    35        type: github-app
    36    template:
    37      metadata:
    38      {{- if .Values.podAnnotations }}
    39        annotations:
    40  {{ toYaml .Values.podAnnotations | indent 8}}
    41      {{- end }}
    42        labels:
    43          app: {{ $fullname }}
    44          role: gateway
    45          release: "{{ .Release.Name }}"
    46          type: github-app
    47      spec:
    48        serviceAccountName: {{ $serviceAccount }}
    49        containers:
    50        - name: {{ .Chart.Name }}
    51          image: "{{ .Values.registry }}/{{ .Values.name }}:{{ default .Chart.AppVersion .Values.tag }}"
    52          imagePullPolicy: {{ default "IfNotPresent" .Values.pullPolicy }}
    53          env:
    54            - name: BRIGADE_NAMESPACE
    55              valueFrom:
    56                fieldRef:
    57                  fieldPath: metadata.namespace
    58            - name: BRIGADE_AUTHORS
    59              value: {{ if .Values.gateway.allowedAuthorRoles }}{{ join "," .Values.gateway.allowedAuthorRoles | quote }}{{ end }}
    60            - name: BRIGADE_EVENTS
    61              value: {{ if .Values.gateway.emittedEvents }}{{ join "," .Values.gateway.emittedEvents | quote }}{{ end }}
    62            - name: GATEWAY_CONFIG
    63              value: "/etc/brigade-github-app/key.pem"
    64            - name: APP_ID
    65              value: "{{ .Values.github.appID }}"
    66            - name: CHECK_SUITE_ON_PR
    67              value: "{{ .Values.github.checkSuiteOnPR }}"
    68            {{- if .Values.github.defaultSharedSecret }}
    69            - name: DEFAULT_SHARED_SECRET
    70              valueFrom:
    71                secretKeyRef:
    72                  name: {{ $fullname }}
    73                  key: defaultSharedSecret
    74            {{- end }}
    75          volumeMounts:
    76            - name: github-config
    77              mountPath: /etc/brigade-github-app
    78        volumes:
    79          - name: github-config
    80            secret:
    81              secretName: {{ $fullname }}