mirror of
https://github.com/puppetlabs/vmpooler-deployment.git
synced 2026-01-26 03:28:41 -05:00
126 lines
4 KiB
YAML
126 lines
4 KiB
YAML
{{- $fullName := include "vmpooler.fullname" . -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ $fullName }}-api
|
|
labels:
|
|
app: {{ $fullName }}-api
|
|
redis-client: "true"
|
|
{{- include "vmpooler.labels" . | nindent 4 }}
|
|
test: liveness
|
|
annotations:
|
|
configmap.reloader.stakater.com/reload: "{{ .Values.configmapName }},vmpooler-pools"
|
|
secret.reloader.stakater.com/reload: 'redis'
|
|
spec:
|
|
replicas: {{ .Values.api.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ $fullName }}-api
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ $fullName }}-api
|
|
{{- with .Values.api.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "vmpooler.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ $fullName }}-api
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: {{ .Values.service.port }}
|
|
resources:
|
|
{{- toYaml .Values.api.resources | nindent 12 }}
|
|
args:
|
|
- 'api'
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api/v1/status
|
|
port: {{ .Values.service.port }}
|
|
initialDelaySeconds: 40
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api/v1/status
|
|
port: {{ .Values.service.port }}
|
|
initialDelaySeconds: 40
|
|
periodSeconds: 10
|
|
env:
|
|
- name: JRUBY_OPTS
|
|
value: '{{ .Values.jruby_opts }}'
|
|
- name: PORT
|
|
value: {{ .Values.service.port | quote }}
|
|
- name: SITE_NAME
|
|
value: '<b>{{ .Values.vmpoolerInstance }}</b>.{{ .Values.ingress.domain }}'
|
|
- name: DOMAIN
|
|
value: {{ .Values.sut_domain }}
|
|
- name: EXPERIMENTAL_FEATURES
|
|
value: 'true'
|
|
- name: USAGE_STATS
|
|
value: '{{ .Values.usage_stats }}'
|
|
- name: VMPOOLER_CONFIG_FILE
|
|
value: /etc/vmpooler/vmpooler.yaml
|
|
- name: VMPOOLER_TRACING_ENABLED
|
|
value: '{{ .Values.tracing.enabled }}'
|
|
- name: VMPOOLER_TRACING_JAEGER_HOST
|
|
value: '{{ .Values.tracing.jaegerHost }}'
|
|
- name: EXTRA_CONFIG
|
|
value: '{{ .Values.additionalConfigFiles }}'
|
|
- name: REDIS_SERVER
|
|
value: 'redis-master'
|
|
- name: ONDEMAND_REQUEST_TTL
|
|
value: '{{ .Values.ondemand_request_ttl }}'
|
|
- name: ONDEMAND_CLONE_LIMIT
|
|
value: '{{ .Values.ondemand_clone_limit }}'
|
|
- name: MAX_LIFETIME_UPPER_LIMIT
|
|
value: '{{ .Values.max_lifetime_upper_limit }}'
|
|
- name: VM_LIFETIME
|
|
value: '{{ .Values.vm_lifetime }}'
|
|
- name: VM_LIFETIME_AUTH
|
|
value: '{{ .Values.vm_lifetime_auth }}'
|
|
- name: REDIS_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: redis
|
|
key: redis-password
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /etc/vmpooler
|
|
- name: pools-config
|
|
mountPath: /etc/vmpooler/config
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: {{ .Values.configmapName }}
|
|
items:
|
|
- key: vmpooler.yaml
|
|
path: vmpooler.yaml
|
|
- name: pools-config
|
|
configMap:
|
|
name: {{ .Values.poolsConfigMapName }}
|
|
items:
|
|
- key: pools.yaml
|
|
path: pools.yaml
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|