|
| 1 | +{{- $replicaCount := int (.Values.replicaCount | default 1) }} |
| 2 | +{{- $cacheRepository := .Values.config.cacheRepository | required ".Values.config.cacheRepository is required." }} |
| 3 | +{{- $schematicServiceRepository := .Values.config.schematicServiceRepository | required ".Values.config.schematicServiceRepository is required." }} |
| 4 | +apiVersion: apps/v1 |
| 5 | +kind: Deployment |
| 6 | +metadata: |
| 7 | + name: {{ include "imageFactory.fullname" . }} |
| 8 | + namespace: {{ .Release.Namespace }} |
| 9 | + labels: |
| 10 | + {{- include "imageFactory.labels" . | nindent 4 }} |
| 11 | +spec: |
| 12 | + serviceName: {{ include "imageFactory.fullname" . }} |
| 13 | + replicas: {{ $replicaCount }} |
| 14 | + selector: |
| 15 | + matchLabels: |
| 16 | + {{- include "imageFactory.selectorLabels" . | nindent 6 }} |
| 17 | + template: |
| 18 | + metadata: |
| 19 | + {{- with .Values.podAnnotations }} |
| 20 | + annotations: |
| 21 | + {{- toYaml . | nindent 8 }} |
| 22 | + {{- end }} |
| 23 | + labels: |
| 24 | + {{- include "imageFactory.labels" . | nindent 8 }} |
| 25 | + {{- with .Values.podLabels }} |
| 26 | + {{- toYaml . | nindent 8 }} |
| 27 | + {{- end }} |
| 28 | + spec: |
| 29 | + {{- with .Values.imagePullSecrets }} |
| 30 | + imagePullSecrets: |
| 31 | + {{- toYaml . | nindent 8 }} |
| 32 | + {{- end }} |
| 33 | + serviceAccountName: {{ include "imageFactory.serviceAccountName" . }} |
| 34 | + securityContext: |
| 35 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 36 | + volumes: |
| 37 | + - name: secret |
| 38 | + secret: |
| 39 | + secretName: {{ include "imageFactory.secret" . }} |
| 40 | + containers: |
| 41 | + - name: image-factory |
| 42 | + securityContext: |
| 43 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 44 | + args: |
| 45 | + - -cache-repository={{ $cacheRepository }} |
| 46 | + - -cache-signing-key-path=/opt/image-factory/cache-signing-key.pem |
| 47 | + - -http-port=:8080 |
| 48 | + - -schematic-service-repository={{ $schematicServiceRepository }} |
| 49 | + {{- with .Values.config }} |
| 50 | + {{- if .assetBuilderMaxConcurrency }} |
| 51 | + - -asset-builder-max-concurrency={{ .assetBuilderMaxConcurrency }} |
| 52 | + {{- end }} |
| 53 | + {{- if .cacheCdnEnabled }} |
| 54 | + - -cache-cdn-enabled |
| 55 | + {{- end }} |
| 56 | + {{- if .cacheCdnHost }} |
| 57 | + - -cache-cdn-host={{ .cacheCdnHost }} |
| 58 | + {{- end }} |
| 59 | + {{- if .cacheCdnTrimPrefix }} |
| 60 | + - -cache-cdn-trim-prefix={{ .cacheCdnTrimPrefix }} |
| 61 | + {{- end }} |
| 62 | + {{- if .cacheS3Bucket }} |
| 63 | + - -cache-s3-bucket={{ .cacheS3Bucket }} |
| 64 | + {{- end }} |
| 65 | + {{- if .cacheS3Enabled }} |
| 66 | + - -cache-s3-enabled |
| 67 | + {{- end }} |
| 68 | + {{- if .cacheS3Endpoint }} |
| 69 | + - -cache-s3-endpoint={{ .cacheS3Endpoint }} |
| 70 | + {{- end }} |
| 71 | + {{- if .cacheS3Region }} |
| 72 | + - -cache-s3-region={{ .cacheS3Region }} |
| 73 | + {{- end }} |
| 74 | + {{- if .containerSignatureDisabled }} |
| 75 | + - -container-signature-disabled |
| 76 | + {{- end }} |
| 77 | + {{- if .containerSignatureIssuer }} |
| 78 | + - -container-signature-issuer={{ .containerSignatureIssuer }} |
| 79 | + {{- end }} |
| 80 | + {{- if .containerSignatureIssuerRegexp }} |
| 81 | + - -container-signature-issuer-regexp={{ .containerSignatureIssuerRegexp }} |
| 82 | + {{- end }} |
| 83 | + {{- if .containerSignaturePubkey }} |
| 84 | + - -container-signature-pubkey={{ .containerSignaturePubkey }} |
| 85 | + {{- end }} |
| 86 | + {{- if .containerSignaturePubkeyHashalgo }} |
| 87 | + - -container-signature-pubkey-hashalgo={{ .containerSignaturePubkeyHashalgo }} |
| 88 | + {{- end }} |
| 89 | + {{- if .containerSignatureSubjectRegexp }} |
| 90 | + - -container-signature-subject-regexp={{ .containerSignatureSubjectRegexp }} |
| 91 | + {{- end }} |
| 92 | + {{- if .externalPxeUrl }} |
| 93 | + - -external-pxe-url={{ .externalPxeUrl }} |
| 94 | + {{- end }} |
| 95 | + {{- if .externalUrl }} |
| 96 | + - -external-url={{ .externalUrl }} |
| 97 | + {{- end }} |
| 98 | + {{- if .imageRegistry }} |
| 99 | + - -image-registry={{ .imageRegistry }} |
| 100 | + {{- end }} |
| 101 | + {{- if .insecureCacheRepository }} |
| 102 | + - -insecure-cache-repository |
| 103 | + {{- end }} |
| 104 | + {{- if .insecureCacheS3 }} |
| 105 | + - -insecure-cache-s3 |
| 106 | + {{- end }} |
| 107 | + {{- if .insecureImageRegistry }} |
| 108 | + - -insecure-image-registry |
| 109 | + {{- end }} |
| 110 | + {{- if .insecureInstallerInternalRepository }} |
| 111 | + - -insecure-installer-internal-repository |
| 112 | + {{- end }} |
| 113 | + {{- if .insecureSchematicServiceRepository }} |
| 114 | + - -insecure-schematic-service-repository |
| 115 | + {{- end }} |
| 116 | + {{- if .installerExternalRepository }} |
| 117 | + - -installer-external-repository={{ .installerExternalRepository }} |
| 118 | + {{- end }} |
| 119 | + {{- if .installerInternalRepository }} |
| 120 | + - -installer-internal-repository={{ .installerInternalRepository }} |
| 121 | + {{- end }} |
| 122 | + {{- if .logLevel }} |
| 123 | + - -log-level={{ .logLevel }} |
| 124 | + {{- end }} |
| 125 | + {{- if .metricsListenAddr }} |
| 126 | + - -metrics-listen-addr={{ .metricsListenAddr }} |
| 127 | + {{- end }} |
| 128 | + {{- if .minTalosVersion }} |
| 129 | + - -min-talos-version={{ .minTalosVersion }} |
| 130 | + {{- end }} |
| 131 | + {{- if .registryRefreshInterval }} |
| 132 | + - -registry-refresh-interval={{ .registryRefreshInterval }} |
| 133 | + {{- end }} |
| 134 | + {{- if .secureboot }} |
| 135 | + - -secureboot |
| 136 | + {{- end }} |
| 137 | + {{- if .securebootAwsCertPath }} |
| 138 | + - -secureboot-aws-cert-path={{ .securebootAwsCertPath }} |
| 139 | + {{- end }} |
| 140 | + {{- if .securebootAwsKmsIdKeyId }} |
| 141 | + - -secureboot-aws-kms-id-key-id={{ .securebootAwsKmsIdKeyId }} |
| 142 | + {{- end }} |
| 143 | + {{- if .securebootAwsPcrKmsKeyId }} |
| 144 | + - -secureboot-aws-pcr-kms-key-id={{ .securebootAwsPcrKmsKeyId }} |
| 145 | + {{- end }} |
| 146 | + {{- if .securebootAwsRegion }} |
| 147 | + - -secureboot-aws-region={{ .securebootAwsRegion }} |
| 148 | + {{- end }} |
| 149 | + {{- if .securebootAzureCertificateName }} |
| 150 | + - -secureboot-azure-certificate-name={{ .securebootAzureCertificateName }} |
| 151 | + {{- end }} |
| 152 | + {{- if .securebootAzureKeyName }} |
| 153 | + - -secureboot-azure-key-name={{ .securebootAzureKeyName }} |
| 154 | + {{- end }} |
| 155 | + {{- if .securebootAzureKeyVaultUrl }} |
| 156 | + - -secureboot-azure-key-vault-url={{ .securebootAzureKeyVaultUrl }} |
| 157 | + {{- end }} |
| 158 | + {{- if .securebootPcrKeyPath }} |
| 159 | + - -secureboot-pcr-key-path={{ .securebootPcrKeyPath }} |
| 160 | + {{- end }} |
| 161 | + {{- if .securebootSigningCertPath }} |
| 162 | + - -secureboot-signing-cert-path={{ .securebootSigningCertPath }} |
| 163 | + {{- end }} |
| 164 | + {{- if .securebootSigningKeyPath }} |
| 165 | + - -secureboot-signing-key-path={{ .securebootSigningKeyPath }} |
| 166 | + {{- end }} |
| 167 | + {{- if .talosVersionsRecheckInterval }} |
| 168 | + - -talos-versions-recheck-interval={{ .talosVersionsRecheckInterval }} |
| 169 | + {{- end }} |
| 170 | + {{- end }} |
| 171 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 172 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 173 | + ports: |
| 174 | + - name: api |
| 175 | + containerPort: 8080 |
| 176 | + protocol: TCP |
| 177 | + resources: |
| 178 | + {{- toYaml .Values.resources | nindent 12 }} |
| 179 | + volumeMounts: |
| 180 | + - name: secret |
| 181 | + mountPath: /opt/image-factory |
| 182 | + {{- with .Values.nodeSelector }} |
| 183 | + nodeSelector: |
| 184 | + {{- toYaml . | nindent 8 }} |
| 185 | + {{- end }} |
| 186 | + {{- with .Values.affinity }} |
| 187 | + affinity: |
| 188 | + {{- toYaml . | nindent 8 }} |
| 189 | + {{- end }} |
| 190 | + {{- with .Values.tolerations }} |
| 191 | + tolerations: |
| 192 | + {{- toYaml . | nindent 8 }} |
| 193 | + {{- end }} |
0 commit comments