--- # Copyright 2020 VEXXHOST, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: apps/v1 kind: Deployment metadata: name: horizon-{{ name }} labels: {{ labels("horizon", name) | indent(4) }} annotations: checksum/config: "{{ config_hash }}" spec: replicas: 3 selector: matchLabels: {{ labels("horizon", name) | indent(6) }} template: metadata: labels: {{ labels("horizon", name) | indent(8) }} spec: containers: - name: horizon image: vexxhost/horizon:latest imagePullPolicy: Always env: {% for v in env %} - name: "{{ v.name }}" value: "{{ v.value }}" {% endfor %} - name: SECRET_KEY valueFrom: secretKeyRef: key: secret_key name: horizon-{{ name }} ports: - name: horizon containerPort: 8000 livenessProbe: tcpSocket: port: horizon readinessProbe: tcpSocket: port: horizon resources: limits: cpu: 1000m ephemeral-storage: 500M memory: 256M requests: cpu: 500m ephemeral-storage: 500M memory: 128M securityContext: runAsUser: 1001 volumeMounts: - mountPath: /etc/horizon name: config volumes: - configMap: defaultMode: 420 name: horizon-{{ name }} name: config {% if 'nodeSelector' in spec %} nodeSelector: {{ spec.nodeSelector | to_yaml | indent(8) }} {% endif %} {% if 'tolerations' in spec %} tolerations: {{ spec.tolerations | to_yaml | indent(8) }} {% endif %}