Skip to content

Commit e7895b3

Browse files
Generate multiple set values commands (#59)
* Generate separate set values commands * Add value sanity checks and usage example
1 parent fff921c commit e7895b3

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,33 @@ The following inputs are available as `step.with` keys:
192192
... (put your other arguments here)
193193
```
194194

195+
## Example 8 - Use a different role in the Action than the role the cluster was built with
196+
197+
**action.yaml**
198+
```yaml
199+
- name: Install Karpenter
200+
uses: bitovi/github-actions-deploy-eks-helm
201+
with:
202+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
203+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
204+
aws-region: ${{ vars.AWS_REGION }}
205+
cluster-name: ${{ vars.CLUSTER_NAME }}
206+
cluster-role-arn: ${{ secrets.AWS_ROLE_ARN }}
207+
chart-repository: oci://public.ecr.aws
208+
chart-path: karpenter/karpenter
209+
helm-wait: true
210+
namespace: karpenter
211+
name: karpenter
212+
values: |
213+
settings.clusterName=${{ vars.CLUSTER_NAME }},
214+
settings.interruptionQueue=${{ vars.CLUSTER_NAME }}-karpenter,
215+
controller.resources.requests.cpu=1,
216+
controller.resources.requests.memory=1Gi,
217+
controller.resources.limits.cpu=1,
218+
controller.resources.limits.memory=1Gi
219+
version: 1.0.6
220+
```
221+
195222
**terraform.tf**
196223
```yaml
197224
... (surrounding code)

deploy.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,20 @@ if [ "${HELM_ACTION}" == "install" ]; then
148148
done
149149

150150
if [ -n "$DEPLOY_VALUES" ]; then
151-
HELM_COMMAND="${HELM_COMMAND} --set ${DEPLOY_VALUES}"
151+
for value in ${DEPLOY_VALUES//,/ }
152+
do
153+
if [[ -z "$value" ]]; then
154+
echo "Warning: Empty value detected, skipping."
155+
continue
156+
elif [[ "$value" != *"="* ]]; then
157+
echo "Warning: Value '$value' does not contain an '=' sign, skipping."
158+
continue
159+
elif [[ "$value" =~ [[:space:]] ]]; then
160+
echo "Warning: Value '$value' contains whitespace, skipping."
161+
continue
162+
fi
163+
HELM_COMMAND="${HELM_COMMAND} --set ${value}"
164+
done
152165
fi
153166

154167
if [ -n "$VERSION" ]; then

0 commit comments

Comments
 (0)