Skip to content

Commit

Permalink
fix(app kustomization): don't mix vars & setters
Browse files Browse the repository at this point in the history
* Don't use kpt setters and FluxCD variables within the same field, see kptdev/kpt#3965.
* Bind the default Secret in addition to the user-defined one in order to update the app's default configuration along with the rest of the manifest.
  • Loading branch information
mgoltzsche committed May 17, 2023
1 parent 882e706 commit 756b629
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
8 changes: 6 additions & 2 deletions deploy/app/appconfigschema.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
apiVersion: apps.kubemate.mgoltzsche.github.com/v1alpha1
kind: AppConfigSchema
metadata:
name: mopidy # kpt-set: ${name}
name: ${APP_NAME:=app}
spec:
params:
- name: MOPIDY_YOUTUBE_ENABLED
title: Use the Youtube Data API
title: Use Youtube
type: bool
category: Youtube
- name: MOPIDY_YOUTUBE_API_ENABLED
title: Use Youtube Data API
type: bool
category: Youtube
- name: MOPIDY_YOUTUBE_API_KEY
Expand Down
4 changes: 1 addition & 3 deletions deploy/app/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: mopidy-defaults # kpt-set: ${name}-defaults
annotations:
kubemate.mgoltzsche.github.com/default-config: "true"
name: ${APP_NAME:=app}-defaults
stringData:
MOPIDY_MPD_PASSWORD: generate
MOPIDY_YOUTUBE_ENABLED: "true"
Expand Down
4 changes: 3 additions & 1 deletion deploy/app/deployment-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ spec:
- name: app
envFrom:
- secretRef:
name: ${APP_CONFIG_SECRET_NAME:=mopidy-defaults} # kpt-set: ${APP_CONFIG_SECRET_NAME:=${name}-defaults}
name: ${APP_NAME:=app}-defaults
- secretRef:
name: ${APP_CONFIG_SECRET_NAME:=app-defaults}
17 changes: 0 additions & 17 deletions deploy/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ spec:
- name: app
image: ghcr.io/mgoltzsche/mopidy:0.5.1 # kpt-set: ${image}:${version}
imagePullPolicy: IfNotPresent
env:
- name: MOPIDY_YOUTUBE_ENABLED
value: "true"
- name: MOPIDY_YOUTUBE_API_ENABLED
value: "true"
- name: MOPIDY_YOUTUBE_API_KEY
value: ""
- name: MOPIDY_YOUTUBE_MUSICAPI_ENABLED
value: "false"
- name: MOPIDY_YOUTUBE_MUSICAPI_COOKIE
value: ""
- name: MOPIDY_YOUTUBE_MUSICAPI_CHANNEL
value: UCYwjcFiUg8PpWM45vpBUc3Q
- name: MOPIDY_YOUTUBE_MAX_SEARCH_RESULTS
value: "15"
- name: MOPIDY_YOUTUBE_MAX_VIDEOS
value: "20"
resources:
limits:
cpu: 200m
Expand Down

0 comments on commit 756b629

Please sign in to comment.