Skip to content

Commit 7be749c

Browse files
committed
Add ubi mode
Signed-off-by: Tamal Saha <[email protected]>
1 parent 6c6a3b8 commit 7be749c

File tree

101 files changed

+366
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+366
-71
lines changed

apis/installer/v1alpha1/kubedb_catalog_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ type KubedbCatalogSpec struct {
5353
SkipDeprecated bool `json:"skipDeprecated"`
5454
EnableVersions map[string][]string `json:"enableVersions"`
5555
CustomVersions map[string]*runtime.RawExtension `json:"customVersions"`
56+
// +optional
57+
Distro DistroSpec `json:"distro"`
5658
}
5759

5860
type PSP struct {

apis/installer/v1alpha1/kubedb_kubestash_catalog_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ type KubedbKubestashCatalogSpec struct {
6262
Singlestore KubestashDatabaseSpec `json:"singlestore"`
6363
ZooKeeper KubestashDatabaseSpec `json:"zookeeper"`
6464
Kubedbverifier KubestashVerifierSpec `json:"kubedbverifier"`
65+
// +optional
66+
Distro DistroSpec `json:"distro"`
6567
}
6668

6769
// KubestashDatabaseSpec is the schema for DB values file

apis/installer/v1alpha1/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ type NetworkPolicySpec struct {
104104
Enabled bool `json:"enabled"`
105105
}
106106

107+
// +kubebuilder:validation:Enum=all;catalog;operator
108+
type UBIMode string
109+
107110
type DistroSpec struct {
108-
Openshift bool `json:"openshift"`
111+
Openshift bool `json:"openshift"`
112+
UBI UBIMode `json:"ubi"`
109113
}

apis/installer/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

catalog/kubestash/fmt/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func main() {
213213
panic("unsupported registry for image " + img)
214214
}
215215
if found {
216-
newimg += ":" + tag
216+
newimg += ":" + tag + `{{ ternary "-ubi" "" (list "catalog" "all" | has .Values.distro.ubi) }}`
217217
}
218218
err = unstructured.SetNestedField(obj.UnstructuredContent(), newimg, "spec", "image")
219219
if err != nil {

charts/kubedb-autoscaler/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ The following table lists the configurable parameters of the `kubedb-autoscaler`
9090
| recommender.cpuHistogramDecayHalfLife | | <code>"5m0s"</code> |
9191
| maxConcurrentReconciles | The maximum number of concurrent reconciles which can be run | <code>0</code> |
9292
| distro.openshift | | <code>false</code> |
93+
| distro.ubi | | <code>""</code> |
9394

9495

9596
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

charts/kubedb-autoscaler/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,27 @@ Returns the registry used for operator docker image
8787
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
8888
{{- end }}
8989

90+
{{/*
91+
Returns the image tag used for operator docker image
92+
*/}}
93+
{{- define "operator.tag" -}}
94+
{{- .Values.operator.tag | default .Chart.AppVersion }}{{ ternary "-ubi" "" (list "operator" "all" | has .Values.distro.ubi) }}
95+
{{- end }}
96+
9097
{{/*
9198
Returns the registry used for waitfor docker image
9299
*/}}
93100
{{- define "waitfor.registry" -}}
94101
{{- list .Values.registryFQDN .Values.waitfor.registry | compact | join "/" }}
95102
{{- end }}
96103

104+
{{/*
105+
Returns the image tag used for waitfor docker image
106+
*/}}
107+
{{- define "waitfor.tag" -}}
108+
{{- .Values.waitfor.tag }}{{ ternary "-ubi" "" (list "operator" "all" | has .Values.distro.ubi) }}
109+
{{- end }}
110+
97111
{{- define "docker.imagePullSecrets" -}}
98112
{{- with .Values.imagePullSecrets -}}
99113
imagePullSecrets:

charts/kubedb-autoscaler/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
{{- if and .Values.global .Values.global.waitForWebhook }}
5959
initContainers:
6060
- name: wait
61-
image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }}
61+
image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ include "waitfor.tag" . }}
6262
imagePullPolicy: {{ .Values.imagePullPolicy }}
6363
command:
6464
- /bin/sh
@@ -84,7 +84,7 @@ spec:
8484
securityContext:
8585
{{- toYaml .Values.operator.securityContext | nindent 10 }}
8686
{{- end }}
87-
image: {{ include "operator.registry" . }}/{{ .Values.operator.repository }}:{{ .Values.operator.tag | default .Chart.AppVersion }}
87+
image: {{ include "operator.registry" . }}/{{ .Values.operator.repository }}:{{ include "operator.tag" . }}
8888
imagePullPolicy: {{ .Values.imagePullPolicy }}
8989
args:
9090
- operator

charts/kubedb-autoscaler/values.openapiv3_schema.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,15 @@ properties:
13161316
properties:
13171317
openshift:
13181318
type: boolean
1319+
ubi:
1320+
enum:
1321+
- all
1322+
- catalog
1323+
- operator
1324+
type: string
13191325
required:
13201326
- openshift
1327+
- ubi
13211328
type: object
13221329
fullnameOverride:
13231330
type: string

charts/kubedb-autoscaler/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,4 @@ maxConcurrentReconciles: 0
132132

133133
distro:
134134
openshift: false
135+
ubi: ""

0 commit comments

Comments
 (0)