Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 0 additions & 176 deletions chart/templates/controller.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions chart/templates/controller/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: vela-controller-config
data:
VELA_ROOT_PATH: {{ .Values.controller.env.VELA_ROOT_PATH | quote }}
VELA_JWT_SECRET: {{ .Values.controller.env.VELA_JWT_SECRET | quote }}
VELA_GATEWAY_NAME: {{ .Values.gateway.name | quote }}
VELA_GATEWAY_NAMESPACE: {{ .Values.gateway.namespace | quote }}
VELA_PGMETA_CRYPTO_KEY: {{ .Values.controller.env.VELA_PGMETA_CRYPTO_KEY | quote }}
VELA_CORS_ORIGINS: {{ .Values.controller.env.VELA_CORS_ORIGINS | quote }}
VELA_KEYCLOAK_URL: {{ .Values.controller.env.VELA_KEYCLOAK_URL | quote }}
VELA_KEYCLOAK_ADMIN_NAME: {{ .Values.controller.env.VELA_KEYCLOAK_ADMIN_NAME | quote }}
VELA_KEYCLOAK_ADMIN_SECRET: {{ .Values.controller.env.VELA_KEYCLOAK_ADMIN_SECRET | quote }}
VELA_CLOUDFLARE__API_TOKEN: {{ .Values.controller.env.VELA_CLOUDFLARE_API_TOKEN | quote }}
VELA_CLOUDFLARE__ZONE_ID: {{ .Values.controller.env.VELA_CLOUDFLARE_ZONE_ID | quote }}
VELA_CLOUDFLARE__BRANCH_REF: {{ .Values.controller.env.VELA_BRANCH_REF | quote }}
VELA_CLOUDFLARE__BRANCH_DB_REF: {{ .Values.controller.env.VELA_BRANCH_DB_REF | quote }}
VELA_CLOUDFLARE__DOMAIN_SUFFIX: {{ .Values.domainSuffix | default .Values.domain | quote }}
VELA_DEPLOYMENT_NAMESPACE_PREFIX: {{ .Values.controller.env.VELA_DEPLOYMENT_NAMESPACE_PREFIX | quote }}
VELA_DEPLOYMENT_SERVICE_PORT: {{ .Values.port | quote }}
VELA_SERVER_ROOT_URL: "https://{{ .Values.domain }}:{{ .Values.port }}"
VELA_ENABLE_DB_EXTERNAL_IPV6_LOADBALANCER: {{ .Values.controller.env.VELA_ENABLE_DB_EXTERNAL_IPV6_LOADBALANCER | quote }}
VELA_GRAFANA_URL: {{ .Values.controller.env.VELA_GRAFANA_URL | quote }}
VELA_SIMPLYBLOCK_CSI_NAMESPACE: {{ .Values.controller.env.VELA_SIMPLYBLOCK_CSI_NAMESPACE | quote }}
88 changes: 88 additions & 0 deletions chart/templates/controller/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vela-controller
labels:
app.kubernetes.io/name: vela-controller
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: vela-controller
template:
metadata:
labels:
app.kubernetes.io/name: vela-controller
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: vela-controller
initContainers:
{{ include "vela.waitForPostgresInitContainer" (dict) | nindent 8 }}
containers:
- name: vela-controller
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
imagePullPolicy: Always
ports:
- name: http
containerPort: 8000
protocol: TCP
envFrom:
- configMapRef:
name: vela-controller-config
env:
- name: VELA_GRAFANA_SECURITY_ADMIN_USER
valueFrom:
secretKeyRef:
name: vela-grafana-secret
key: VELA_GRAFANA_SECURITY_ADMIN_USER
- name: VELA_GRAFANA_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: vela-grafana-secret
key: VELA_GRAFANA_SECURITY_ADMIN_PASSWORD
- name: DB_USER
valueFrom:
secretKeyRef:
name: database
key: superuser-username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: database
key: superuser-password
- name: VELA_DEPLOYMENT_PASSWORD_SECRET
valueFrom:
secretKeyRef:
name: vela-controller-secret
key: deployment-password-secret
- name: DB_HOST
value: database
- name: VELA_POSTGRES_URL
value: 'postgresql+asyncpg://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):5432/postgres'
- name: VELA_GRAFANA_URL
value: "https://{{ .Values.domain }}:{{ .Values.port }}/grafana"
- name: VELA_BROKER_URL
value: 'sqla+postgresql+psycopg://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):5432/postgres'
- name: VELA_RESULT_BACKEND
value: 'db+postgresql+psycopg://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):5432/postgres'
livenessProbe:
httpGet:
path: /health
port: http
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
18 changes: 18 additions & 0 deletions chart/templates/controller/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: vela-controller
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: vela-controller-{{ .Release.Namespace }}-admin
subjects:
- kind: ServiceAccount
name: vela-controller
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
12 changes: 12 additions & 0 deletions chart/templates/controller/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: vela-controller-secret
type: Opaque
data:
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace "vela-controller-secret" }}
{{- if $existingSecret }}
deployment-password-secret: {{ index $existingSecret.data "deployment-password-secret" }}
{{- else }}
deployment-password-secret: {{ randAlphaNum 32 | b64enc }}
{{- end }}
33 changes: 33 additions & 0 deletions chart/templates/controller/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: Service
metadata:
name: vela-controller-service
spec:
selector:
app.kubernetes.io/name: vela-controller
ports:
- name: http
port: 8000
targetPort: 8000
protocol: TCP

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: vela-controller
spec:
parentRefs:
- name: {{ .Values.gateway.name }}
namespace: {{ .Values.gateway.namespace }}
hostnames:
- "{{ .Values.domain }}"
rules:
- matches:
- path:
type: PathPrefix
value: /vela
backendRefs:
- name: vela-controller-service
namespace: {{ .Release.Namespace }}
port: 8000
Loading
Loading