Skip to content

Commit

Permalink
Make crd-manager chart kustomize friendly (#1572)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Feb 17, 2025
1 parent 38dfeee commit 4493500
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
9 changes: 5 additions & 4 deletions apis/installer/v1alpha1/kubedb_crd_manager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ type KubedbCrdManagerSpec struct {
Tolerations []core.Toleration `json:"tolerations"`
// If specified, the pod's scheduling constraints
// +optional
Affinity *core.Affinity `json:"affinity"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
FeatureGates map[string]bool `json:"featureGates"`
RemoveUnusedCRDs bool `json:"removeUnusedCRDs"`
Affinity *core.Affinity `json:"affinity"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
FeatureGates map[string]bool `json:"featureGates"`
RemoveUnusedCRDs bool `json:"removeUnusedCRDs"`
TTLSecondsAfterFinished int `json:"ttlSecondsAfterFinished"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
1 change: 1 addition & 0 deletions charts/kubedb-crd-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The following table lists the configurable parameters of the `kubedb-crd-manager
| nodeSelector | | <code>{}</code> |
| tolerations | | <code>[]</code> |
| affinity | | <code>{}</code> |
| ttlSecondsAfterFinished | | <code>120</code> |
| serviceAccount.create | Specifies whether a service account should be created | <code>true</code> |
| serviceAccount.annotations | Annotations to add to the service account | <code>{}</code> |
| serviceAccount.name | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | <code></code> |
Expand Down
8 changes: 7 additions & 1 deletion charts/kubedb-crd-manager/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
spec:
backoffLimit: 3
ttlSecondsAfterFinished: 300
{{- if ge (int .Values.ttlSecondsAfterFinished) 0 }}
ttlSecondsAfterFinished: {{ .Values.ttlSecondsAfterFinished }}
{{- end }}
manualSelector: true
selector:
matchLabels:
{{- include "kubedb-crd-manager.labels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/kubedb-crd-manager/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "kubedb-crd-manager.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubedb-crd-manager.labels" . | nindent 4 }}
annotations:
Expand Down
3 changes: 3 additions & 0 deletions charts/kubedb-crd-manager/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1390,10 +1390,13 @@ properties:
type: string
type: object
type: array
ttlSecondsAfterFinished:
type: integer
required:
- featureGates
- image
- imagePullPolicy
- removeUnusedCRDs
- serviceAccount
- ttlSecondsAfterFinished
type: object
2 changes: 2 additions & 0 deletions charts/kubedb-crd-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ tolerations: []

affinity: {}

ttlSecondsAfterFinished: 120

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down
3 changes: 3 additions & 0 deletions charts/kubedb/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4275,13 +4275,16 @@ properties:
type: string
type: object
type: array
ttlSecondsAfterFinished:
type: integer
required:
- enabled
- featureGates
- image
- imagePullPolicy
- removeUnusedCRDs
- serviceAccount
- ttlSecondsAfterFinished
type: object
kubedb-kubestash-catalog:
properties:
Expand Down

0 comments on commit 4493500

Please sign in to comment.