Skip to content

Commit

Permalink
Some helm chart fixes and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emil-jacero committed Aug 22, 2024
1 parent e42846e commit 2fdd9a1
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ coverage*
random/*
concatenated_output.txt
.DS_Store
output.log
output.log
kode*.tgz
2 changes: 1 addition & 1 deletion HELM.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
go install sigs.k8s.io/kustomize/kustomize/v5@latest
go install github.com/arttor/helmify/cmd/helmify@latest

kustomize build config/default | helmify -cert-manager-as-subchart -cert-manager-version 1.15.2 -generate-defaults -image-pull-secrets helm-charts/kode
kustomize build config/default | helmify -cert-manager-as-subchart -cert-manager-version 1.15.3 -generate-defaults -image-pull-secrets helm-charts/kode
kustomize build config/crd | helmify helm-charts/kode-crd
```
37 changes: 32 additions & 5 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,36 +282,63 @@ tasks:
- kustomize

#### HELM BUILD ####
helm-build-kode-crd:
desc: Package kode-crd Helm chart
deps: [manifests, generate]
cmds:
- echo "Building kode-crd chart from config/crd..."
- kustomize build config/crd | helmify helm-charts/kode-crd

helm-package-kode-crd:
desc: Package kode-crd Helm chart
deps: [helm-build-kode-crd]
vars:
VERSION: '{{.CLI_ARGS | default "0.1.0"}}'
VERSION: '{{.CLI_ARGS | default "v0.0.0-latest"}}'
cmds:
- echo "Packaging kode-crd chart version {{.VERSION}}..."
- mkdir -p /tmp/helm-charts/kode-crd
- cp -r helm-charts/kode-crd/* /tmp/helm-charts/kode-crd/
- sed -i "s/PLACEHOLDER_VERSION/{{.VERSION}}/g" /tmp/helm-charts/kode-crd/Chart.yaml
- sed -i "s/v0.0.0-latest/{{.VERSION}}/g" /tmp/helm-charts/kode-crd/Chart.yaml
- sed -i "s/v0.0.0-latest/{{.VERSION}}/g" /tmp/helm-charts/kode-crd/README.md
- sed -i "s/v0.0.0--latest/{{.VERSION}}/g" /tmp/helm-charts/kode-crd/README.md # Special case for the img.shields.io badge
- helm package /tmp/helm-charts/kode-crd --version {{.VERSION}} --destination /tmp
- mv /tmp/kode-crd-{{.VERSION}}.tgz ./kode-crd-{{.VERSION}}.tgz
- rm -rf /tmp/helm-charts/kode-crd

helm-build-kode:
desc: Build kode Helm chart
deps: [manifests, generate]
cmds:
- echo "Building kode chart from config/crd..."
- kustomize build config/default | helmify -cert-manager-as-subchart -cert-manager-version 1.15.3 -generate-defaults -image-pull-secrets helm-charts/kode

helm-package-kode:
desc: Package kode Helm chart
deps: [helm-build-kode]
vars:
VERSION: '{{.CLI_ARGS | default "0.1.0"}}'
VERSION: '{{.CLI_ARGS | default "v0.0.0-latest"}}'
cmds:
- echo "Packaging kode chart version {{.VERSION}}..."
- mkdir -p /tmp/helm-charts/kode
- cp -r helm-charts/kode/* /tmp/helm-charts/kode/
- sed -i "s/PLACEHOLDER_VERSION/{{.VERSION}}/g" /tmp/helm-charts/kode/Chart.yaml
- sed -i "s/v0.0.0-latest/{{.VERSION}}/g" /tmp/helm-charts/kode/Chart.yaml
- sed -i "s/v0.0.0-latest/{{.VERSION}}/g" /tmp/helm-charts/kode/values.yaml
- sed -i "s/v0.0.0-latest/{{.VERSION}}/g" /tmp/helm-charts/kode/README.md
- sed -i "s/v0.0.0--latest/{{.VERSION}}/g" /tmp/helm-charts/kode/README.md # Special case for the img.shields.io bagde
- helm package /tmp/helm-charts/kode --version {{.VERSION}} --destination /tmp
- mv /tmp/kode-{{.VERSION}}.tgz ./kode-{{.VERSION}}.tgz
- rm -rf /tmp/helm-charts/kode

helm-build-all:
desc: Package all Helm charts
cmds:
- task: helm-build-kode-crd
- task: helm-build-kode

helm-package-all:
desc: Package all Helm charts
vars:
VERSION: '{{.CLI_ARGS | default "0.1.0"}}'
VERSION: '{{.CLI_ARGS | default "v0.0.0-latest"}}'
cmds:
- task: helm-package-kode-crd
vars: { VERSION: '{{.VERSION}}' }
Expand Down
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rules:
- apiGroups:
- apps
resources:
- secrets
- statefulsets
verbs:
- create
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/go-logr/zapr v1.3.0
github.com/onsi/ginkgo/v2 v2.20.0
github.com/onsi/gomega v1.34.1
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
Expand Down Expand Up @@ -49,13 +48,11 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
Expand Down
9 changes: 0 additions & 9 deletions helm-charts/kode/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,3 @@ description: A Helm chart for the Kode Operator. It installs the Kode Operator a
type: application
version: "v0.0.0-latest" # This is automatically set by the GitHub Actions workflow
appVersion: "v0.0.0-latest" # This is automatically set by the GitHub Actions workflow
dependencies:
- name: kode-crd
version: "v0.0.0-latest" # This is automatically set by the GitHub Actions workflow
repository: "oci://ghcr.io/jacero-io/charts"
- name: cert-manager
repository: https://charts.jetstack.io
condition: certmanager.enabled
alias: certmanager
version: "1.15.2"
1 change: 1 addition & 0 deletions helm-charts/kode/templates/manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rules:
- apiGroups:
- apps
resources:
- secrets
- statefulsets
verbs:
- create
Expand Down
6 changes: 3 additions & 3 deletions helm-charts/kode/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
certmanager:
enabled: false
installCRDs: false
enabled: true
installCRDs: true
controllerManager:
manager:
args:
Expand All @@ -12,7 +12,7 @@ controllerManager:
- ALL
image:
repository: ghcr.io/jacero-io/kode-operator
tag: v0.0.0-latest
tag: PLACEHOLDER_VERSION
resources:
limits:
cpu: 500m
Expand Down

0 comments on commit 2fdd9a1

Please sign in to comment.