Skip to content

Commit

Permalink
DM-45394 mobu: Config from a single YAML configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
fajpunk committed Nov 8, 2024
1 parent 189e8ee commit fd99151
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 90 deletions.
7 changes: 4 additions & 3 deletions applications/mobu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Continuous integration testing
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity rules for the mobu frontend pod |
| config.autostart | list | `[]` | Autostart specification. Must be a list of mobu flock specifications. Each flock listed will be automatically started when mobu is started. |
| config.debug | bool | `false` | If set to true, include the output from all flocks in the main mobu log and disable structured JSON logging. |
| config.githubCiApp | object | disabled. | Configuration for the GitHub refresh app integration. See https://mobu.lsst.io/operations/github_ci_app.html#add-phalanx-configuration |
| config.githubRefreshApp | object | disabled. | Configuration for the GitHub refresh app integration. See https://mobu.lsst.io/operations/github_refresh_app.html#add-phalanx-configuration |
| config.githubCiApp | string | disabled. | Configuration for the GitHub refresh app integration. See https://mobu.lsst.io/operations/github_ci_app.html#add-phalanx-configuration |
| config.githubRefreshApp | string | disabled. | Configuration for the GitHub refresh app integration. See https://mobu.lsst.io/operations/github_refresh_app.html#add-phalanx-configuration |
| config.logLevel | string | `"INFO"` | Log level. Set to 'DEBUG' to include the output from all flocks in the main mobu log. |
| config.pathPrefix | string | `"/mobu"` | Prefix for mobu's API routes. |
| config.profile | string | `"production"` | One of 'production' or 'development'. 'production' configures structured JSON logging, and 'development' configures unstructured human readable logging. |
| config.slackAlerts | bool | `true` | Whether to send alerts and status to Slack. |
| fullnameOverride | string | `""` | Override the full name for resources (includes the release name) |
| global.baseUrl | string | Set by Argo CD | Base URL for the environment |
Expand Down
11 changes: 0 additions & 11 deletions applications/mobu/templates/configmap-autostart.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions applications/mobu/templates/configmap-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "mobu.fullname" . }}-config
labels:
{{- include "mobu.labels" . | nindent 4 }}
data:
config.yaml: |
{{- toYaml .Values.config | nindent 4 }}
11 changes: 0 additions & 11 deletions applications/mobu/templates/configmap-github-ci-app.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions applications/mobu/templates/configmap-github-refresh-app.yaml

This file was deleted.

48 changes: 5 additions & 43 deletions applications/mobu/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ spec:
type: "Recreate"
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
# Force the pod to restart when the config map is updated.
checksum/config: {{ include (print $.Template.BasePath "/configmap-config.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand All @@ -31,10 +33,6 @@ spec:
name: {{ template "mobu.fullname" . }}-secret
key: "ALERT_HOOK"
{{- end }}
{{- if .Values.config.autostart }}
- name: "MOBU_AUTOSTART_PATH"
value: "/etc/mobu/autostart.yaml"
{{- end }}
- name: "MOBU_ENVIRONMENT_URL"
value: {{ .Values.global.baseUrl }}
- name: "MOBU_GAFAELFAWR_TOKEN"
Expand All @@ -43,17 +41,13 @@ spec:
name: {{ template "mobu.fullname" . }}-gafaelfawr-token
key: "token"
{{- if .Values.config.githubRefreshApp }}
- name: "MOBU_GITHUB_REFRESH_APP_CONFIG_PATH"
value: "/etc/mobu/github-refresh-app.yaml"
- name: "MOBU_GITHUB_REFRESH_APP_WEBHOOK_SECRET"
valueFrom:
secretKeyRef:
name: {{ template "mobu.fullname" . }}-secret
key: "github-refresh-app-webhook-secret"
{{- end}}
{{- if .Values.config.githubCiApp }}
- name: "MOBU_GITHUB_CI_APP_CONFIG_PATH"
value: "/etc/mobu/github-ci-app.yaml"
- name: "MOBU_GITHUB_CI_APP_ID"
valueFrom:
secretKeyRef:
Expand All @@ -70,17 +64,6 @@ spec:
name: {{ template "mobu.fullname" . }}-secret
key: "github-ci-app-webhook-secret"
{{- end}}
- name: "MOBU_PATH_PREFIX"
value: {{ .Values.config.pathPrefix | quote }}
{{- if .Values.config.debug }}
- name: "MOBU_LOGGING_PROFILE"
value: "development"
- name: "MOBU_LOG_LEVEL"
value: "DEBUG"
{{- else }}
- name: "MOBU_LOGGING_PROFILE"
value: "production"
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
ports:
Expand Down Expand Up @@ -114,29 +97,8 @@ spec:
runAsGroup: 1000
volumes:
- name: "config"
projected:
sources:
{{- if .Values.config.autostart }}
- configMap:
name: {{ include "mobu.fullname" . }}-autostart
items:
- key: autostart.yaml
path: autostart.yaml
{{- end }}
{{- if .Values.config.githubCiApp }}
- configMap:
name: {{ include "mobu.fullname" . }}-github-ci-app
items:
- key: github-ci-app.yaml
path: github-ci-app.yaml
{{- end }}
{{- if .Values.config.githubRefreshApp }}
- configMap:
name: {{ include "mobu.fullname" . }}-github-refresh-app
items:
- key: github-refresh-app.yaml
path: github-refresh-app.yaml
{{- end }}
configMap:
name: "mobu-config"
- name: "tmp"
emptyDir: {}
{{- with .Values.nodeSelector }}
Expand Down
3 changes: 2 additions & 1 deletion applications/mobu/values-idfdemo.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config:
debug: true
logLevel: DEBUG
profile: development
autostart: []
3 changes: 2 additions & 1 deletion applications/mobu/values-idfdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ image:
tag: "tickets-DM-44145-app-metrics"
pullPolicy: "Always"
config:
debug: true
logLevel: DEBUG
profile: development
githubRefreshApp:
acceptedGithubOrgs:
- lsst-sqre
Expand Down
3 changes: 2 additions & 1 deletion applications/mobu/values-roundtable-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config:
debug: true
logLevel: DEBUG
profile: development
autostart:
- name: "gitlfs"
count: 1
Expand Down
3 changes: 2 additions & 1 deletion applications/mobu/values-usdfdev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config:
debug: true
logLevel: DEBUG
profile: development
githubRefreshApp:
acceptedGithubOrgs:
- lsst-sqre
Expand Down
1 change: 0 additions & 1 deletion applications/mobu/values-usdfint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
config:
debug: true
githubRefreshApp:
acceptedGithubOrgs:
- lsst-sqre
Expand Down
1 change: 0 additions & 1 deletion applications/mobu/values-usdfprod.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
config:
debug: true
autostart:
- name: "firefighter"
count: 1
Expand Down
15 changes: 10 additions & 5 deletions applications/mobu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ config:
# -- Configuration for the GitHub refresh app integration.
# See https://mobu.lsst.io/operations/github_refresh_app.html#add-phalanx-configuration
# @default -- disabled.
githubRefreshApp: {}
githubRefreshApp: null

# -- Configuration for the GitHub CI app integration.
# -- Configuration for the GitHub refresh app integration.
# See https://mobu.lsst.io/operations/github_ci_app.html#add-phalanx-configuration
# @default -- disabled.
githubCiApp: {}
githubCiApp: null

# -- If set to true, include the output from all flocks in the main mobu log
# and disable structured JSON logging.
debug: false
# -- Log level. Set to 'DEBUG' to include the output from all flocks in the
# main mobu log.
logLevel: INFO

# -- One of 'production' or 'development'. 'production' configures structured
# JSON logging, and 'development' configures unstructured human readable
# logging.
profile: production

# -- Whether to send alerts and status to Slack.
slackAlerts: true
Expand Down

0 comments on commit fd99151

Please sign in to comment.