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-1511 | Everest Helm chart #383

Merged
merged 69 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ff43d0d
Add Everest Helm chart
mayankshah1607 Sep 25, 2024
5feedfb
Update README
mayankshah1607 Sep 25, 2024
3cc9105
Skip automated release for everest
mayankshah1607 Sep 25, 2024
d776779
Refinements
mayankshah1607 Sep 25, 2024
a64b82e
More fixes
mayankshah1607 Sep 26, 2024
de8e705
More changes
mayankshah1607 Sep 27, 2024
2c5d2c2
Refactor using subcharts
mayankshah1607 Sep 28, 2024
3ab51e6
More changes
mayankshah1607 Sep 29, 2024
76c140a
Fix OG
mayankshah1607 Sep 30, 2024
767664d
More refactoring!
mayankshah1607 Oct 1, 2024
47897d5
Fix labeller
mayankshah1607 Oct 1, 2024
99f9224
More refactor
mayankshah1607 Oct 3, 2024
a7174fc
Renaming
mayankshah1607 Oct 3, 2024
d73bf60
Fix Makefile
mayankshah1607 Oct 3, 2024
474bced
More refactoring
mayankshah1607 Oct 3, 2024
13a0709
Refactor into subcharts again
mayankshah1607 Oct 5, 2024
e71a313
More changes
mayankshah1607 Oct 7, 2024
1d3be06
More fixes
mayankshah1607 Oct 7, 2024
d30dff3
Typo
mayankshah1607 Oct 8, 2024
e6eb44f
Add docs script
mayankshah1607 Oct 8, 2024
61ebc46
Fix docs
mayankshah1607 Oct 8, 2024
258aea9
Merge branch 'main' into EVEREST-1511
mayankshah1607 Oct 8, 2024
c5fb62b
Fix tls, add cert-manager support
mayankshah1607 Oct 9, 2024
cd4f678
works!
mayankshah1607 Oct 9, 2024
e4faddb
Fix docs
mayankshah1607 Oct 9, 2024
675ef47
Update readme
mayankshah1607 Oct 10, 2024
9b26cd4
Typos
mayankshah1607 Oct 10, 2024
639c651
Linting
mayankshah1607 Oct 10, 2024
b32086a
Merge branch 'main' into EVEREST-1511
mayankshah1607 Oct 10, 2024
c467865
Linting
mayankshah1607 Oct 10, 2024
8a0071b
Fix tmpl
mayankshah1607 Oct 10, 2024
91ededc
Add maintainer
mayankshah1607 Oct 10, 2024
ee24fa9
Remove kubeVersion
mayankshah1607 Oct 10, 2024
f3ce5d4
Exclude everest chart
mayankshah1607 Oct 10, 2024
60c2f27
Wire up cleanup job
mayankshah1607 Oct 10, 2024
fbbac37
Fix
mayankshah1607 Oct 10, 2024
28508db
Add flags to make secrets optional
mayankshah1607 Oct 10, 2024
3e434c4
Fix CI
mayankshah1607 Oct 10, 2024
32ec86b
Typo
mayankshah1607 Oct 10, 2024
a9c18f5
Just exclude for now
mayankshah1607 Oct 10, 2024
c23bb11
update codeowners and maintainers
mayankshah1607 Oct 10, 2024
a291476
Add tech preview banner
mayankshah1607 Oct 10, 2024
bd09765
gen docs
mayankshah1607 Oct 10, 2024
335036e
Update banner
mayankshah1607 Oct 10, 2024
c20a9fe
Remove unused options
mayankshah1607 Oct 10, 2024
bfc66e8
Update docs
mayankshah1607 Oct 10, 2024
2f6478b
Add OIDC settings
mayankshah1607 Oct 10, 2024
c81edb7
Update readme
mayankshah1607 Oct 10, 2024
32ecb81
Use lookup
mayankshah1607 Oct 11, 2024
5dab2de
Openshift support
mayankshah1607 Oct 20, 2024
4517e64
Docs gen
mayankshah1607 Oct 20, 2024
624af73
Merge branch 'main' into EVEREST-1511
mayankshah1607 Oct 20, 2024
888aaea
Fixes
mayankshah1607 Oct 21, 2024
1c119fa
Fix makefile
mayankshah1607 Oct 21, 2024
319d664
More fixes
mayankshah1607 Oct 21, 2024
e842bbf
Add kubeVersion
mayankshah1607 Oct 21, 2024
6a382c8
Fix Makefile
mayankshah1607 Oct 21, 2024
171d7a2
Update deps
mayankshah1607 Oct 21, 2024
e09fbdb
Fix Makefile
mayankshah1607 Oct 21, 2024
f2b341a
Fix kubeVersion
mayankshah1607 Oct 21, 2024
323ba4a
Fix linebreaks
mayankshah1607 Oct 21, 2024
9600af1
Update deps
mayankshah1607 Oct 21, 2024
080a1b7
Fix secrets
mayankshah1607 Oct 23, 2024
a747a3c
Include Everest for tests
mayankshah1607 Oct 24, 2024
06c7f7a
Remove openshift support
mayankshah1607 Oct 25, 2024
cc6b653
Fix OLM certs being overwritten
mayankshah1607 Oct 25, 2024
3e1a043
Merge branch 'main' into EVEREST-1511
mayankshah1607 Oct 25, 2024
f724985
Update .github/CODEOWNERS
mayankshah1607 Oct 25, 2024
a642c2c
Merge branch 'main' into EVEREST-1511
mayankshah1607 Oct 29, 2024
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* @hors @tplavcic @nmarukovich @ptankov @jvpasinatto @eleo007
/charts/pmm/ @percona/pmm-review-be @spron-in
/charts/everest/ @percona/everest-backend
mayankshah1607 marked this conversation as resolved.
Show resolved Hide resolved
mayankshah1607 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
path-ignore:
- 'charts/gcp-marketplace/**'
- 'charts/everest/**'
branches:
- main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
if [ -n "$OPERATOR_INSTALL" ]; then
for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done
fi
ct install --config .github/ct.yaml
ct install --config .github/ct.yaml --excluded-charts=everest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to exclude it for now because this tool tries to deploy in a random namespace, but the chart fails if it is anything other than everest-system

At the same time, I could not figure out how to set a namespace only for specific charts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there can be a separate workflow for everest, since we'll need one anyway for running a manual release

if [ -n "$OPERATOR_INSTALL" ]; then
for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done
fi
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.deploy/
.idea/
*.tgz
25 changes: 25 additions & 0 deletions charts/everest/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

Makefile
9 changes: 9 additions & 0 deletions charts/everest/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: common
repository: file://charts/common
version: 0.0.1
- name: everest-db-namespace
repository: file://charts/everest-db-namespace
version: 0.0.0
digest: sha256:c41bc5832c4bf3829a3ceabb7b3fcd2461035cc66986aa0acea8e7b366a6e036
generated: "2024-10-21T20:53:46.621274+05:30"
27 changes: 27 additions & 0 deletions charts/everest/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v2
name: everest
description: A cloud-native database platform
version: 0.0.0
appVersion: 0.0.0
type: application
kubeVersion: '>= 1.27.0'
maintainers:
- name: mayankshah1607
email: [email protected]
- name: oksana-grishchenko
email: [email protected]
- name: recharte
email: [email protected]
- name: michal-kralik
email: [email protected]
dependencies:
- name: common
version: 0.0.1
repository: "file://charts/common"
# This is not really a dependency, but we define it as one so that we're
# able to conditionally disable rendering these manifests along with the core chart manifests.
# The default behaviour of Helm is to always include the sub-chart manfiests unless explicitly disabled.
- name: everest-db-namespace
version: 0.0.0
repository: "file://charts/everest-db-namespace"
condition: "everest-db-namespace.enabled"
20 changes: 20 additions & 0 deletions charts/everest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prepare-chart:
CHART_FILES="Chart.yaml ./charts/everest-db-namespace/Chart.yaml"; \
for chart in $$CHART_FILES; do \
yq eval -i '.version = "${VERSION}"' $$chart; \
yq eval -i '.appVersion = "${VERSION}"' $$chart; \
done
yq eval -i '.server.image = "$(IMAGE_PREFIX)/everest"' values.yaml
yq eval -i '.olm.catalogSourceImage = "$(IMAGE_PREFIX)/everest-catalog"' values.yaml
yq eval -i '.operator.image = "$(IMAGE_PREFIX)/everest-operator"' values.yaml
yq eval -i '(.dependencies[] | select(.name == "everest-db-namespace")).version = "${VERSION}"' Chart.yaml


release: IMAGE_PREFIX=percona
release: prepare-chart

release-dev: IMAGE_PREFIX=perconalab
release-dev: prepare-chart

docs-gen:
docker run --rm -v "$(PWD)/:/helm-docs" -u $(shell id -u) jnorwood/helm-docs:v1.9.1
85 changes: 85 additions & 0 deletions charts/everest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Percona Everest

This helm chart deploys Percona Everest.

Useful links:
- [Percona Everest Documentation](https://docs.percona.com/everest/index.html)
- [Percona Everest GitHub](https://github.com/percona/everest)

> :warning: Note: This chart is currently in technical preview.
Future releases could potentially introduce breaking changes, and we cannot promise a migration path. We do not recommend using this in production environment,
but if you do so, please be aware of the risks.

## Usage

### Deploy Percona Everest

```sh
helm repo add percona https://percona.github.io/percona-helm-charts/
helm install everest-core percona/everest --namespace everest-system --create-namespace
```

> Note: we currently do not support deploying Everest in a namespace other than `everest-system`.
This command may take a few minutes to complete. Once done, you can retrieve the admin credentials using the following command:

```sh
kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash'
```

### Deploy your database namespace components

Once Everest is running, we need to create a namespace for your databases and provision the necessary operators.

```sh
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Namespace
metadata:
name: everest
labels:
app.kubernetes.io/managed-by: everest
EOF
helm install everest percona/everest-db-namespace --namespace everest
```

### Uninstalling

As a first step, you must always clean up your database namespace(s) first, otherwise the deletion could get stuck.
```sh
helm uninstall everest -n everest
kubectl delete ns everest
```

Then you can uninstall Everest itself:
```sh
helm uninstall everest-core -n everest-system
kubectl delete ns everest-system
```

## Configuration

The following table shows the configurable parameters of the Percona Everest chart and their default values.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| 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.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. |
| olm.packageserver.tls.tlsKey | string | `""` | Client key for the PackageServer APIService. Overrides the tls.type setting. |
| olm.packageserver.tls.type | string | `"helm"` | Type of TLS certificates. Supported values are "helm" and "cert-manager". For production setup, it is recommended to use "cert-manager". |
| operator.enableLeaderElection | bool | `true` | Enable leader election for the operator. |
| operator.healthProbeAddr | string | `":8081"` | Health probe address for the operator. |
| operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. |
| operator.metricsAddr | string | `"127.0.0.1:8080"` | Metrics address for the operator. |
| operator.resources | object | `{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"5m","memory":"64Mi"}}` | Resources to allocate for the operator container. |
| server.image | string | `"perconalab/everest"` | Image to use for the server container. |
| server.oidc | object | `{}` | OIDC configuration for Everest. |
| server.rbac | string | `"g, admin, role:admin\n"` | RBAC policy for Everest. |
| server.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"20Mi"}}` | Resources to allocate for the server container. |
| telemetry | bool | `true` | If set, enabled sending telemetry information. |
68 changes: 68 additions & 0 deletions charts/everest/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Percona Everest

This helm chart deploys Percona Everest.

Useful links:
- [Percona Everest Documentation](https://docs.percona.com/everest/index.html)
- [Percona Everest GitHub](https://github.com/percona/everest)

> :warning: Note: This chart is currently in technical preview.
Future releases could potentially introduce breaking changes, and we cannot promise a migration path. We do not recommend using this in production environment,
but if you do so, please be aware of the risks.

## Usage

### Deploy Percona Everest

```sh
helm repo add percona https://percona.github.io/percona-helm-charts/
helm install everest-core percona/everest --namespace everest-system --create-namespace
```

> Note: we currently do not support deploying Everest in a namespace other than `everest-system`.

This command may take a few minutes to complete. Once done, you can retrieve the admin credentials using the following command:

```sh
kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash'
```

### Deploy your database namespace components

Once Everest is running, we need to create a namespace for your databases and provision the necessary operators.

```sh
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Namespace
metadata:
name: everest
labels:
app.kubernetes.io/managed-by: everest
EOF
helm install everest percona/everest-db-namespace --namespace everest
```

### Uninstalling

As a first step, you must always clean up your database namespace(s) first, otherwise the deletion could get stuck.
```sh
helm uninstall everest -n everest
kubectl delete ns everest
```

Then you can uninstall Everest itself:
```sh
helm uninstall everest-core -n everest-system
kubectl delete ns everest-system
```

## Configuration

The following table shows the configurable parameters of the Percona Everest chart and their default values.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
{{- range .Values }}
| {{ .Key }} | {{ .Type }} | {{ .Default }} | {{ .AutoDescription }} |
{{- end }}
23 changes: 23 additions & 0 deletions charts/everest/charts/common/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/everest/charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: common
description: A library chart for Everest containing common resources.
type: library
version: 0.0.1
appVersion: "0.0.1"
8 changes: 8 additions & 0 deletions charts/everest/charts/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# common

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square)

A library chart for Everest containing common resources.

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1)
71 changes: 71 additions & 0 deletions charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# @param .namespace The namespace where the operator is installed
#
{{- define "everest.csvCleanup" }}
{{- $hookName := printf "everest-helm-pre-delete-hook" }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $hookName }}
namespace: {{ .namespace }}
annotations:
"helm.sh/hook-delete-policy": hook-succeeded
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $hookName }}
namespace: {{ .namespace }}
annotations:
"helm.sh/hook-delete-policy": hook-succeeded
rules:
- apiGroups:
- operators.coreos.com
resources:
- clusterserviceversions
verbs:
- delete
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $hookName }}
namespace: {{ .namespace }}
annotations:
"helm.sh/hook-delete-policy": hook-succeeded
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $hookName }}
subjects:
- kind: ServiceAccount
name: {{ $hookName }}
namespace: {{ .namespace }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ $hookName }}-{{ randNumeric 6 }}
namespace: {{ .namespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
spec:
containers:
- image: bitnami/kubectl:latest
name: {{ $hookName }}
command:
- /bin/sh
- -c
- |
kubectl delete csv -n {{ .namespace }} --all --wait
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
serviceAccount: {{ $hookName }}
serviceAccountName: {{ $hookName }}
terminationGracePeriodSeconds: 30
---
{{- end }}
Loading
Loading