Skip to content

Commit

Permalink
Make the operator portion optional
Browse files Browse the repository at this point in the history
  • Loading branch information
abelfodil committed Dec 28, 2024
1 parent 4bbae29 commit 67a3c59
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions charts/homer-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -28,3 +29,4 @@ rules:
- get
- list
- watch
{{- end }}
2 changes: 2 additions & 0 deletions charts/homer-operator/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -13,3 +14,4 @@ subjects:
- kind: ServiceAccount
name: {{ include "homer-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
13 changes: 12 additions & 1 deletion charts/homer-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
{{- if .Values.operator.enabled }}
- name: operator
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand All @@ -39,6 +40,7 @@ spec:
- name: config
mountPath: /www/assets/base_config.yml
subPath: base_config.yml
{{- end }}
- name: homer
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand All @@ -59,14 +61,23 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- if .Values.operator.enabled }}
- name: shared
mountPath: /www/assets/
{{- else }}
- name: config
mountPath: /www/assets/config.yml
subPath: base_config.yml
{{- end }}
volumes:
{{- if .Values.operator.enabled }}
- name: shared
emptyDir: {}
emptyDir: {}
{{- end }}
- name: config
configMap:
name: {{ include "homer-operator.fullname" . }}

{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/homer-operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -10,3 +11,4 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/homer-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ operatorImage:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

operator:
enabled: true

# This is to override the chart name.
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit 67a3c59

Please sign in to comment.