File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ Following inputs can be used as `step.with` keys
49
49
| ` action ` | String | Determines if we ` install ` /` uninstall ` the chart, or ` list ` . (Optional, Defaults to ` install ` ) |
50
50
| ` dry-run ` | Boolean | Toggles ` dry-run ` option for ` install ` /` uninstall ` action. (Defaults to ` false ` ) |
51
51
| ` config-files ` | String | Comma separated list of helm values files. |
52
- | ` namespace ` | String | Kubernetes namespace to use. Will create if it does not exist |
52
+ | ` namespace ` | String | Kubernetes namespace to use. To create the namespace if it doesn't exist, also set ` create-namespace ` to ` true ` . |
53
+ | ` create-namespace ` | Boolean | Adds ` --create-namespace ` when set to ` true ` . Requires cluster API permissions. (Default: ` true ` ) |
53
54
| ` values ` | String | Comma separated list of value set for helms. e.x:` key1=value1,key2=value2 ` |
54
55
| ` name ` | String | The name of the helm release |
55
56
| ` chart-path ` | String | The path to the chart. (defaults to ` helm/ ` ) |
@@ -100,6 +101,7 @@ Following inputs can be used as `step.with` keys
100
101
config-files : fluent-bit/prod/values.yaml
101
102
chart-path : fluent/fluent-bit
102
103
namespace : logging
104
+ create-namespace : true
103
105
name : fluent-bit
104
106
chart-repository : https://fluent.github.io/helm-charts
105
107
version : 0.20.6
Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ inputs:
25
25
description : ' Comma separated list of helm values files.'
26
26
required : false
27
27
namespace :
28
- description : ' Kubernetes namespace to use. '
28
+ description : ' Kubernetes namespace to target. (default: "default") '
29
29
required : false
30
+ create-namespace :
31
+ description : ' Enable creating the namespace if it does not exist. Requires cluster API permissions.'
32
+ required : false
33
+ default : " true"
30
34
values :
31
35
description : ' Comma separated list of value sets for helms. e.x: key1=value1,key2=value2'
32
36
required : false
@@ -106,6 +110,7 @@ runs:
106
110
CLUSTER_ROLE_ARN : ${{ inputs.cluster-role-arn }}
107
111
DEPLOY_CONFIG_FILES : ${{ inputs.config-files }}
108
112
DEPLOY_NAMESPACE : ${{ inputs.namespace }}
113
+ CREATE_NAMESPACE : ${{ inputs.create-namespace }}
109
114
DEPLOY_VALUES : ${{ inputs.values }}
110
115
DEPLOY_NAME : ${{ inputs.name }}
111
116
DEPLOY_CHART_PATH : ${{ inputs.chart-path }}
Original file line number Diff line number Diff line change 126
126
if [ " ${HELM_ACTION} " == " install" ]; then
127
127
128
128
if [ -n " ${USE_SECRETS_VALS} " ]; then
129
- HELM_COMMAND=" helm secrets --backend vals --evaluate-templates true upgrade --install --create-namespace -- timeout ${TIMEOUT} ${HELM_AUTH} "
129
+ HELM_COMMAND=" helm secrets --backend vals --evaluate-templates true upgrade --install --timeout ${TIMEOUT} ${HELM_AUTH} "
130
130
else
131
131
# Upgrade or install the chart. This does it all.
132
- HELM_COMMAND=" helm upgrade --install --create-namespace -- timeout ${TIMEOUT} ${HELM_AUTH} "
132
+ HELM_COMMAND=" helm upgrade --install --timeout ${TIMEOUT} ${HELM_AUTH} "
133
133
fi
134
134
135
135
# If we should wait, then do so
@@ -181,6 +181,12 @@ if [ -n "$DEPLOY_NAMESPACE" ]; then
181
181
HELM_COMMAND=" ${HELM_COMMAND} -n ${DEPLOY_NAMESPACE} "
182
182
fi
183
183
184
+ # Create namespace if it doesn't exist. Requires cluster API permissions.
185
+ # Will conflict with `list`, so don't set if in list mode
186
+ if [ " ${CREATE_NAMESPACE} " == " true" ] && [ " ${HELM_ACTION} " != " list" ]; then
187
+ HELM_COMMAND=" ${HELM_COMMAND} --create-namespace"
188
+ fi
189
+
184
190
if [ " ${HELM_ACTION} " == " list" ]; then
185
191
if [ -n " $DEPLOY_NAME " ]; then
186
192
HELM_COMMAND=" ${HELM_COMMAND} --filter"
You can’t perform that action at this time.
0 commit comments