From fd3f0dd9c8212676a101ef2ad16a54534e950747 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Wed, 17 Jul 2024 11:31:28 +0200 Subject: [PATCH] Add support for custom arguments for the cloud-controller-manager --- class/defaults.yml | 2 ++ component/main.jsonnet | 15 ++++++++++++--- .../ROOT/pages/references/parameters.adoc | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/class/defaults.yml b/class/defaults.yml index ac9c956..fc2ca91 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -5,4 +5,6 @@ parameters: manifests_version: 1.0.0 + args: [] + api_token: ?{vaultkv:${cluster:tenant}/${cluster:name}/cloudscale/token} diff --git a/component/main.jsonnet b/component/main.jsonnet index a01a569..2a411a9 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -13,15 +13,24 @@ local manifests = std.parseJson( ); local patchDaemonset(obj) = - if isOpenShift && obj.kind == 'DaemonSet' then + if obj.kind == 'DaemonSet' then obj { spec+: { template+: { spec+: { - nodeSelector: { + containers: [ + if c.name == 'cloudscale-cloud-controller-manager' then + c { + command+: params.args, + } + else + c + for c in super.containers + ], + [if isOpenShift then 'nodeSelector']: { 'node-role.kubernetes.io/master': '', }, - tolerations+: [ + [if isOpenShift then 'tolerations']+: [ { key: 'node-role.kubernetes.io/master', effect: 'NoSchedule', diff --git a/docs/modules/ROOT/pages/references/parameters.adoc b/docs/modules/ROOT/pages/references/parameters.adoc index 8490f23..3583124 100644 --- a/docs/modules/ROOT/pages/references/parameters.adoc +++ b/docs/modules/ROOT/pages/references/parameters.adoc @@ -10,6 +10,22 @@ default:: `syn-cloudscale-cloud-controller-manager` The namespace in which to deploy this component. +== `manifests_version` + +[horizontal] +type:: string +defaults:: [See `class/defaults.yml`] + +The cloudscale CCM version to deploy. + +== `args` + +[horizontal] +type:: list +defaults:: `[]` + +Additional arguments to provide to the cloudscale CCM. +The contents of this parameter are appended to the upstream manifest verbatim. == `api_token`