diff --git a/deploy/app/appconfigschema.yaml b/deploy/app/configschema.yaml similarity index 76% rename from deploy/app/appconfigschema.yaml rename to deploy/app/configschema.yaml index d3f55d5..37454f2 100644 --- a/deploy/app/appconfigschema.yaml +++ b/deploy/app/configschema.yaml @@ -1,13 +1,23 @@ 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 - type: bool + title: Use Youtube + type: enum + enum: + - "true" + - "false" category: Youtube + - name: MOPIDY_YOUTUBE_API_ENABLED + title: Use Youtube Data API + category: Youtube + type: enum + enum: + - "true" + - "false" - name: MOPIDY_YOUTUBE_API_KEY title: Youtube Data API Key type: password @@ -17,8 +27,11 @@ spec: Obtain it from https://console.cloud.google.com after creating an account and a project. - name: MOPIDY_YOUTUBE_MUSICAPI_ENABLED title: Use Youtube Music - type: bool category: Youtube + type: enum + enum: + - "true" + - "false" - name: MOPIDY_MPD_PASSWORD title: MPD password type: password diff --git a/deploy/app/defaults.yaml b/deploy/app/defaultconfig.yaml similarity index 77% rename from deploy/app/defaults.yaml rename to deploy/app/defaultconfig.yaml index 374d21b..ea17841 100644 --- a/deploy/app/defaults.yaml +++ b/deploy/app/defaultconfig.yaml @@ -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}-defaultconfig stringData: MOPIDY_MPD_PASSWORD: generate MOPIDY_YOUTUBE_ENABLED: "true" diff --git a/deploy/app/deployment-patch.yaml b/deploy/app/deployment-patch.yaml index 9f466cb..f8d81b1 100644 --- a/deploy/app/deployment-patch.yaml +++ b/deploy/app/deployment-patch.yaml @@ -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}-defaultconfig + - secretRef: + name: ${APP_CONFIG_SECRET_NAME:=app-defaultconfig} diff --git a/deploy/app/kustomization.yaml b/deploy/app/kustomization.yaml index 9311c81..1102d23 100644 --- a/deploy/app/kustomization.yaml +++ b/deploy/app/kustomization.yaml @@ -1,7 +1,7 @@ namespace: kubemate resources: -- appconfigschema.yaml -- defaults.yaml +- configschema.yaml +- defaultconfig.yaml - ../default patchesStrategicMerge: - deployment-patch.yaml diff --git a/deploy/base/deployment.yaml b/deploy/base/deployment.yaml index ac62e64..9c22862 100644 --- a/deploy/base/deployment.yaml +++ b/deploy/base/deployment.yaml @@ -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