Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVEREST-1595 | Openshift support #401

Merged
merged 8 commits into from
Nov 6, 2024
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
6 changes: 3 additions & 3 deletions charts/everest/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions charts/everest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
2 changes: 1 addition & 1 deletion charts/everest/charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/everest/charts/common/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
6 changes: 3 additions & 3 deletions charts/everest/charts/everest-db-namespace/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions charts/everest/charts/everest-db-namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

3 changes: 3 additions & 0 deletions charts/everest/charts/everest-db-namespace/values.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 5 additions & 1 deletion charts/everest/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -59,3 +60,4 @@ spec:
memory: 80Mi
nodeSelector:
kubernetes.io/os: linux
{{- end }}
2 changes: 2 additions & 0 deletions charts/everest/templates/everest-olm/certs.certmanager.yaml
Original file line number Diff line number Diff line change
@@ -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" .) }}
---
Expand Down Expand Up @@ -48,3 +49,4 @@ spec:
kind: Issuer
---
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/everest/templates/everest-olm/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -39,3 +40,4 @@ rules:
- apiGroups: ["packages.operators.coreos.com"]
resources: ["packagemanifests", "packagemanifests/icon"]
verbs: ["get", "list", "watch"]
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -10,3 +11,4 @@ subjects:
- kind: ServiceAccount
namespace: {{ include "everest.olmNamespace" . }}
name: olm-operator-serviceaccount
{{- end }}
2 changes: 2 additions & 0 deletions charts/everest/templates/everest-olm/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: v1
kind: Namespace
metadata:
name: {{ include "everest.olmNamespace" . }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -64,3 +65,4 @@ spec:
memory: 160Mi
nodeSelector:
kubernetes.io/os: linux
{{- end }}
2 changes: 2 additions & 0 deletions charts/everest/templates/everest-olm/olmconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: operators.coreos.com/v1
kind: OLMConfig
metadata:
name: cluster
{{- end }}
8 changes: 0 additions & 8 deletions charts/everest/templates/everest-olm/operatorgroup.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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") -}}
Expand Down Expand Up @@ -44,3 +45,4 @@ metadata:
namespace: {{ include "everest.olmNamespace" . }}
type: kubernetes.io/tls
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -107,3 +108,4 @@ spec:
- key: tls.key
path: tls.key
secretName: packageserver-service-cert
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -44,3 +45,4 @@ subjects:
- kind: ServiceAccount
name: olm-operator-serviceaccount
namespace: {{ include "everest.olmNamespace" . }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (and (not .Values.compatibility.openshift) .Values.olm.install) }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -13,3 +14,4 @@ spec:
selector:
app: packageserver
type: ClusterIP
{{- end }}
2 changes: 2 additions & 0 deletions charts/everest/templates/everest-olm/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 6 additions & 0 deletions charts/everest/values.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Loading