diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock index c99e196e..585b74e8 100644 --- a/charts/everest/Chart.lock +++ b/charts/everest/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: common repository: file://charts/common - version: 0.0.4 + version: 0.0.5 - name: everest-db-namespace repository: file://charts/everest-db-namespace version: 0.0.0 -digest: sha256:2b5ec4cba791a9062cafe0a4eced850516b1f28b53b32a2f4a6787e9c941cbee -generated: "2024-11-05T14:31:28.077684+05:30" +digest: sha256:de45f56b3032db8bc6e21fc0858bc56d1b8701e7c1edfcc18c61285945235826 +generated: "2024-11-05T15:38:39.638426+05:30" diff --git a/charts/everest/README.md b/charts/everest/README.md index 1ef463fe..3b0922c2 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -63,11 +63,13 @@ The following table shows the configurable parameters of the Percona Everest cha | Key | Type | Default | Description | |-----|------|---------|-------------| +| compatibility.openshift | bool | `false` | Enable OpenShift compatibility. If set, ignores olm.install and olm.namespace settings. | | everest-db-namespace.enabled | bool | `false` | Do not enable. | | monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.catalogSourceImage | string | `"perconalab/everest-catalog"` | Image to use for Everest CatalogSource. | | olm.image | string | `"quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6"` | Image to use for the OLM components. | +| olm.install | bool | `true` | If set, installs OLM in the provided namespace. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed. Do no change unless you know what you are doing. | | olm.packageserver.tls.caCert | string | `""` | CA certificate for the PackageServer APIService. Overrides the tls.type setting. | | olm.packageserver.tls.tlsCert | string | `""` | Client certificate for the PackageServer APIService. Overrides the tls.type setting. | diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index c2d5f526..2c6394c0 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A library chart for Everest containing common resources. type: library -version: 0.0.4 +version: 0.0.5 appVersion: "0.0.3" maintainers: - name: mayankshah1607 diff --git a/charts/everest/charts/common/README.md b/charts/everest/charts/common/README.md index e41150f9..39c30912 100644 --- a/charts/everest/charts/common/README.md +++ b/charts/everest/charts/common/README.md @@ -1,6 +1,6 @@ # common -![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.3](https://img.shields.io/badge/AppVersion-0.0.3-informational?style=flat-square) +![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.3](https://img.shields.io/badge/AppVersion-0.0.3-informational?style=flat-square) A library chart for Everest containing common resources. diff --git a/charts/everest/charts/everest-db-namespace/Chart.lock b/charts/everest/charts/everest-db-namespace/Chart.lock index 48f447d1..ee6a3496 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.lock +++ b/charts/everest/charts/everest-db-namespace/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: file://../common - version: 0.0.4 -digest: sha256:d4b492b530b0ae0b3234a3d287a2d3873c99d3dd273c569e82e6eeb83380abc9 -generated: "2024-11-05T14:31:44.457971+05:30" + version: 0.0.5 +digest: sha256:48e19e8a98645cb1215743e87c55cf6ef5bdd8f126cbc498034d98c1770bbb8c +generated: "2024-11-05T15:38:39.892141+05:30" diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md index b8fddbb4..f18f5de3 100644 --- a/charts/everest/charts/everest-db-namespace/README.md +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -26,6 +26,7 @@ Kubernetes: `>= 1.27.0` | Key | Type | Default | Description | |-----|------|---------|-------------| | cleanupOnUninstall | bool | `true` | If set, cleans up the DB resources on uninstall. | +| compatibility.openshift | bool | `false` | If set, enable OpenShift compatibility. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed in the cluster. | | pg | bool | `true` | If set, installs the Percona Postgresql Server operator. | diff --git a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl index c355a5f5..6c57a710 100644 --- a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl +++ b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl @@ -6,8 +6,13 @@ Allows overriding the install namespace in combined charts. {{- end }} {{/* -Allow overriding OLM namespacse +Allow overriding OLM namespace */}} {{- define "db.olmNamespace"}} +{{- if .Values.compatibility.openshift }} +{{- "openshift-marketplace" }} +{{- else }} {{- .Values.olm.namespace }} {{- end }} +{{- end }} + diff --git a/charts/everest/charts/everest-db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml index d1423609..56e84c3d 100644 --- a/charts/everest/charts/everest-db-namespace/values.yaml +++ b/charts/everest/charts/everest-db-namespace/values.yaml @@ -1,3 +1,6 @@ +compatibility: + # -- If set, enable OpenShift compatibility. + openshift: false # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" # -- If set, enabled sending telemetry information. diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index 1cf6b2a7..99b49a0f 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -16,9 +16,13 @@ Allows overriding the install namespace in combined charts. Allow overriding OLM namespace */}} {{- define "everest.olmNamespace"}} +{{- if .Values.compatibility.openshift }} +{{- "openshift-marketplace" }} +{{- else }} {{- .Values.olm.namespace }} {{- end }} - +{{- end }} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/charts/everest/templates/everest-olm/everest-catalogsource.yaml b/charts/everest/templates/everest-catalogsource.yaml similarity index 100% rename from charts/everest/templates/everest-olm/everest-catalogsource.yaml rename to charts/everest/templates/everest-catalogsource.yaml diff --git a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml index de84975b..12fb69d8 100644 --- a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: apps/v1 kind: Deployment metadata: @@ -59,3 +60,4 @@ spec: memory: 80Mi nodeSelector: kubernetes.io/os: linux +{{- end }} diff --git a/charts/everest/templates/everest-olm/certs.certmanager.yaml b/charts/everest/templates/everest-olm/certs.certmanager.yaml index d979b73c..f1d00482 100644 --- a/charts/everest/templates/everest-olm/certs.certmanager.yaml +++ b/charts/everest/templates/everest-olm/certs.certmanager.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} {{- if eq .Values.olm.packageserver.tls.type "cert-manager"}} {{- $tls := fromYaml (include "olm.certs" .) }} --- @@ -48,3 +49,4 @@ spec: kind: Issuer --- {{- end }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrole.yaml b/charts/everest/templates/everest-olm/clusterrole.yaml index 13c7abdb..9fda73aa 100644 --- a/charts/everest/templates/everest-olm/clusterrole.yaml +++ b/charts/everest/templates/everest-olm/clusterrole.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -39,3 +40,4 @@ rules: - apiGroups: ["packages.operators.coreos.com"] resources: ["packagemanifests", "packagemanifests/icon"] verbs: ["get", "list", "watch"] +{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrolebinding.yaml b/charts/everest/templates/everest-olm/clusterrolebinding.yaml index 782afb89..352465cd 100644 --- a/charts/everest/templates/everest-olm/clusterrolebinding.yaml +++ b/charts/everest/templates/everest-olm/clusterrolebinding.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -10,3 +11,4 @@ subjects: - kind: ServiceAccount namespace: {{ include "everest.olmNamespace" . }} name: olm-operator-serviceaccount +{{- end }} diff --git a/charts/everest/templates/everest-olm/namespace.yaml b/charts/everest/templates/everest-olm/namespace.yaml index a7101de6..ee97d0ad 100644 --- a/charts/everest/templates/everest-olm/namespace.yaml +++ b/charts/everest/templates/everest-olm/namespace.yaml @@ -1,4 +1,6 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: v1 kind: Namespace metadata: name: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml index 51e80976..64f026d2 100644 --- a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: apps/v1 kind: Deployment metadata: @@ -64,3 +65,4 @@ spec: memory: 160Mi nodeSelector: kubernetes.io/os: linux +{{- end }} diff --git a/charts/everest/templates/everest-olm/olmconfig.yaml b/charts/everest/templates/everest-olm/olmconfig.yaml index ad881b7b..c74a427d 100644 --- a/charts/everest/templates/everest-olm/olmconfig.yaml +++ b/charts/everest/templates/everest-olm/olmconfig.yaml @@ -1,4 +1,6 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: operators.coreos.com/v1 kind: OLMConfig metadata: name: cluster +{{- end }} diff --git a/charts/everest/templates/everest-olm/operatorgroup.yaml b/charts/everest/templates/everest-olm/operatorgroup.yaml deleted file mode 100644 index 3ec436ee..00000000 --- a/charts/everest/templates/everest-olm/operatorgroup.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: olm-operators - namespace: {{ include "everest.olmNamespace" . }} -spec: - targetNamespaces: - - {{ include "everest.olmNamespace" . }} diff --git a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml index bbdca1a3..0594365a 100644 --- a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} {{- $tls := fromYaml (include "olm.certs" .) }} {{- $apiService := (lookup "apiregistration.k8s.io/v1" "APIService" "" "v1.packages.operators.coreos.com") -}} {{- $secret := (lookup "v1" "Secret" (include "everest.olmNamespace" .) "packageserver-service-cert") -}} @@ -44,3 +45,4 @@ metadata: namespace: {{ include "everest.olmNamespace" . }} type: kubernetes.io/tls {{- end }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.deployment.yaml b/charts/everest/templates/everest-olm/packageserver.deployment.yaml index 72bd3594..5f4885dc 100644 --- a/charts/everest/templates/everest-olm/packageserver.deployment.yaml +++ b/charts/everest/templates/everest-olm/packageserver.deployment.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: apps/v1 kind: Deployment metadata: @@ -107,3 +108,4 @@ spec: - key: tls.key path: tls.key secretName: packageserver-service-cert +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.rbac.yaml b/charts/everest/templates/everest-olm/packageserver.rbac.yaml index bd23a1ec..cee123a1 100644 --- a/charts/everest/templates/everest-olm/packageserver.rbac.yaml +++ b/charts/everest/templates/everest-olm/packageserver.rbac.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -44,3 +45,4 @@ subjects: - kind: ServiceAccount name: olm-operator-serviceaccount namespace: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.service.yaml b/charts/everest/templates/everest-olm/packageserver.service.yaml index 669f9b8b..da415889 100644 --- a/charts/everest/templates/everest-olm/packageserver.service.yaml +++ b/charts/everest/templates/everest-olm/packageserver.service.yaml @@ -1,3 +1,4 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} apiVersion: v1 kind: Service metadata: @@ -13,3 +14,4 @@ spec: selector: app: packageserver type: ClusterIP +{{- end }} diff --git a/charts/everest/templates/everest-olm/serviceaccount.yaml b/charts/everest/templates/everest-olm/serviceaccount.yaml index 90d16ead..7b8a508b 100644 --- a/charts/everest/templates/everest-olm/serviceaccount.yaml +++ b/charts/everest/templates/everest-olm/serviceaccount.yaml @@ -1,5 +1,7 @@ +{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }} kind: ServiceAccount apiVersion: v1 metadata: name: olm-operator-serviceaccount namespace: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index da785e75..fab2d2c7 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,3 +1,7 @@ +compatibility: + # -- Enable OpenShift compatibility. + # If set, ignores olm.install and olm.namespace settings. + openshift: false # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" # -- If set, enabled sending telemetry information. @@ -44,6 +48,8 @@ upgrade: # It is strongly recommended to enable this setting. preflightChecks: true olm: + # -- If set, installs OLM in the provided namespace. + install: true # -- Namespace where OLM is installed. Do no change unless you know what you are doing. namespace: everest-olm # -- Image to use for Everest CatalogSource.