Skip to content

Commit

Permalink
fix:fix the helm values reference and standardize chart folder (#14)
Browse files Browse the repository at this point in the history
fix:fix the helm values reference and standerdize chart folder

Co-authored-by: Sangeetha Madamanchi <[email protected]>
  • Loading branch information
sangdammad and Sangeetha Madamanchi authored Aug 23, 2022
1 parent 31fd56f commit 29c41b2
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 40 deletions.
21 changes: 0 additions & 21 deletions .charts/overwhelm/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: .charts
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~

.PHONY: helmManifests
helmManifests: manifests kustomize kubernetes-split-yaml ## Create Helm Templates to deploy manifests using Helm
$(KUSTOMIZE) build config/helm-manifest >> .charts/tmp.yaml
$(KUSTOMIZE) build config/helm-manifest >> charts/tmp.yaml
go run scripts/helm-charts/update.go
$(KUBERNETES_SPLIT_YAML) --outdir .charts/overwhelm/templates .charts/tmp.yaml
rm .charts/tmp.yaml
$(KUBERNETES_SPLIT_YAML) --outdir charts/overwhelm/templates charts/tmp.yaml
rm charts/tmp.yaml

.PHONY: helmInstall
helmInstall:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: overwhelm
version: 1.0.0
version: 1.0.1
maintainers:
- name: "Expedia Group"
url: "https://github.com/ExpediaGroup/overwhelm"
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ metadata:
name: overwhelm-controller-manager
namespace: overwhelm-system
spec:
replicas: {{ .Values.overwhelm.deployment.replicas }}
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
control-plane: controller-manager
template:
metadata:
annotations:
{{ toYaml .Values.overwhelm.deployment.annotations | indent 8 }}
{{ toYaml .Values.deployment.annotations | indent 8 }}
labels:
{{ toYaml .Values.overwhelm.deployment.labels | indent 8 }}
{{ toYaml .Values.deployment.labels | indent 8 }}
spec:
containers:
- args:
Expand All @@ -24,7 +24,7 @@ spec:
- --leader-elect
command:
- /manager
image: {{ .Values.overwhelm.deployment.image.manager.repository }}:{{ .Values.overwhelm.deployment.image.manager.tag }}
image: {{ .Values.deployment.image.manager.repository }}:{{ .Values.deployment.image.manager.tag }}
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -39,15 +39,15 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{ toYaml .Values.overwhelm.deployment.resources | indent 10 }}
{{ toYaml .Values.deployment.resources | indent 10 }}
securityContext:
allowPrivilegeEscalation: false
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=0
image: {{ .Values.overwhelm.deployment.image.kubeRbacProxy.repository }}:{{ .Values.overwhelm.deployment.image.kubeRbacProxy.tag }}
image: {{ .Values.deployment.image.kubeRbacProxy.repository }}:{{ .Values.deployment.image.kubeRbacProxy.tag }}
name: kube-rbac-proxy
ports:
- containerPort: 8443
Expand Down
20 changes: 20 additions & 0 deletions charts/overwhelm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
deployment:
image:
manager:
repository: ghcr.io/expediagroup/overwhelm
tag: latest
kubeRbacProxy:
repository: gcr.io/kubebuilder/kube-rbac-proxy
tag: v0.8.0
labels:
control-plane: controller-manager
replicas: 2
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 128m
memory: 64Mi

8 changes: 7 additions & 1 deletion config/helm-manifest/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ bases:

patchesStrategicMerge:
- manager_deployment_patch.yaml
- |-
apiVersion: v1
kind: Namespace
metadata:
name: overwhelm-system
$patch: delete
patchesJson6902: # We use Json6902 patches for inline replacement patches which are not possible with Strategic Merge patches
- target:
Expand All @@ -13,4 +19,4 @@ patchesJson6902: # We use Json6902 patches for inline replacement patches which
patch: |-
- op: replace
path: /spec/template/spec/containers/0/resources
value: <GOTEMPLATE> toYaml .Values.overwhelm.deployment.resources | indent 10 </GOTEMPLATE>
value: <GOTEMPLATE> toYaml .Values.deployment.resources | indent 10 </GOTEMPLATE>
10 changes: 5 additions & 5 deletions config/helm-manifest/manager_deployment_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: overwhelm-controller-manager
namespace: overwhelm-system
spec:
replicas: <GOTEMPLATE> .Values.overwhelm.deployment.replicas </GOTEMPLATE>
replicas: <GOTEMPLATE> .Values.deployment.replicas </GOTEMPLATE>
template:
metadata:
$patch: replace
annotations: <GOTEMPLATE> toYaml .Values.overwhelm.deployment.annotations | indent 8 </GOTEMPLATE>
labels: <GOTEMPLATE> toYaml .Values.overwhelm.deployment.labels | indent 8 </GOTEMPLATE>
annotations: <GOTEMPLATE> toYaml .Values.deployment.annotations | indent 8 </GOTEMPLATE>
labels: <GOTEMPLATE> toYaml .Values.deployment.labels | indent 8 </GOTEMPLATE>
spec:
containers:
- name: manager
image: <GOTEMPLATE> .Values.overwhelm.deployment.image.manager.repository </GOTEMPLATE>:<GOTEMPLATE> .Values.overwhelm.deployment.image.manager.tag </GOTEMPLATE>
image: <GOTEMPLATE> .Values.deployment.image.manager.repository </GOTEMPLATE>:<GOTEMPLATE> .Values.deployment.image.manager.tag </GOTEMPLATE>
- name: kube-rbac-proxy
image: <GOTEMPLATE> .Values.overwhelm.deployment.image.kubeRbacProxy.repository </GOTEMPLATE>:<GOTEMPLATE> .Values.overwhelm.deployment.image.kubeRbacProxy.tag </GOTEMPLATE>
image: <GOTEMPLATE> .Values.deployment.image.kubeRbacProxy.repository </GOTEMPLATE>:<GOTEMPLATE> .Values.deployment.image.kubeRbacProxy.tag </GOTEMPLATE>
4 changes: 2 additions & 2 deletions scripts/helm-charts/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func main() {
d, err := os.ReadFile(".charts/tmp.yaml")
d, err := os.ReadFile("charts/tmp.yaml")
if err != nil {
panic(err)
}
Expand All @@ -15,7 +15,7 @@ func main() {
data = strings.ReplaceAll(data, "<GOTEMPLATE>", "{{")
data = strings.ReplaceAll(data, "</GOTEMPLATE>", "}}")
data = strings.ReplaceAll(data, "{{ toYaml", "\n{{ toYaml")
if err = os.WriteFile(".charts/tmp.yaml", []byte(data), 0644); err != nil {
if err = os.WriteFile("charts/tmp.yaml", []byte(data), 0644); err != nil {
panic(err)
}
}

0 comments on commit 29c41b2

Please sign in to comment.