Skip to content

Commit fa89178

Browse files
committed
Helm chart generation now incudes crds and uses the default service account with no resource limits.
1 parent 75af315 commit fa89178

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ bundle-build:
127127
# Generate helm chart
128128
helmchart: kustomize
129129
mkdir -p ./charts/${OPERATOR_NAME}/templates
130+
mkdir -p ./charts/${OPERATOR_NAME}/crds
130131
cp ./config/helmchart/templates/* ./charts/${OPERATOR_NAME}/templates
131132
$(KUSTOMIZE) build ./config/helmchart | sed 's/release-namespace/{{.Release.Namespace}}/' > ./charts/${OPERATOR_NAME}/templates/rbac.yaml
133+
$(KUSTOMIZE) build ./config/crd > ./charts/${OPERATOR_NAME}/crds/crds.yaml
132134
version=${VERSION} envsubst < ./config/helmchart/Chart.yaml.tpl > ./charts/${OPERATOR_NAME}/Chart.yaml
133135
version=${VERSION} image_repo=$${IMG%:*} envsubst < ./config/helmchart/values.yaml.tpl > ./charts/${OPERATOR_NAME}/values.yaml
134136
helm lint ./charts/${OPERATOR_NAME}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,29 @@ oc login --token ${token}
250250
make run ENABLE_WEBHOOKS=false
251251
```
252252

253+
### Test helm chart locally
254+
255+
Define an image and tag. For example...
256+
257+
```shell
258+
export imageRepository="quay.io/redhat-cop/namespace-configuration-operator"
259+
export imageTag="v1.0.2"
260+
```
261+
262+
Deploy chart...
263+
264+
```shell
265+
make helmchart IMG=${imageRepository} VERSION=${imageTag}
266+
helm upgrade -i namespace-configuration-operator-helmchart-test charts/namespace-configuration-operator -n namespace-configuration-operator-local --create-namespace
267+
```
268+
269+
Delete...
270+
271+
```shell
272+
helm delete namespace-configuration-operator-helmchart-test -n namespace-configuration-operator-local
273+
kubectl delete -f charts/namespace-configuration-operator/crds/crds.yaml
274+
```
275+
253276
### Building/Pushing the operator image
254277

255278
```shell

config/helmchart/templates/manager.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ spec:
2222
imagePullSecrets:
2323
{{- toYaml . | nindent 8 }}
2424
{{- end }}
25-
serviceAccountName: {{ include "namespace-configuration-operator.serviceAccountName" . }}
2625
containers:
2726
- command:
2827
- /manager

config/helmchart/values.yaml.tpl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,9 @@ imagePullSecrets: []
1414
nameOverride: ""
1515
fullnameOverride: ""
1616

17-
serviceAccount:
18-
# Specifies whether a service account should be created
19-
create: true
20-
# Annotations to add to the service account
21-
annotations: {}
22-
# The name of the service account to use.
23-
# If not set and create is true, a name is generated using the fullname template
24-
name: ""
25-
2617
podAnnotations: {}
2718

2819
resources:
29-
limits:
30-
cpu: 100m
31-
memory: 30Mi
3220
requests:
3321
cpu: 100m
3422
memory: 20Mi

0 commit comments

Comments
 (0)