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`