Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions dist/chart/templates/certmanager/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: selfsigned-issuer
Expand All @@ -15,10 +19,10 @@ spec:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
{{- if .Values.crd.keep }}
"helm.sh/resource-policy": keep
{{- end }}
helm.sh/resource-policy: keep
{{- end }}
name: serving-cert
namespace: {{ .Release.Namespace }}
labels:
Expand All @@ -39,10 +43,10 @@ spec:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
{{- if .Values.crd.keep }}
"helm.sh/resource-policy": keep
{{- end }}
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: metrics-certs
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Deployment
metadata:
name: team-operator-controller-manager
namespace: {{ .Release.Namespace }}
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
control-plane: controller-manager
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/metrics/metrics-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: Service
metadata:
name: team-operator-controller-manager-metrics-service
namespace: {{ .Release.Namespace }}
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: team-operator-controller-manager-metrics-monitor
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/auth_proxy_client_clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: team-operator-metrics-reader
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: proxy-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: proxy-rolebinding
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/chronicle_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: chronicle-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/chronicle_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: chronicle-viewer-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/connect_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: connect-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/connect_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: connect-viewer-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/packagemanager_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: packagemanager-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/packagemanager_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: packagemanager-viewer-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/postgresdatabase_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: postgresdatabase-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/postgresdatabase_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: postgresdatabase-viewer-role
Expand Down
8 changes: 8 additions & 0 deletions dist/chart/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: team-operator-manager-role
Expand All @@ -23,6 +27,10 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
name: team-operator-manager-role
namespace: {{ .Values.watchNamespace }}
rules:
Expand Down
8 changes: 8 additions & 0 deletions dist/chart/templates/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: team-operator-manager-rolebinding
Expand All @@ -18,6 +22,10 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
name: team-operator-manager-rolebinding
namespace: {{ .Values.watchNamespace }}
labels:
Expand Down
9 changes: 7 additions & 2 deletions dist/chart/templates/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ kind: ServiceAccount
metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- if and .Values.controllerManager.serviceAccount .Values.controllerManager.serviceAccount.annotations }}
{{- if or .Values.resourcePolicy.keep (and .Values.controllerManager.serviceAccount .Values.controllerManager.serviceAccount.annotations) }}
annotations:
{{- if .Values.resourcePolicy.keep }}
helm.sh/resource-policy: keep
{{- end }}
{{- if and .Values.controllerManager.serviceAccount .Values.controllerManager.serviceAccount.annotations }}
{{- range $key, $value := .Values.controllerManager.serviceAccount.annotations }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
name: {{ .Values.controllerManager.serviceAccountName }}
namespace: {{ .Release.Namespace }}
{{- end -}}
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/site_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: site-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/site_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: site-viewer-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/workbench_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: workbench-editor-role
Expand Down
4 changes: 4 additions & 0 deletions dist/chart/templates/rbac/workbench_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- if .Values.resourcePolicy.keep }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
name: workbench-viewer-role
Expand Down
6 changes: 6 additions & 0 deletions dist/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ crd:
# the Helm release is uninstalled.
keep: true

# Resource policy for non-CRD resources (Deployment, RBAC, Services, etc.)
# When enabled, adds helm.sh/resource-policy: keep annotation to prevent
# deletion during helm uninstall
resourcePolicy:
keep: true

# [METRICS]: Set to true to generate manifests for exporting metrics.
# To disable metrics export set false, and ensure that the
# ControllerManager argument "--metrics-bind-address=:8443" is removed.
Expand Down