Skip to content

Instantly share code, notes, and snippets.

@kholisrag
Created July 2, 2024 09:49
Show Gist options
  • Save kholisrag/dbfbc8e4d23963a1df3bbbcc7d926f21 to your computer and use it in GitHub Desktop.
Save kholisrag/dbfbc8e4d23963a1df3bbbcc7d926f21 to your computer and use it in GitHub Desktop.
script to integrate helm post-renderer using helmfile + kubectl apply -k / kustomize
---
helmfiles:
- "../controller/helmfile.yaml"
repositories:
- name: ghcr-actions
url: ghcr.io/actions/actions-runner-controller-charts
oci: true
releases:
- name: "lk6-ci-runners"
namespace: "ci-runners"
chart: ghcr-actions/gha-runner-scale-set
version: 0.9.3
kubeContext: "gke_laku6-ci_asia-southeast1_ci-cluster"
values:
- ./values.yaml
- githubConfigSecret:
github_token: "{{ requiredEnv "ARC_GITHUB_TOKEN" }}"
- runnerGroup: "lk6-ci-runners"
- minRunners: 10
- maxRunners: 100
- template:
spec:
automountServiceAccountToken: true
serviceAccount: runner-access
serviceAccountName: runner-access
hooks:
- events: ["presync"]
showlogs: true
command: "kubectl"
args:
- "apply"
- "-f"
- "./presync"
# patch helm using --post-renderer flags
postRenderer: "./kustomize"
#!/bin/bash
cat <&0 > ./all.yaml
mkdir -p ./temp
cp ./all.yaml ./temp
cp kustomization.yaml ./temp
kubectl apply -k ./temp --dry-run=client -o yaml
rm -rf ./all.yaml
rm -rf ./temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment