First iteration of gitea helm chart.
This commit is contained in:
87
gitea/.drone.yml
Normal file
87
gitea/.drone.yml
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: lint
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: helm lint
|
||||||
|
pull: always
|
||||||
|
image: alpine:3.16
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
|
- helm lint
|
||||||
|
|
||||||
|
- name: helm template
|
||||||
|
pull: always
|
||||||
|
image: alpine:3.16
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
|
- helm dependency update
|
||||||
|
- helm template --debug gitea-helm .
|
||||||
|
|
||||||
|
- name: verify readme
|
||||||
|
pull: always
|
||||||
|
image: alpine:3.16
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git
|
||||||
|
- make readme
|
||||||
|
- git diff --exit-code --name-only README.md
|
||||||
|
|
||||||
|
- name: discord
|
||||||
|
pull: always
|
||||||
|
image: appleboy/drone-discord:1.2.4
|
||||||
|
environment:
|
||||||
|
DISCORD_WEBHOOK_ID:
|
||||||
|
from_secret: discord_webhook_id
|
||||||
|
DISCORD_WEBHOOK_TOKEN:
|
||||||
|
from_secret: discord_webhook_token
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- changed
|
||||||
|
- failure
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release-version
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: generate-chart
|
||||||
|
pull: always
|
||||||
|
image: alpine:3.16
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
|
- apk add --no-cache curl
|
||||||
|
- helm dependency update
|
||||||
|
- helm package --version "${DRONE_TAG##v}" ./
|
||||||
|
- mkdir gitea
|
||||||
|
- mv gitea*.tgz gitea/
|
||||||
|
- curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml
|
||||||
|
- helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml
|
||||||
|
|
||||||
|
- name: upload-chart
|
||||||
|
pull: always
|
||||||
|
image: plugins/s3:latest
|
||||||
|
settings:
|
||||||
|
bucket: gitea-artifacts
|
||||||
|
endpoint: https://ams3.digitaloceanspaces.com
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
source: gitea/*
|
||||||
|
target: /charts
|
||||||
|
strip_prefix: gitea/
|
||||||
27
gitea/.helmignore
Normal file
27
gitea/.helmignore
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
.npmrc
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
.gitea/
|
||||||
151
gitea/.markdownlint.yaml
Normal file
151
gitea/.markdownlint.yaml
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
# markdownlint YAML configuration
|
||||||
|
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
|
||||||
|
|
||||||
|
# Default state for all rules
|
||||||
|
default: true
|
||||||
|
|
||||||
|
# Path to configuration file to extend
|
||||||
|
extends: null
|
||||||
|
|
||||||
|
# MD003/heading-style/header-style - Heading style
|
||||||
|
MD003:
|
||||||
|
# Heading style
|
||||||
|
style: "atx"
|
||||||
|
|
||||||
|
# MD004/ul-style - Unordered list style
|
||||||
|
MD004:
|
||||||
|
style: "dash"
|
||||||
|
|
||||||
|
# MD007/ul-indent - Unordered list indentation
|
||||||
|
MD007:
|
||||||
|
# Spaces for indent
|
||||||
|
indent: 2
|
||||||
|
# Whether to indent the first level of the list
|
||||||
|
start_indented: false
|
||||||
|
|
||||||
|
# MD009/no-trailing-spaces - Trailing spaces
|
||||||
|
MD009:
|
||||||
|
# Spaces for line break
|
||||||
|
br_spaces: 2
|
||||||
|
# Allow spaces for empty lines in list items
|
||||||
|
list_item_empty_lines: false
|
||||||
|
# Include unnecessary breaks
|
||||||
|
strict: false
|
||||||
|
|
||||||
|
# MD010/no-hard-tabs - Hard tabs
|
||||||
|
MD010:
|
||||||
|
# Include code blocks
|
||||||
|
code_blocks: true
|
||||||
|
|
||||||
|
# MD012/no-multiple-blanks - Multiple consecutive blank lines
|
||||||
|
MD012:
|
||||||
|
# Consecutive blank lines
|
||||||
|
maximum: 1
|
||||||
|
|
||||||
|
# MD013/line-length - Line length
|
||||||
|
MD013:
|
||||||
|
# Number of characters
|
||||||
|
line_length: 80
|
||||||
|
# Number of characters for headings
|
||||||
|
heading_line_length: 80
|
||||||
|
# Number of characters for code blocks
|
||||||
|
code_block_line_length: 80
|
||||||
|
# Include code blocks
|
||||||
|
code_blocks: false
|
||||||
|
# Include tables
|
||||||
|
tables: false
|
||||||
|
# Include headings
|
||||||
|
headings: true
|
||||||
|
# Include headings
|
||||||
|
headers: true
|
||||||
|
# Strict length checking
|
||||||
|
strict: false
|
||||||
|
# Stern length checking
|
||||||
|
stern: false
|
||||||
|
|
||||||
|
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
|
||||||
|
MD022:
|
||||||
|
# Blank lines above heading
|
||||||
|
lines_above: 1
|
||||||
|
# Blank lines below heading
|
||||||
|
lines_below: 1
|
||||||
|
|
||||||
|
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
|
||||||
|
MD024:
|
||||||
|
# Only check sibling headings
|
||||||
|
allow_different_nesting: true
|
||||||
|
|
||||||
|
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
|
||||||
|
MD025:
|
||||||
|
# Heading level
|
||||||
|
level: 1
|
||||||
|
# RegExp for matching title in front matter
|
||||||
|
front_matter_title: "^\\s*title\\s*[:=]"
|
||||||
|
|
||||||
|
# MD026/no-trailing-punctuation - Trailing punctuation in heading
|
||||||
|
MD026:
|
||||||
|
# Punctuation characters
|
||||||
|
punctuation: ".,;:!。,;:!"
|
||||||
|
|
||||||
|
# MD029/ol-prefix - Ordered list item prefix
|
||||||
|
MD029:
|
||||||
|
# List style
|
||||||
|
style: "one_or_ordered"
|
||||||
|
|
||||||
|
# MD030/list-marker-space - Spaces after list markers
|
||||||
|
MD030:
|
||||||
|
# Spaces for single-line unordered list items
|
||||||
|
ul_single: 1
|
||||||
|
# Spaces for single-line ordered list items
|
||||||
|
ol_single: 1
|
||||||
|
# Spaces for multi-line unordered list items
|
||||||
|
ul_multi: 1
|
||||||
|
# Spaces for multi-line ordered list items
|
||||||
|
ol_multi: 1
|
||||||
|
|
||||||
|
# MD033/no-inline-html - Inline HTML
|
||||||
|
MD033:
|
||||||
|
# Allowed elements
|
||||||
|
allowed_elements: []
|
||||||
|
|
||||||
|
# MD035/hr-style - Horizontal rule style
|
||||||
|
MD035:
|
||||||
|
# Horizontal rule style
|
||||||
|
style: "---"
|
||||||
|
|
||||||
|
# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
|
||||||
|
MD036:
|
||||||
|
# Punctuation characters
|
||||||
|
punctuation: ".,;:!?。,;:!?"
|
||||||
|
|
||||||
|
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
|
||||||
|
MD041:
|
||||||
|
# Heading level
|
||||||
|
level: 1
|
||||||
|
# RegExp for matching title in front matter
|
||||||
|
front_matter_title: "^\\s*title\\s*[:=]"
|
||||||
|
|
||||||
|
# MD044/proper-names - Proper names should have the correct capitalization
|
||||||
|
MD044:
|
||||||
|
# List of proper names
|
||||||
|
names:
|
||||||
|
- Gitea
|
||||||
|
- PostgreSQL
|
||||||
|
- MariaDB
|
||||||
|
- MySQL
|
||||||
|
- Memcached
|
||||||
|
- Prometheus
|
||||||
|
- Git
|
||||||
|
- GitOps
|
||||||
|
# Include code blocks
|
||||||
|
code_blocks: false
|
||||||
|
|
||||||
|
# MD046/code-block-style - Code block style
|
||||||
|
MD046:
|
||||||
|
# Block style
|
||||||
|
style: "fenced"
|
||||||
|
|
||||||
|
# MD048/code-fence-style - Code fence style
|
||||||
|
MD048:
|
||||||
|
# Code fence syle
|
||||||
|
style: "backtick"
|
||||||
3
gitea/.markdownlintignore
Normal file
3
gitea/.markdownlintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.gitea/
|
||||||
|
node_modules/
|
||||||
|
charts/
|
||||||
5
gitea/.values.yaml.~undo-tree~
Normal file
5
gitea/.values.yaml.~undo-tree~
Normal file
File diff suppressed because one or more lines are too long
52
gitea/CONTRIBUTING.md
Normal file
52
gitea/CONTRIBUTING.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Contribution Guidelines
|
||||||
|
|
||||||
|
Any type of contribution is welcome; from new features, bug fixes, tests,
|
||||||
|
refactorings for easier maintainability or documentation improvements.
|
||||||
|
|
||||||
|
## Development environment
|
||||||
|
|
||||||
|
- [`node`](https://nodejs.org/en/) at least current LTS
|
||||||
|
- [`helm`](https://helm.sh/docs/intro/install/)
|
||||||
|
- `make` is optional; you may call the commands directly
|
||||||
|
|
||||||
|
When using Visual Studio Code as IDE, following plugins might be useful:
|
||||||
|
|
||||||
|
- [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)
|
||||||
|
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
||||||
|
- [Helm Intellisense](https://marketplace.visualstudio.com/items?itemName=Tim-Koehler.helm-intellisense)
|
||||||
|
|
||||||
|
## Documentation Requirements
|
||||||
|
|
||||||
|
The `README.md` must include all configuration options. The parameters section
|
||||||
|
is generated by extracting the parameter annotations from the `values.yaml` file,
|
||||||
|
by using [this tool](https://github.com/bitnami-labs/readme-generator-for-helm).
|
||||||
|
|
||||||
|
If changes were made on configuration options, run `make readme` to update the
|
||||||
|
README file.
|
||||||
|
|
||||||
|
## Pull Request Requirements
|
||||||
|
|
||||||
|
When submitting or updating a PR:
|
||||||
|
|
||||||
|
- make sure it passes CI builds.
|
||||||
|
- do not make independent changes in one PR.
|
||||||
|
- try to avoid rebases. They make code reviews for large PRs and comments much harder.
|
||||||
|
- if applicable, use the PR template for a well-defined PR description.
|
||||||
|
- clearly mark breaking changes.
|
||||||
|
|
||||||
|
## Local development & testing
|
||||||
|
|
||||||
|
For local development and testing of pull requests, the following workflow can
|
||||||
|
be used:
|
||||||
|
|
||||||
|
1. Install `minikube` and `helm`.
|
||||||
|
2. Start a `minikube` cluster via `minikube start`.
|
||||||
|
3. From the `gitea/helm-chart` directory execute the following command. This
|
||||||
|
will install the dependencies listed in `Chart.yml` and deploy the current
|
||||||
|
state of the helm chart found locally. If you want to test a branch, make
|
||||||
|
sure to switch to the respective branch first.
|
||||||
|
`helm install --dependency-update gitea . -f values.yaml`.
|
||||||
|
4. Gitea is now deployed in `minikube`. To access it, it's port needs to be
|
||||||
|
forwarded first from `minikube` to localhost first via `kubectl --namespace
|
||||||
|
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
|
||||||
|
[http://localhost:3000](http://localhost:3000).
|
||||||
15
gitea/Chart.lock
Normal file
15
gitea/Chart.lock
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: memcached
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 5.9.0
|
||||||
|
- name: mysql
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 6.14.10
|
||||||
|
- name: postgresql
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 10.3.17
|
||||||
|
- name: mariadb
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 9.3.6
|
||||||
|
digest: sha256:08f967276fa0c083e9756a974a9791a487a71be0a226dc14351b3e5a2641e8fd
|
||||||
|
generated: "2022-06-11T12:18:36.672047+02:00"
|
||||||
46
gitea/Chart.yaml
Normal file
46
gitea/Chart.yaml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
appVersion: 1.17.1
|
||||||
|
dependencies:
|
||||||
|
- condition: memcached.enabled
|
||||||
|
name: memcached
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 5.9.0
|
||||||
|
- condition: mysql.enabled
|
||||||
|
name: mysql
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 6.14.10
|
||||||
|
- condition: postgresql.enabled
|
||||||
|
name: postgresql
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 10.3.17
|
||||||
|
- condition: mariadb.enabled
|
||||||
|
name: mariadb
|
||||||
|
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||||
|
version: 9.3.6
|
||||||
|
description: Gitea Helm chart for Kubernetes
|
||||||
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
keywords:
|
||||||
|
- git
|
||||||
|
- issue tracker
|
||||||
|
- code review
|
||||||
|
- wiki
|
||||||
|
- gitea
|
||||||
|
- gogs
|
||||||
|
maintainers:
|
||||||
|
- email: charlie@charliedrage.com
|
||||||
|
name: Charlie Drage
|
||||||
|
- email: maintainers@gitea.io
|
||||||
|
name: Gitea Authors
|
||||||
|
- email: konrad.lother@novum-rgi.de
|
||||||
|
name: Konrad Lother
|
||||||
|
- email: lucas.hahn@novum-rgi.de
|
||||||
|
name: Lucas Hahn
|
||||||
|
- email: sk.bunsenbrenner@gmail.com
|
||||||
|
name: Steven Kriegler
|
||||||
|
name: gitea
|
||||||
|
sources:
|
||||||
|
- https://gitea.com/gitea/helm-chart
|
||||||
|
- https://github.com/go-gitea/gitea
|
||||||
|
- https://hub.docker.com/r/gitea/gitea/
|
||||||
|
type: application
|
||||||
|
version: 6.0.0
|
||||||
24
gitea/LICENSE
Normal file
24
gitea/LICENSE
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 The Gitea Authors
|
||||||
|
Copyright (c) 2020 NOVUM-RGI
|
||||||
|
Copyright (c) 2019 - 2020 Charlie Drage
|
||||||
|
Copyright (c) 2018 John Felten
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
8
gitea/Makefile
Normal file
8
gitea/Makefile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.PHONY: prepare-environment
|
||||||
|
prepare-environment:
|
||||||
|
npm install
|
||||||
|
|
||||||
|
.PHONY: readme
|
||||||
|
readme: prepare-environment
|
||||||
|
npm run readme:parameters
|
||||||
|
npm run readme:lint
|
||||||
966
gitea/README.md
Normal file
966
gitea/README.md
Normal file
@ -0,0 +1,966 @@
|
|||||||
|
# Gitea Helm Chart
|
||||||
|
|
||||||
|
[Gitea](https://gitea.io/en-us/) is a community managed lightweight code hosting
|
||||||
|
solution written in Go. It is published under the MIT license.
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This helm chart has taken some inspiration from [jfelten's helm
|
||||||
|
chart](https://github.com/jfelten/gitea-helm-chart). But takes a completely
|
||||||
|
different approach in providing a database and cache with dependencies.
|
||||||
|
Additionally, this chart provides LDAP and admin user configuration with values,
|
||||||
|
as well as being deployed as a statefulset to retain stored repositories.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
Gitea can be run with an external database and cache. This chart provides those
|
||||||
|
dependencies, which can be enabled, or disabled via
|
||||||
|
configuration.
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
|
||||||
|
- PostgreSQL ([configuration](#postgresql))
|
||||||
|
- Memcached ([configuration](#memcached))
|
||||||
|
- MySQL ([configuration](#mysql))
|
||||||
|
- MariaDB ([configuration](#mariadb))
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
```sh
|
||||||
|
helm repo add gitea-charts https://dl.gitea.io/charts/
|
||||||
|
helm repo update
|
||||||
|
helm install gitea gitea-charts/gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
When upgrading, please refer to the [Upgrading](#upgrading) section at the bottom
|
||||||
|
of this document for major and breaking changes.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 3.0+
|
||||||
|
- PV provisioner for persistent data support
|
||||||
|
|
||||||
|
## Configure Commit Signing
|
||||||
|
|
||||||
|
When using the rootless image the gpg key folder was is not persistent by
|
||||||
|
default. If you consider using signed commits for internal Gitea activities
|
||||||
|
(e.g. initial commit), you'd need to provide a signing key. Prior to
|
||||||
|
[PR186](https://gitea.com/gitea/helm-chart/pulls/186), imported keys had to be
|
||||||
|
re-imported once the container got replaced by another.
|
||||||
|
|
||||||
|
The mentioned PR introduced a new configuration object `signing` allowing you to
|
||||||
|
configure prerequisites for commit signing. By default this section is disabled
|
||||||
|
to maintain backwards compatibility.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
signing:
|
||||||
|
enabled: false
|
||||||
|
gpgHome: /data/git/.gnupg
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Gitea Configuration
|
||||||
|
|
||||||
|
Gitea offers lots of configuration options. This is fully described in the
|
||||||
|
[Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
config:
|
||||||
|
APP_NAME: "Gitea: With a cup of tea."
|
||||||
|
repository:
|
||||||
|
ROOT: "~/gitea-repositories"
|
||||||
|
repository.pull-request:
|
||||||
|
WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Default Configuration
|
||||||
|
|
||||||
|
This chart will set a few defaults in the Gitea configuration based on the
|
||||||
|
service and ingress settings. All defaults can be overwritten in `gitea.config`.
|
||||||
|
|
||||||
|
INSTALL_LOCK is always set to true, since we want to configure Gitea with this
|
||||||
|
helm chart and everything is taken care of.
|
||||||
|
|
||||||
|
_All default settings are made directly in the generated app.ini, not in the Values._
|
||||||
|
|
||||||
|
#### Database defaults
|
||||||
|
|
||||||
|
If a builtIn database is enabled the database configuration is set
|
||||||
|
automatically. For example, PostgreSQL builtIn will appear in the app.ini as:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
DB_TYPE = postgres
|
||||||
|
HOST = RELEASE-NAME-postgresql.default.svc.cluster.local:5432
|
||||||
|
NAME = gitea
|
||||||
|
PASSWD = gitea
|
||||||
|
USER = gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Memcached defaults
|
||||||
|
|
||||||
|
Memcached is handled the exact same way as database builtIn. Once Memcached
|
||||||
|
builtIn is enabled, this chart will generate the following part in the `app.ini`:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[cache]
|
||||||
|
ADAPTER = memcache
|
||||||
|
ENABLED = true
|
||||||
|
HOST = RELEASE-NAME-memcached.default.svc.cluster.local:11211
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Server defaults
|
||||||
|
|
||||||
|
The server defaults are a bit more complex. If ingress is `enabled`, the
|
||||||
|
`ROOT_URL`, `DOMAIN` and `SSH_DOMAIN` will be set accordingly. `HTTP_PORT`
|
||||||
|
always defaults to `3000` as well as `SSH_PORT` to `22`.
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[server]
|
||||||
|
APP_DATA_PATH = /data
|
||||||
|
DOMAIN = git.example.com
|
||||||
|
HTTP_PORT = 3000
|
||||||
|
PROTOCOL = http
|
||||||
|
ROOT_URL = http://git.example.com
|
||||||
|
SSH_DOMAIN = git.example.com
|
||||||
|
SSH_LISTEN_PORT = 22
|
||||||
|
SSH_PORT = 22
|
||||||
|
ENABLE_PPROF = false
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Metrics defaults
|
||||||
|
|
||||||
|
The Prometheus `/metrics` endpoint is disabled by default.
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[metrics]
|
||||||
|
ENABLED = false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional _app.ini_ settings
|
||||||
|
|
||||||
|
> **The [generic](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default)
|
||||||
|
section cannot be defined that way.**
|
||||||
|
|
||||||
|
Some settings inside _app.ini_ (like passwords or whole authentication configurations)
|
||||||
|
must be considered sensitive and therefore should not be passed via plain text
|
||||||
|
inside the _values.yaml_ file. In times of _GitOps_ the values.yaml could be stored
|
||||||
|
in a Git repository where sensitive data should never be accessible.
|
||||||
|
|
||||||
|
The Helm Chart supports this approach and let the user define custom sources like
|
||||||
|
Kubernetes Secrets to be loaded as environment variables during _app.ini_ creation
|
||||||
|
or update.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
additionalConfigSources:
|
||||||
|
- secret:
|
||||||
|
secretName: gitea-app-ini-oauth
|
||||||
|
- configMap:
|
||||||
|
name: gitea-app-ini-plaintext
|
||||||
|
```
|
||||||
|
|
||||||
|
This would mount the two additional volumes (`oauth` and `some-additionals`)
|
||||||
|
from different sources to the init containerwhere the _app.ini_ gets updated.
|
||||||
|
All files mounted that way will be read and converted to environment variables
|
||||||
|
and then added to the _app.ini_ using [environment-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini).
|
||||||
|
|
||||||
|
The key of such additional source represents the section inside the _app.ini_.
|
||||||
|
The value for each key can be multiline ini-like definitions.
|
||||||
|
|
||||||
|
In example, the referenced `gitea-app-ini-plaintext` could look like this.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: gitea-app-ini-plaintext
|
||||||
|
data:
|
||||||
|
session: |
|
||||||
|
PROVIDER=memory
|
||||||
|
SAME_SITE=strict
|
||||||
|
cron.archive_cleanup: |
|
||||||
|
ENABLED=true
|
||||||
|
```
|
||||||
|
|
||||||
|
Or when using a Kubernetes secret, having the same data structure:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gitea-security-related-configuration
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
security: |
|
||||||
|
PASSWORD_COMPLEXITY=off
|
||||||
|
session: |
|
||||||
|
SAME_SITE=strict
|
||||||
|
```
|
||||||
|
|
||||||
|
#### User defined environment variables in app.ini
|
||||||
|
|
||||||
|
Users are able to define their own environment variables,
|
||||||
|
which are loaded into the containers. We also support to
|
||||||
|
directly interact with the generated _app.ini_.
|
||||||
|
|
||||||
|
To inject self defined variables into the _app.ini_ a
|
||||||
|
certain format needs to be honored. This is
|
||||||
|
described in detail on the [env-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini)
|
||||||
|
page.
|
||||||
|
|
||||||
|
Note that the Prefix on this helm chart is `ENV_TO_INI`.
|
||||||
|
|
||||||
|
For example a database setting needs to have the following
|
||||||
|
format:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
additionalConfigFromEnvs:
|
||||||
|
- name: ENV_TO_INI__DATABASE__HOST
|
||||||
|
value: my.own.host
|
||||||
|
- name: ENV_TO_INI__DATABASE__PASSWD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgres-secret
|
||||||
|
key: password
|
||||||
|
```
|
||||||
|
|
||||||
|
Priority (highest to lowest) for defining app.ini variables:
|
||||||
|
|
||||||
|
1. Environment variables prefixed with `ENV_TO_INI`
|
||||||
|
2. Additional config sources
|
||||||
|
3. Values defined in `gitea.config`
|
||||||
|
|
||||||
|
### External Database
|
||||||
|
|
||||||
|
An external Database can be used instead of builtIn PostgreSQL or MySQL.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
config:
|
||||||
|
database:
|
||||||
|
DB_TYPE: mysql
|
||||||
|
HOST: 127.0.0.1:3306
|
||||||
|
NAME: gitea
|
||||||
|
USER: root
|
||||||
|
PASSWD: gitea
|
||||||
|
SCHEMA: gitea
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ports and external url
|
||||||
|
|
||||||
|
By default port `3000` is used for web traffic and `22` for ssh. Those can be changed:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
service:
|
||||||
|
http:
|
||||||
|
port: 3000
|
||||||
|
ssh:
|
||||||
|
port: 22
|
||||||
|
```
|
||||||
|
|
||||||
|
This helm chart automatically configures the clone urls to use the correct
|
||||||
|
ports. You can change these ports by hand using the `gitea.config` dict. However
|
||||||
|
you should know what you're doing.
|
||||||
|
|
||||||
|
### ClusterIP
|
||||||
|
|
||||||
|
By default the clusterIP will be set to None, which is the default for headless
|
||||||
|
services. However if you want to omit the clusterIP field in the service, use
|
||||||
|
the following values:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
service:
|
||||||
|
http:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 3000
|
||||||
|
clusterIP:
|
||||||
|
ssh:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 22
|
||||||
|
clusterIP:
|
||||||
|
```
|
||||||
|
|
||||||
|
### SSH and Ingress
|
||||||
|
|
||||||
|
If you're using ingress and want to use SSH, keep in mind, that ingress is not
|
||||||
|
able to forward SSH Ports. You will need a LoadBalancer like `metallb` and a
|
||||||
|
setting in your ssh service annotations.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
service:
|
||||||
|
ssh:
|
||||||
|
annotations:
|
||||||
|
metallb.universe.tf/allow-shared-ip: test
|
||||||
|
```
|
||||||
|
|
||||||
|
### SSH on crio based kubernetes cluster
|
||||||
|
|
||||||
|
If you use crio as container runtime it is not possible to read from a remote
|
||||||
|
repository. You should get an error message like this:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git clone git@k8s-demo.internal:admin/test.git
|
||||||
|
Cloning into 'test'...
|
||||||
|
Connection reset by 192.168.179.217 port 22
|
||||||
|
fatal: Could not read from remote repository.
|
||||||
|
|
||||||
|
Please make sure you have the correct access rights
|
||||||
|
and the repository exists.
|
||||||
|
```
|
||||||
|
|
||||||
|
To solve this problem add the capability `SYS_CHROOT` to the `securityContext`.
|
||||||
|
More about this issue [here](https://gitea.com/gitea/helm-chart/issues/161).
|
||||||
|
|
||||||
|
### Cache
|
||||||
|
|
||||||
|
This helm chart can use a built in cache. The default is Memcached from bitnami.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
memcached:
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
If the built in cache should not be used simply configure the cache in
|
||||||
|
`gitea.config`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
config:
|
||||||
|
cache:
|
||||||
|
ENABLED: true
|
||||||
|
ADAPTER: memory
|
||||||
|
INTERVAL: 60
|
||||||
|
HOST: 127.0.0.1:9090
|
||||||
|
```
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
Gitea will be deployed as a statefulset. By simply enabling the persistence and
|
||||||
|
setting the storage class according to your cluster everything else will be
|
||||||
|
taken care of. The following example will create a PVC as a part of the
|
||||||
|
statefulset. This PVC will not be deleted even if you uninstall the chart.
|
||||||
|
|
||||||
|
Please note, that an empty storageClass in the persistence will result in
|
||||||
|
kubernetes using your default storage class.
|
||||||
|
|
||||||
|
If you want to use your own storageClass define it as followed:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
storageClass: myOwnStorageClass
|
||||||
|
```
|
||||||
|
|
||||||
|
When using PostgreSQL as dependency, this will also be deployed as a statefulset
|
||||||
|
by default.
|
||||||
|
|
||||||
|
If you want to manage your own PVC you can simply pass the PVC name to the chart.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
existingClaim: MyAwesomeGiteaClaim
|
||||||
|
```
|
||||||
|
|
||||||
|
In case that peristence has been disabled it will simply use an empty dir volume.
|
||||||
|
|
||||||
|
PostgreSQL handles the persistence in the exact same way.
|
||||||
|
You can interact with the postgres settings as displayed in the following example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
postgresql:
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
existingClaim: MyAwesomeGiteaPostgresClaim
|
||||||
|
```
|
||||||
|
|
||||||
|
MySQL also handles persistence the same, even though it is not deployed as a statefulset.
|
||||||
|
You can interact with the postgres settings as displayed in the following example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
mysql:
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
existingClaim: MyAwesomeGiteaMysqlClaim
|
||||||
|
```
|
||||||
|
|
||||||
|
### Admin User
|
||||||
|
|
||||||
|
This chart enables you to create a default admin user. It is also possible to
|
||||||
|
update the password for this user by upgrading or redeloying the chart. It is
|
||||||
|
not possible to delete an admin user after it has been created. This has to be
|
||||||
|
done in the ui. You cannot use `admin` as username.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
admin:
|
||||||
|
username: "MyAwesomeGiteaAdmin"
|
||||||
|
password: "AReallyAwesomeGiteaPassword"
|
||||||
|
email: "gi@tea.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use an existing Secret to configure the admin user:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gitea-admin-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
username: MyAwesomeGiteaAdmin
|
||||||
|
password: AReallyAwesomeGiteaPassword
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
admin:
|
||||||
|
existingSecret: gitea-admin-secret
|
||||||
|
```
|
||||||
|
|
||||||
|
### LDAP Settings
|
||||||
|
|
||||||
|
Like the admin user the LDAP settings can be updated.
|
||||||
|
All LDAP values from <https://docs.gitea.io/en-us/command-line/#admin> are available.
|
||||||
|
|
||||||
|
Multiple LDAP sources can be configured with additional LDAP list items.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
ldap:
|
||||||
|
- name: MyAwesomeGiteaLdap
|
||||||
|
securityProtocol: unencrypted
|
||||||
|
host: "127.0.0.1"
|
||||||
|
port: "389"
|
||||||
|
userSearchBase: ou=Users,dc=example,dc=com
|
||||||
|
userFilter: sAMAccountName=%s
|
||||||
|
adminFilter: CN=Admin,CN=Group,DC=example,DC=com
|
||||||
|
emailAttribute: mail
|
||||||
|
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
|
||||||
|
bindPassword: JustAnotherBindPw
|
||||||
|
usernameAttribute: CN
|
||||||
|
publicSSHKeyAttribute: publicSSHKey
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use an existing secret to set the bindDn and bindPassword:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gitea-ldap-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
|
||||||
|
bindPassword: JustAnotherBindPw
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
ldap:
|
||||||
|
- existingSecret: gitea-ldap-secret
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Some options are just flags and therefore don't have any values. If they
|
||||||
|
are defined in `gitea.ldap` configuration, they will be passed to the Gitea CLI
|
||||||
|
without any value. Affected options:
|
||||||
|
|
||||||
|
- notActive
|
||||||
|
- skipTlsVerify
|
||||||
|
- allowDeactivateAll
|
||||||
|
- synchronizeUsers
|
||||||
|
- attributesInBind
|
||||||
|
|
||||||
|
### OAuth2 Settings
|
||||||
|
|
||||||
|
Like the admin user, OAuth2 settings can be updated and disabled but not
|
||||||
|
deleted. Deleting OAuth2 settings has to be done in the ui. All OAuth2 values,
|
||||||
|
which are documented [here](https://docs.gitea.io/en-us/command-line/#admin), are
|
||||||
|
available.
|
||||||
|
|
||||||
|
Multiple OAuth2 sources can be configured with additional OAuth list items.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
oauth:
|
||||||
|
- name: 'MyAwesomeGiteaOAuth'
|
||||||
|
provider: 'openidConnect'
|
||||||
|
key: 'hello'
|
||||||
|
secret: 'world'
|
||||||
|
autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration'
|
||||||
|
#useCustomUrls:
|
||||||
|
#customAuthUrl:
|
||||||
|
#customTokenUrl:
|
||||||
|
#customProfileUrl:
|
||||||
|
#customEmailUrl:
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use an existing secret to set the `key` and `secret`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gitea-oauth-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
key: hello
|
||||||
|
secret: world
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
oauth:
|
||||||
|
- name: 'MyAwesomeGiteaOAuth'
|
||||||
|
existingSecret: gitea-oauth-secret
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Metrics and profiling
|
||||||
|
|
||||||
|
A Prometheus `/metrics` endpoint on the `HTTP_PORT` and `pprof` profiling
|
||||||
|
endpoints on port 6060 can be enabled under `gitea`. Beware that the metrics
|
||||||
|
endpoint is exposed via the ingress, manage access using ingress annotations for
|
||||||
|
example.
|
||||||
|
|
||||||
|
To deploy the `ServiceMonitor`, you first need to ensure that you have deployed
|
||||||
|
`prometheus-operator` and its
|
||||||
|
[CRDs](https://github.com/prometheus-operator/prometheus-operator#customresourcedefinitions).
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
metrics:
|
||||||
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
config:
|
||||||
|
server:
|
||||||
|
ENABLE_PPROF: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pod Annotations
|
||||||
|
|
||||||
|
Annotations can be added to the Gitea pod.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
podAnnotations: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### Global
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------- | ------------------------------------------------------------------------- | --------------- |
|
||||||
|
| `global.imageRegistry` | global image registry override | `""` |
|
||||||
|
| `global.imagePullSecrets` | global image pull secrets override; can be extended by `imagePullSecrets` | `[]` |
|
||||||
|
| `global.storageClass` | global storage class override | `""` |
|
||||||
|
| `replicaCount` | number of replicas for the statefulset | `1` |
|
||||||
|
| `clusterDomain` | cluster domain | `cluster.local` |
|
||||||
|
|
||||||
|
### Image
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
||||||
|
| `image.registry` | image registry, e.g. gcr.io,docker.io | `""` |
|
||||||
|
| `image.repository` | Image to start for this pod | `gitea/gitea` |
|
||||||
|
| `image.tag` | Visit: [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated). Defaults to `appVersion` within Chart.yaml. | `""` |
|
||||||
|
| `image.pullPolicy` | Image pull policy | `Always` |
|
||||||
|
| `image.rootless` | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `false` |
|
||||||
|
| `imagePullSecrets` | Secret to use for pulling the image | `[]` |
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ---------------------------- | --------------------------------------------------------------- | ------ |
|
||||||
|
| `podSecurityContext.fsGroup` | Set the shared file system group for all containers in the pod. | `1000` |
|
||||||
|
| `containerSecurityContext` | Security context | `{}` |
|
||||||
|
| `securityContext` | Run init and Gitea containers as a specific securityContext | `{}` |
|
||||||
|
|
||||||
|
### Service
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
||||||
|
| `service.http.type` | Kubernetes service type for web traffic | `ClusterIP` |
|
||||||
|
| `service.http.port` | Port number for web traffic | `3000` |
|
||||||
|
| `service.http.clusterIP` | ClusterIP setting for http autosetup for statefulset is None | `None` |
|
||||||
|
| `service.http.loadBalancerIP` | LoadBalancer IP setting | `nil` |
|
||||||
|
| `service.http.nodePort` | NodePort for http service | `nil` |
|
||||||
|
| `service.http.externalTrafficPolicy` | If `service.http.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation | `nil` |
|
||||||
|
| `service.http.externalIPs` | External IPs for service | `nil` |
|
||||||
|
| `service.http.ipFamilyPolicy` | HTTP service dual-stack policy | `nil` |
|
||||||
|
| `service.http.ipFamilies` | HTTP service dual-stack familiy selection,for dual-stack parameters see official kubernetes [dual-stack concept documentation](https://kubernetes.io/docs/concepts/services-networking/dual-stack/). | `nil` |
|
||||||
|
| `service.http.loadBalancerSourceRanges` | Source range filter for http loadbalancer | `[]` |
|
||||||
|
| `service.http.annotations` | HTTP service annotations | `{}` |
|
||||||
|
| `service.ssh.type` | Kubernetes service type for ssh traffic | `ClusterIP` |
|
||||||
|
| `service.ssh.port` | Port number for ssh traffic | `22` |
|
||||||
|
| `service.ssh.clusterIP` | ClusterIP setting for ssh autosetup for statefulset is None | `None` |
|
||||||
|
| `service.ssh.loadBalancerIP` | LoadBalancer IP setting | `nil` |
|
||||||
|
| `service.ssh.nodePort` | NodePort for ssh service | `nil` |
|
||||||
|
| `service.ssh.externalTrafficPolicy` | If `service.ssh.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation | `nil` |
|
||||||
|
| `service.ssh.externalIPs` | External IPs for service | `nil` |
|
||||||
|
| `service.ssh.ipFamilyPolicy` | SSH service dual-stack policy | `nil` |
|
||||||
|
| `service.ssh.ipFamilies` | SSH service dual-stack familiy selection,for dual-stack parameters see official kubernetes [dual-stack concept documentation](https://kubernetes.io/docs/concepts/services-networking/dual-stack/). | `nil` |
|
||||||
|
| `service.ssh.hostPort` | HostPort for ssh service | `nil` |
|
||||||
|
| `service.ssh.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` |
|
||||||
|
| `service.ssh.annotations` | SSH service annotations | `{}` |
|
||||||
|
|
||||||
|
### Ingress
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------ | --------------------------------------------------------------------------- | ----------------- |
|
||||||
|
| `ingress.enabled` | Enable ingress | `false` |
|
||||||
|
| `ingress.className` | Ingress class name | `nil` |
|
||||||
|
| `ingress.annotations` | Ingress annotations | `{}` |
|
||||||
|
| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` |
|
||||||
|
| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` |
|
||||||
|
| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` |
|
||||||
|
| `ingress.tls` | Ingress tls settings | `[]` |
|
||||||
|
| `ingress.apiVersion` | Specify APIVersion of ingress object. Mostly would only be used for argocd. | |
|
||||||
|
|
||||||
|
### StatefulSet
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------------- | ------------------------------------------------------ | ----- |
|
||||||
|
| `resources` | Kubernetes resources | `{}` |
|
||||||
|
| `schedulerName` | Use an alternate scheduler, e.g. "stork" | `""` |
|
||||||
|
| `nodeSelector` | NodeSelector for the statefulset | `{}` |
|
||||||
|
| `tolerations` | Tolerations for the statefulset | `[]` |
|
||||||
|
| `affinity` | Affinity for the statefulset | `{}` |
|
||||||
|
| `dnsConfig` | dnsConfig for the statefulset | `{}` |
|
||||||
|
| `statefulset.env` | Additional environment variables to pass to containers | `[]` |
|
||||||
|
| `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
|
||||||
|
| `statefulset.labels` | Labels for the statefulset | `{}` |
|
||||||
|
| `statefulset.annotations` | Annotations for the Gitea StatefulSet to be created | `{}` |
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ---------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------- |
|
||||||
|
| `persistence.enabled` | Enable persistent storage | `true` |
|
||||||
|
| `persistence.existingClaim` | Use an existing claim to store repository information | `nil` |
|
||||||
|
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
|
||||||
|
| `persistence.accessModes` | AccessMode for persistence | `["ReadWriteOnce"]` |
|
||||||
|
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
|
||||||
|
| `persistence.annotations` | Annotations for the persistence volume claim to be created | `{}` |
|
||||||
|
| `persistence.storageClass` | Name of the storage class to use | `nil` |
|
||||||
|
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
||||||
|
| `extraVolumes` | Additional volumes to mount to the Gitea statefulset | `[]` |
|
||||||
|
| `extraContainerVolumeMounts` | Mounts that are only mapped into the Gitea runtime/main container, to e.g. override custom templates. | `[]` |
|
||||||
|
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
|
||||||
|
| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Gitea main container | `[]` |
|
||||||
|
|
||||||
|
### Init
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| --------------- | --------------------------------------------------------------------- | ----- |
|
||||||
|
| `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` |
|
||||||
|
|
||||||
|
### Signing
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ----------------- | ---------------------------- | ------------------ |
|
||||||
|
| `signing.enabled` | Enable commit/action signing | `false` |
|
||||||
|
| `signing.gpgHome` | GPG home directory | `/data/git/.gnupg` |
|
||||||
|
|
||||||
|
### Gitea
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||||
|
| `gitea.admin.username` | Username for the Gitea admin user | `gitea_admin` |
|
||||||
|
| `gitea.admin.existingSecret` | Use an existing secret to store admin user credentials | `nil` |
|
||||||
|
| `gitea.admin.password` | Password for the Gitea admin user | `r8sA8CPHD9!bt6d` |
|
||||||
|
| `gitea.admin.email` | Email for the Gitea admin user | `gitea@local.domain` |
|
||||||
|
| `gitea.metrics.enabled` | Enable Gitea metrics | `false` |
|
||||||
|
| `gitea.metrics.serviceMonitor.enabled` | Enable Gitea metrics service monitor | `false` |
|
||||||
|
| `gitea.ldap` | LDAP configuration | `[]` |
|
||||||
|
| `gitea.oauth` | OAuth configuration | `[]` |
|
||||||
|
| `gitea.config` | Configuration for the Gitea server,ref: [config-cheat-sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) | `{}` |
|
||||||
|
| `gitea.additionalConfigSources` | Additional configuration from secret or configmap | `[]` |
|
||||||
|
| `gitea.additionalConfigFromEnvs` | Additional configuration sources from environment variables | `[]` |
|
||||||
|
| `gitea.podAnnotations` | Annotations for the Gitea pod | `{}` |
|
||||||
|
|
||||||
|
### LivenessProbe
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ----------------------------------------- | ------------------------------------------------ | ------ |
|
||||||
|
| `gitea.livenessProbe.enabled` | Enable liveness probe | `true` |
|
||||||
|
| `gitea.livenessProbe.tcpSocket.port` | Port to probe for liveness | `http` |
|
||||||
|
| `gitea.livenessProbe.initialDelaySeconds` | Initial delay before liveness probe is initiated | `200` |
|
||||||
|
| `gitea.livenessProbe.timeoutSeconds` | Timeout for liveness probe | `1` |
|
||||||
|
| `gitea.livenessProbe.periodSeconds` | Period for liveness probe | `10` |
|
||||||
|
| `gitea.livenessProbe.successThreshold` | Success threshold for liveness probe | `1` |
|
||||||
|
| `gitea.livenessProbe.failureThreshold` | Failure threshold for liveness probe | `10` |
|
||||||
|
|
||||||
|
### ReadinessProbe
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------------ | ------------------------------------------------- | ------ |
|
||||||
|
| `gitea.readinessProbe.enabled` | Enable readiness probe | `true` |
|
||||||
|
| `gitea.readinessProbe.tcpSocket.port` | Port to probe for readiness | `http` |
|
||||||
|
| `gitea.readinessProbe.initialDelaySeconds` | Initial delay before readiness probe is initiated | `5` |
|
||||||
|
| `gitea.readinessProbe.timeoutSeconds` | Timeout for readiness probe | `1` |
|
||||||
|
| `gitea.readinessProbe.periodSeconds` | Period for readiness probe | `10` |
|
||||||
|
| `gitea.readinessProbe.successThreshold` | Success threshold for readiness probe | `1` |
|
||||||
|
| `gitea.readinessProbe.failureThreshold` | Failure threshold for readiness probe | `3` |
|
||||||
|
|
||||||
|
### StartupProbe
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ---------------------------------------- | ----------------------------------------------- | ------- |
|
||||||
|
| `gitea.startupProbe.enabled` | Enable startup probe | `false` |
|
||||||
|
| `gitea.startupProbe.tcpSocket.port` | Port to probe for startup | `http` |
|
||||||
|
| `gitea.startupProbe.initialDelaySeconds` | Initial delay before startup probe is initiated | `60` |
|
||||||
|
| `gitea.startupProbe.timeoutSeconds` | Timeout for startup probe | `1` |
|
||||||
|
| `gitea.startupProbe.periodSeconds` | Period for startup probe | `10` |
|
||||||
|
| `gitea.startupProbe.successThreshold` | Success threshold for startup probe | `1` |
|
||||||
|
| `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe | `10` |
|
||||||
|
|
||||||
|
### Memcached
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||||
|
| `memcached.enabled` | Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website. | `true` |
|
||||||
|
| `memcached.service.port` | Port for Memcached | `11211` |
|
||||||
|
|
||||||
|
### PostgreSQL
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------------------- | -------------------------------------------------------- | ------- |
|
||||||
|
| `postgresql.enabled` | Enable PostgreSQL | `true` |
|
||||||
|
| `postgresql.global.postgresql.postgresqlDatabase` | PostgreSQL database (overrides postgresqlDatabase) | `gitea` |
|
||||||
|
| `postgresql.global.postgresql.postgresqlUsername` | PostgreSQL username (overrides postgresqlUsername) | `gitea` |
|
||||||
|
| `postgresql.global.postgresql.postgresqlPassword` | PostgreSQL admin password (overrides postgresqlPassword) | `gitea` |
|
||||||
|
| `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` |
|
||||||
|
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` |
|
||||||
|
|
||||||
|
### MySQL
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------ | ------------------------------------------------------------------ | ------- |
|
||||||
|
| `mysql.enabled` | Enable MySQL | `false` |
|
||||||
|
| `mysql.root.password` | Password for the root user. Ignored if existing secret is provided | `gitea` |
|
||||||
|
| `mysql.db.user` | Username of new user to create. | `gitea` |
|
||||||
|
| `mysql.db.password` | Password for the new user.Ignored if existing secret is provided | `gitea` |
|
||||||
|
| `mysql.db.name` | Name for new database to create. | `gitea` |
|
||||||
|
| `mysql.service.port` | Port to connect to MySQL service | `3306` |
|
||||||
|
| `mysql.persistence.size` | PVC Storage Request for MySQL volume | `10Gi` |
|
||||||
|
|
||||||
|
### MariaDB
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ---------------------------------- | ----------------------------------------------------------------- | ------- |
|
||||||
|
| `mariadb.enabled` | Enable MariaDB | `false` |
|
||||||
|
| `mariadb.auth.database` | Name of the database to create. | `gitea` |
|
||||||
|
| `mariadb.auth.username` | Username of the new user to create. | `gitea` |
|
||||||
|
| `mariadb.auth.password` | Password for the new user. Ignored if existing secret is provided | `gitea` |
|
||||||
|
| `mariadb.auth.rootPassword` | Password for the root user. | `gitea` |
|
||||||
|
| `mariadb.primary.service.port` | Port to connect to MariaDB service | `3306` |
|
||||||
|
| `mariadb.primary.persistence.size` | Persistence size for MariaDB | `10Gi` |
|
||||||
|
|
||||||
|
### Advanced
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------ | ---------------------------------------------------- | ------ |
|
||||||
|
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Expected workflow is: Fork -> Patch -> Push -> Pull Request
|
||||||
|
|
||||||
|
See [CONTRIBUTORS GUIDE](CONTRIBUTING.md) for details.
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
This section lists major and breaking changes of each Helm Chart version.
|
||||||
|
Please read them carefully to upgrade successfully.
|
||||||
|
|
||||||
|
### To 6.0.0
|
||||||
|
|
||||||
|
#### Different volume mounts for init-containers and runtime container
|
||||||
|
|
||||||
|
**The `extraVolumeMounts` is deprecated** in favor of `extraInitVolumeMounts` and
|
||||||
|
`extraContainerVolumeMounts`. You can now have different mounts for the initialization
|
||||||
|
phase and Gitea runtime. The deprecated `extraVolumeMounts` will still be available
|
||||||
|
for the time being and is mounted into every container. If you want to switch to
|
||||||
|
the new settings and want to mount specific volumes into all containers, you have
|
||||||
|
to configure their mount points within both new settings.
|
||||||
|
|
||||||
|
**Combining values from the deprecated setting with values from the new settings
|
||||||
|
is not possible.**
|
||||||
|
|
||||||
|
#### New `enabled` flag for `startupProbe`
|
||||||
|
|
||||||
|
Prior to this version the `startupProbe` was just a commented sample within the
|
||||||
|
`values.yaml`. With the migration to an auto-generated [Parameters](#parameters)
|
||||||
|
section, a new parameter `gitea.startupProbe.enabled` has been introduced set to
|
||||||
|
`false` by default.
|
||||||
|
|
||||||
|
If you are using the `startupProbe` you need to add that new
|
||||||
|
parameter and set it to `true`. Otherwise, your defined probe won't be considered
|
||||||
|
after the upgrade.
|
||||||
|
|
||||||
|
### To 5.0.0
|
||||||
|
|
||||||
|
> 💥 The Helm Chart now requires Gitea versions of at least 1.11.0.
|
||||||
|
|
||||||
|
#### Enable Dependencies
|
||||||
|
|
||||||
|
The values to enable the dependencies,
|
||||||
|
such as PostgreSQL, Memcached, MySQL and MariaDB
|
||||||
|
have been moved from `gitea.database.builtIn.` to the dependency values.
|
||||||
|
|
||||||
|
You can now enable the dependencies as followed:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
memcached:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
enabled: false
|
||||||
|
```
|
||||||
|
|
||||||
|
#### App.ini generation
|
||||||
|
|
||||||
|
The app.ini generation has changed and now utilizes the environment-to-ini
|
||||||
|
script provided by newer Gitea versions. This change ensures, that the app.ini
|
||||||
|
is now persistent.
|
||||||
|
|
||||||
|
##### Secret Key generation
|
||||||
|
|
||||||
|
Gitea secret keys (SECRET_KEY, INTERNAL_TOKEN, JWT_SECRET) are now generated
|
||||||
|
automatically in certain situations:
|
||||||
|
|
||||||
|
- New install: By default the secrets are created automatically. If you provide
|
||||||
|
secrets via `gitea.config` they will be used instead of automatic generation.
|
||||||
|
- Existing installs: The secrets won't be deployed, neither via
|
||||||
|
configuration nor via auto generation. We explicitly prevent to set new secrets.
|
||||||
|
|
||||||
|
> 💡 It would be possible to set new secret keys manually by entering
|
||||||
|
the running container and rewriting the app.ini by hand. However, this it is
|
||||||
|
not advisable to do so for existing installations. Certain settings like
|
||||||
|
_LDAP_ would not be readable anymore.
|
||||||
|
|
||||||
|
#### Probes
|
||||||
|
|
||||||
|
`gitea.customLivenessProbe`, `gitea.customReadinessProbe` and `gitea.customStartupProbe`
|
||||||
|
have been removed.
|
||||||
|
|
||||||
|
They are replaced by the settings `gitea.livenessProbe`, `gitea.readinessProbe`
|
||||||
|
and `gitea.startupProbe` which are now fully configurable and used _as-is_ for
|
||||||
|
a Chart deployment.
|
||||||
|
If you have customized their values instead of using the `custom` prefixed settings,
|
||||||
|
please ensure that you remove the `enabled` property from each of them.
|
||||||
|
|
||||||
|
In case you want to disable one of these probes, let's say the `livenessProbe`, add
|
||||||
|
the following to your values. The `podAnnotation` is just there to have a bit more
|
||||||
|
context.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
gitea:
|
||||||
|
+ livenessProbe:
|
||||||
|
podAnnotations: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Multiple OAuth and LDAP authentication sources
|
||||||
|
|
||||||
|
With `5.0.0` of this Chart it is now possible to configure Gitea with multiple
|
||||||
|
OAuth and LDAP sources. As a result, you need to update an existing OAuth/LDAP configuration
|
||||||
|
in your customized `values.yaml` by replacing the object with settings to a list
|
||||||
|
of settings objects. See [OAuth2 Settings](#oauth2-settings) and
|
||||||
|
[LDAP Settings](#ldap-settings) section for details.
|
||||||
|
|
||||||
|
### To 4.0.0
|
||||||
|
|
||||||
|
#### Ingress changes
|
||||||
|
|
||||||
|
To provide a more flexible Ingress configuration we now support not only host
|
||||||
|
settings but also provide configuration for the path and pathType. So this
|
||||||
|
change changes the hosts from a simple string list, to a list containing a more
|
||||||
|
complex object for more configuration.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
annotations: {}
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
- hosts:
|
||||||
|
- - git.example.com
|
||||||
|
+ hosts:
|
||||||
|
+ - host: git.example.com
|
||||||
|
+ paths:
|
||||||
|
+ - path: /
|
||||||
|
+ pathType: Prefix
|
||||||
|
tls: []
|
||||||
|
# - secretName: chart-example-tls
|
||||||
|
# hosts:
|
||||||
|
# - git.example.com
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want everything as it was before, you can simply add the following code
|
||||||
|
to all your host entries.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Dropped kebab-case support
|
||||||
|
|
||||||
|
In 3.x.x it was possible to provide an ldap configuration via kebab-case, this
|
||||||
|
support has now been dropped and only camel case is supported. See [LDAP
|
||||||
|
section](#ldap-settings) for more information.
|
||||||
|
|
||||||
|
#### Dependency update
|
||||||
|
|
||||||
|
The chart comes with multiple databases and Memcached as dependency, the latest
|
||||||
|
release updated the dependencies.
|
||||||
|
|
||||||
|
- Memcached: `4.2.20` -> `5.9.0`
|
||||||
|
- PostgreSQL: `9.7.2` -> `10.3.17`
|
||||||
|
- MariaDB: `8.0.0` -> `9.3.6`
|
||||||
|
|
||||||
|
If you're using the builtin databases you will most likely redeploy the chart in
|
||||||
|
order to update the database correctly.
|
||||||
|
|
||||||
|
#### Execution of initPreScript
|
||||||
|
|
||||||
|
Generally spoken, this might not be a breaking change, but it is worth to be
|
||||||
|
mentioned.
|
||||||
|
|
||||||
|
Prior to `4.0.0` only one init container was used to both setup directories and
|
||||||
|
configure Gitea. As of now the actual Gitea configuration is separated from the
|
||||||
|
other pre-execution. This also includes the execution of _initPreScript_. If you
|
||||||
|
have such script, please be aware of this. Dynamically prepare the Gitea setup
|
||||||
|
during execution by e.g. adding environment variables to the execution context
|
||||||
|
won't work anymore.
|
||||||
|
|
||||||
|
### Misc
|
||||||
|
|
||||||
|
#### Gitea Version 1.14.X repository ROOT
|
||||||
|
|
||||||
|
Previously the ROOT folder for the Gitea repositories was located at
|
||||||
|
`/data/git/gitea-repositories`. In version `1.14` has the path been changed to
|
||||||
|
`/data/gitea-repositories`.
|
||||||
|
|
||||||
|
This chart will set the `gitea.config.repository.ROOT` value default to
|
||||||
|
`/data/git/gitea-repositories`.
|
||||||
21
gitea/charts/mariadb/.helmignore
Normal file
21
gitea/charts/mariadb/.helmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
6
gitea/charts/mariadb/Chart.lock
Normal file
6
gitea/charts/mariadb/Chart.lock
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
version: 1.4.1
|
||||||
|
digest: sha256:81be4c0ebd0a81952423b24268e82697231b8c07991ee60b23b950ff1db003a2
|
||||||
|
generated: "2021-03-24T01:26:15.013812575Z"
|
||||||
30
gitea/charts/mariadb/Chart.yaml
Normal file
30
gitea/charts/mariadb/Chart.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
annotations:
|
||||||
|
category: Database
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 10.5.9
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 1.x.x
|
||||||
|
description: Fast, reliable, scalable, and easy to use open-source relational database
|
||||||
|
system. MariaDB Server is intended for mission-critical, heavy-load production systems
|
||||||
|
as well as for embedding into mass-deployed software. Highly available MariaDB cluster.
|
||||||
|
home: https://github.com/bitnami/charts/tree/master/bitnami/mariadb
|
||||||
|
icon: https://bitnami.com/assets/stacks/mariadb/img/mariadb-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- mariadb
|
||||||
|
- mysql
|
||||||
|
- database
|
||||||
|
- sql
|
||||||
|
- prometheus
|
||||||
|
maintainers:
|
||||||
|
- email: containers@bitnami.com
|
||||||
|
name: Bitnami
|
||||||
|
name: mariadb
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/bitnami-docker-mariadb
|
||||||
|
- https://github.com/prometheus/mysqld_exporter
|
||||||
|
- https://mariadb.org
|
||||||
|
version: 9.3.6
|
||||||
391
gitea/charts/mariadb/README.md
Normal file
391
gitea/charts/mariadb/README.md
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
# MariaDB
|
||||||
|
|
||||||
|
[MariaDB](https://mariadb.org) is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, Facebook and Google.
|
||||||
|
|
||||||
|
MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
|
$ helm install my-release bitnami/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart bootstraps a [MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) replication cluster deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the [BKPR](https://kubeprod.io/).
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 3.1.0
|
||||||
|
- PV provisioner support in the underlying infrastructure
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
To install the chart with the release name `my-release`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install my-release bitnami/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
The command deploys MariaDB on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||||
|
|
||||||
|
> **Tip**: List all releases using `helm list`
|
||||||
|
|
||||||
|
## Uninstalling the Chart
|
||||||
|
|
||||||
|
To uninstall/delete the `my-release` deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm delete my-release
|
||||||
|
```
|
||||||
|
|
||||||
|
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the configurable parameters of the MariaDB chart and their default values.
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|---------------------------|-------------------------------------------------|---------------------------------------------------------|
|
||||||
|
| `global.imageRegistry` | Global Docker Image registry | `nil` |
|
||||||
|
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||||
|
|
||||||
|
### Common parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|---------------------|-----------------------------------------------------------------------------|-----------------|
|
||||||
|
| `nameOverride` | String to partially override mariadb.fullname | `nil` |
|
||||||
|
| `fullnameOverride` | String to fully override mariadb.fullname | `nil` |
|
||||||
|
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||||
|
| `commonLabels` | Labels to add to all deployed objects | `nil` |
|
||||||
|
| `commonAnnotations` | Annotations to add to all deployed objects | `[]` |
|
||||||
|
| `schedulerName` | Name of the scheduler (other than default) to dispatch pods | `nil` |
|
||||||
|
| `extraDeploy` | Array of extra objects to deploy with the release (evaluated as a template) | `nil` |
|
||||||
|
|
||||||
|
### MariaDB common parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||||
|
| `image.registry` | MariaDB image registry | `docker.io` |
|
||||||
|
| `image.repository` | MariaDB image name | `bitnami/mariadb` |
|
||||||
|
| `image.tag` | MariaDB image tag | `{TAG_NAME}` |
|
||||||
|
| `image.pullPolicy` | MariaDB image pull policy | `IfNotPresent` |
|
||||||
|
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
| `image.debug` | Specify if debug logs should be enabled | `false` |
|
||||||
|
| `architecture` | MariaDB architecture (`standalone` or `replication`) | `standalone` |
|
||||||
|
| `auth.rootPassword` | Password for the `root` user. Ignored if existing secret is provided. | _random 10 character alphanumeric string_ |
|
||||||
|
| `auth.database` | Name for a custom database to create | `my_database` |
|
||||||
|
| `auth.username` | Name for a custom user to create | `""` |
|
||||||
|
| `auth.password` | Password for the new user. Ignored if existing secret is provided | _random 10 character long alphanumeric string_ |
|
||||||
|
| `auth.replicationUser` | MariaDB replication user | `nil` |
|
||||||
|
| `auth.replicationPassword` | MariaDB replication user password. Ignored if existing secret is provided | _random 10 character long alphanumeric string_ |
|
||||||
|
| `auth.forcePassword` | Force users to specify required passwords | `false` |
|
||||||
|
| `auth.usePasswordFiles` | Mount credentials as a files instead of using an environment variable | `false` |
|
||||||
|
| `auth.customPasswordFiles` | Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication` | `{}` |
|
||||||
|
| `auth.existingSecret` | Use existing secret for password details (`auth.rootPassword`, `auth.password`, `auth.replicationPassword` will be ignored and picked up from this secret). The secret has to contain the keys `mariadb-root-password`, `mariadb-replication-password` and `mariadb-password` | `nil` |
|
||||||
|
| `initdbScripts` | Dictionary of initdb scripts | `nil` |
|
||||||
|
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `nil` |
|
||||||
|
|
||||||
|
### MariaDB Primary parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------|--------------------------------|
|
||||||
|
| `primary.command` | Override default container command on MariaDB Primary container(s) (useful when using custom images) | `nil` |
|
||||||
|
| `primary.args` | Override default container args on MariaDB Primary container(s) (useful when using custom images) | `nil` |
|
||||||
|
| `primary.configuration` | MariaDB Primary configuration to be injected as ConfigMap | Check `values.yaml` file |
|
||||||
|
| `primary.existingConfigmap` | Name of existing ConfigMap with MariaDB Primary configuration | `nil` |
|
||||||
|
| `primary.hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `primary.updateStrategy` | Update strategy type for the MariaDB primary statefulset | `RollingUpdate` |
|
||||||
|
| `primary.podAnnotations` | Additional pod annotations for MariaDB primary pods | `{}` (evaluated as a template) |
|
||||||
|
| `primary.podLabels` | Additional pod labels for MariaDB primary pods | `{}` (evaluated as a template) |
|
||||||
|
| `primary.podAffinityPreset` | MariaDB primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `primary.podAntiAffinityPreset` | MariaDB primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||||
|
| `primary.nodeAffinityPreset.type` | MariaDB primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `primary.nodeAffinityPreset.key` | MariaDB primary node label key to match Ignored if `primary.affinity` is set. | `""` |
|
||||||
|
| `primary.nodeAffinityPreset.values` | MariaDB primary node label values to match. Ignored if `primary.affinity` is set. | `[]` |
|
||||||
|
| `primary.affinity` | Affinity for MariaDB primary pods assignment | `{}` (evaluated as a template) |
|
||||||
|
| `primary.nodeSelector` | Node labels for MariaDB primary pods assignment | `{}` (evaluated as a template) |
|
||||||
|
| `primary.tolerations` | Tolerations for MariaDB primary pods assignment | `[]` (evaluated as a template) |
|
||||||
|
| `primary.priorityClassName` | Priority class for MariaDB primary pods assignment | `nil` |
|
||||||
|
| `primary.podSecurityContext.enabled` | Enable security context for MariaDB primary pods | `true` |
|
||||||
|
| `primary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
|
||||||
|
| `primary.containerSecurityContext.enabled` | MariaDB primary container securityContext | `true` |
|
||||||
|
| `primary.containerSecurityContext.runAsUser` | User ID for the MariaDB primary container | `1001` |
|
||||||
|
| `primary.livenessProbe` | Liveness probe configuration for MariaDB primary containers | Check `values.yaml` file |
|
||||||
|
| `primary.readinessProbe` | Readiness probe configuration for MariaDB primary containers | Check `values.yaml` file |
|
||||||
|
| `primary.customLivenessProbe` | Override default liveness probe for MariaDB primary containers | `nil` |
|
||||||
|
| `primary.customReadinessProbe` | Override default readiness probe for MariaDB primary containers | `nil` |
|
||||||
|
| `primary.resources.limits` | The resources limits for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.resources.requests` | The requested resources for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.extraEnvVars` | Extra environment variables to be set on MariaDB primary containers | `{}` |
|
||||||
|
| `primary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MariaDB primary containers | `nil` |
|
||||||
|
| `primary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MariaDB primary containers | `nil` |
|
||||||
|
| `primary.extraFlags` | MariaDB primary additional command line flags | `nil` |
|
||||||
|
| `primary.persistence.enabled` | Enable persistence on MariaDB primary replicas using a `PersistentVolumeClaim` | `true` |
|
||||||
|
| `primary.persistence.existingClaim` | Name of an existing `PersistentVolumeClaim` for MariaDB primary replicas | `nil` |
|
||||||
|
| `primary.persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
||||||
|
| `primary.persistence.annotations` | MariaDB primary persistent volume claim annotations | `{}` (evaluated as a template) |
|
||||||
|
| `primary.persistence.storageClass` | MariaDB primary persistent volume storage Class | `nil` |
|
||||||
|
| `primary.persistence.accessModes` | MariaDB primary persistent volume access Modes | `[ReadWriteOnce]` |
|
||||||
|
| `primary.persistence.size` | MariaDB primary persistent volume size | `8Gi` |
|
||||||
|
| `primary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
|
||||||
|
| `primary.initContainers` | Add additional init containers for the MariaDB Primary pod(s) | `{}` (evaluated as a template) |
|
||||||
|
| `primary.sidecars` | Add additional sidecar containers for the MariaDB Primary pod(s) | `{}` (evaluated as a template) |
|
||||||
|
| `primary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MariaDB Primary container(s) | `{}` |
|
||||||
|
| `primary.extraVolumes` | Optionally specify extra list of additional volumes to the MariaDB Primary pod(s) | `{}` |
|
||||||
|
| `primary.service.type` | MariaDB Primary K8s service type | `ClusterIP` |
|
||||||
|
| `primary.service.clusterIP` | MariaDB Primary K8s service clusterIP IP | `nil` |
|
||||||
|
| `primary.service.port` | MariaDB Primary K8s service port | `3306` |
|
||||||
|
| `primary.service.nodePort` | MariaDB Primary K8s service node port | `nil` |
|
||||||
|
| `primary.service.loadBalancerIP` | MariaDB Primary loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||||
|
| `primary.service.loadBalancerSourceRanges` | Address that are allowed when MariaDB Primary service is LoadBalancer | `[]` |
|
||||||
|
| `primary.pdb.enabled` | Enable/disable a Pod Disruption Budget creation for MariaDB primary pods | `false` |
|
||||||
|
| `primary.pdb.minAvailable` | Minimum number/percentage of MariaDB primary pods that should remain scheduled | `1` |
|
||||||
|
| `primary.pdb.maxUnavailable` | Maximum number/percentage of MariaDB primary pods that may be made unavailable | `nil` |
|
||||||
|
|
||||||
|
### MariaDB Secondary parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------|
|
||||||
|
| `secondary.command` | Override default container command on MariaDB Secondary container(s) (useful when using custom images) | `nil` |
|
||||||
|
| `secondary.args` | Override default container args on MariaDB Secondary container(s) (useful when using custom images) | `nil` |
|
||||||
|
| `secondary.configuration` | MariaDB Secondary configuration to be injected as ConfigMap | Check `values.yaml` file |
|
||||||
|
| `secondary.existingConfigmap` | Name of existing ConfigMap with MariaDB Secondary configuration | `nil` |
|
||||||
|
| `secondary.replicaCount` | Number of MariaDB secondary replicas | `1` |
|
||||||
|
| `secondary.updateStrategy` | Update strategy type for the MariaDB secondary statefulset | `RollingUpdate` |
|
||||||
|
| `secondary.podAnnotations` | Additional pod annotations for MariaDB secondary pods | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `secondary.podLabels` | Additional pod labels for MariaDB secondary pods | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.podAffinityPreset` | MariaDB secondary pod affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `secondary.podAntiAffinityPreset` | MariaDB secondary pod anti-affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||||
|
| `secondary.nodeAffinityPreset.type` | MariaDB secondary node affinity preset type. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `secondary.nodeAffinityPreset.key` | MariaDB secondary node label key to match Ignored if `secondary.affinity` is set. | `""` |
|
||||||
|
| `secondary.nodeAffinityPreset.values` | MariaDB secondary node label values to match. Ignored if `secondary.affinity` is set. | `[]` |
|
||||||
|
| `secondary.affinity` | Affinity for MariaDB secondary pods assignment | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.nodeSelector` | Node labels for MariaDB secondary pods assignment | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.tolerations` | Tolerations for MariaDB secondary pods assignment | `[]` (evaluated as a template) |
|
||||||
|
| `secondary.priorityClassName` | Priority class for MariaDB secondary pods assignment | `nil` |
|
||||||
|
| `secondary.podSecurityContext.enabled` | Enable security context for MariaDB secondary pods | `true` |
|
||||||
|
| `secondary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
|
||||||
|
| `secondary.containerSecurityContext.enabled` | MariaDB secondary container securityContext | `true` |
|
||||||
|
| `secondary.containerSecurityContext.runAsUser` | User ID for the MariaDB secondary container | `1001` |
|
||||||
|
| `secondary.livenessProbe` | Liveness probe configuration for MariaDB secondary containers | Check `values.yaml` file |
|
||||||
|
| `secondary.readinessProbe` | Readiness probe configuration for MariaDB secondary containers | Check `values.yaml` file |
|
||||||
|
| `secondary.customLivenessProbe` | Override default liveness probe for MariaDB secondary containers | `nil` |
|
||||||
|
| `secondary.customReadinessProbe` | Override default readiness probe for MariaDB secondary containers | `nil` |
|
||||||
|
| `secondary.resources.limits` | The resources limits for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.resources.requests` | The requested resources for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.extraEnvVars` | Extra environment variables to be set on MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MariaDB secondary containers | `nil` |
|
||||||
|
| `secondary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MariaDB secondary containers | `nil` |
|
||||||
|
| `secondary.extraFlags` | MariaDB secondary additional command line flags | `nil` |
|
||||||
|
| `secondary.extraFlags` | MariaDB secondary additional command line flags | `nil` |
|
||||||
|
| `secondary.persistence.enabled` | Enable persistence on MariaDB secondary replicas using a `PersistentVolumeClaim` | `true` |
|
||||||
|
| `secondary.persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
||||||
|
| `secondary.persistence.annotations` | MariaDB secondary persistent volume claim annotations | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.persistence.storageClass` | MariaDB secondary persistent volume storage Class | `nil` |
|
||||||
|
| `secondary.persistence.accessModes` | MariaDB secondary persistent volume access Modes | `[ReadWriteOnce]` |
|
||||||
|
| `secondary.persistence.size` | MariaDB secondary persistent volume size | `8Gi` |
|
||||||
|
| `secondary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.initContainers` | Add additional init containers for the MariaDB secondary pod(s) | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.sidecars` | Add additional sidecar containers for the MariaDB secondary pod(s) | `{}` (evaluated as a template) |
|
||||||
|
| `secondary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MariaDB secondary container(s) | `{}` |
|
||||||
|
| `secondary.extraVolumes` | Optionally specify extra list of additional volumes to the MariaDB secondary pod(s) | `{}` |
|
||||||
|
| `secondary.service.type` | MariaDB secondary K8s service type | `ClusterIP` |
|
||||||
|
| `secondary.service.clusterIP` | MariaDB secondary K8s service clusterIP IP | `nil` |
|
||||||
|
| `secondary.service.port` | MariaDB secondary K8s service port | `3306` |
|
||||||
|
| `secondary.service.nodePort` | MariaDB secondary K8s service node port | `nil` |
|
||||||
|
| `secondary.service.loadBalancerIP` | MariaDB secondary loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||||
|
| `secondary.service.loadBalancerSourceRanges` | Address that are allowed when MariaDB secondary service is LoadBalancer | `[]` |
|
||||||
|
| `secondary.pdb.enabled` | Enable/disable a Pod Disruption Budget creation for MariaDB secondary pods | `false` |
|
||||||
|
| `secondary.pdb.minAvailable` | Minimum number/percentage of MariaDB secondary pods that should remain scheduled | `1` |
|
||||||
|
| `secondary.pdb.maxUnavailable` | Maximum number/percentage of MariaDB secondary pods that may be made unavailable | `nil` |
|
||||||
|
|
||||||
|
### RBAC parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|------------------------------|----------------------------------------------------------|-------------------------------------------------|
|
||||||
|
| `serviceAccount.create` | Enable the creation of a ServiceAccount for MariaDB pods | `true` |
|
||||||
|
| `serviceAccount.name` | Name of the created ServiceAccount | Generated using the `mariadb.fullname` template |
|
||||||
|
| `serviceAccount.annotations` | Annotations for MariaDB Service Account | `{}` (evaluated as a template) |
|
||||||
|
| `rbac.create` | Weather to create & use RBAC resources or not | `false` |
|
||||||
|
|
||||||
|
### Volume Permissions parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|----------------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||||
|
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||||
|
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
|
||||||
|
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/bitnami-shell` |
|
||||||
|
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `"10"` |
|
||||||
|
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
|
||||||
|
| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
| `volumePermissions.resources.limits` | Init container volume-permissions resource limits | `{}` |
|
||||||
|
| `volumePermissions.resources.requests` | Init container volume-permissions resource requests | `{}` |
|
||||||
|
|
||||||
|
### Metrics parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|-------------------------------------------|-------------------------------------------------------------------------------------|---------------------------|
|
||||||
|
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
|
||||||
|
| `metrics.image.registry` | Exporter image registry | `docker.io` |
|
||||||
|
| `metrics.image.repository` | Exporter image name | `bitnami/mysqld-exporter` |
|
||||||
|
| `metrics.image.tag` | Exporter image tag | `{TAG_NAME}` |
|
||||||
|
| `metrics.image.pullPolicy` | Exporter image pull policy | `IfNotPresent` |
|
||||||
|
| `metrics.extraArgs.primary` | Extra args to be passed to mysqld_exporter on Primary pods | `[]` |
|
||||||
|
| `metrics.extraArgs.secondary` | Extra args to be passed to mysqld_exporter on Secondary pods | `[]` |
|
||||||
|
| `metrics.resources.limits` | The resources limits for MariaDB prometheus exporter containers | `{}` |
|
||||||
|
| `metrics.resources.requests` | The requested resources for MariaDB prometheus exporter containers | `{}` |
|
||||||
|
| `metrics.livenessProbe` | Liveness probe configuration for MariaDB prometheus exporter containers | Check `values.yaml` file |
|
||||||
|
| `metrics.readinessProbe` | Readiness probe configuration for MariaDB prometheus exporter containers | Check `values.yaml` file |
|
||||||
|
| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` |
|
||||||
|
| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `nil` |
|
||||||
|
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `30s` |
|
||||||
|
| `metrics.serviceMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `nil` |
|
||||||
|
| `metrics.serviceMonitor.relabellings` | Specify Metric Relabellings to add to the scrape endpoint | `nil` |
|
||||||
|
| `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels. | `false` |
|
||||||
|
| `metrics.serviceMonitor.additionalLabels` | Used to pass Labels that are required by the Installed Prometheus Operator | `{}` |
|
||||||
|
| `metrics.serviceMonitor.release` | Used to pass Labels release that sometimes should be custom for Prometheus Operator | `nil` |
|
||||||
|
|
||||||
|
The above parameters map to the env variables defined in [bitnami/mariadb](http://github.com/bitnami/bitnami-docker-mariadb). For more information please refer to the [bitnami/mariadb](http://github.com/bitnami/bitnami-docker-mariadb) image documentation.
|
||||||
|
|
||||||
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install my-release \
|
||||||
|
--set auth.rootPassword=secretpassword,auth.database=app_database \
|
||||||
|
bitnami/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
The above command sets the MariaDB `root` account password to `secretpassword`. Additionally it creates a database named `my_database`.
|
||||||
|
|
||||||
|
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
|
||||||
|
|
||||||
|
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install my-release -f values.yaml bitnami/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||||
|
|
||||||
|
## Configuration and installation details
|
||||||
|
|
||||||
|
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||||
|
|
||||||
|
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||||
|
|
||||||
|
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||||
|
|
||||||
|
### Change MariaDB version
|
||||||
|
|
||||||
|
To modify the MariaDB version used in this chart you can specify a [valid image tag](https://hub.docker.com/r/bitnami/mariadb/tags/) using the `image.tag` parameter. For example, `image.tag=X.Y.Z`. This approach is also applicable to other images like exporters.
|
||||||
|
|
||||||
|
### Initialize a fresh instance
|
||||||
|
|
||||||
|
The [Bitnami MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) image allows you to use your custom scripts to initialize a fresh instance. Custom scripts may be specified using the `initdbScripts` parameter. Alternatively, an external ConfigMap may be created with all the initialization scripts and the ConfigMap passed to the chart via the `initdbScriptsConfigMap` parameter. Note that this will override the `initdbScripts` parameter.
|
||||||
|
|
||||||
|
The allowed extensions are `.sh`, `.sql` and `.sql.gz`.
|
||||||
|
|
||||||
|
These scripts are treated differently depending on their extension. While `.sh` scripts are executed on all the nodes, `.sql` and `.sql.gz` scripts are only executed on the primary nodes. This is because `.sh` scripts support conditional tests to identify the type of node they are running on, while such tests are not supported in `.sql` or `.sql.gz` files.
|
||||||
|
|
||||||
|
[Refer to the chart documentation for more information and a usage example](https://docs.bitnami.com/kubernetes/infrastructure/mariadb/configuration/customize-new-instance/).
|
||||||
|
|
||||||
|
### Sidecars and Init Containers
|
||||||
|
|
||||||
|
If additional containers are needed in the same pod as MariaDB (such as additional metrics or logging exporters), they can be defined using the sidecars parameter.
|
||||||
|
|
||||||
|
The Helm chart already includes sidecar containers for the Prometheus exporters. These can be activated by adding the `–enable-metrics=true` parameter at deployment time. The `sidecars` parameter should therefore only be used for any extra sidecar containers. [See an example of configuring and using sidecar containers](https://docs.bitnami.com/kubernetes/infrastructure/mariadb/administration/configure-use-sidecars/).
|
||||||
|
|
||||||
|
Similarly, additional containers can be added to MariaDB pods using the `initContainers` parameter. [See an example of configuring and using init containers](https://docs.bitnami.com/kubernetes/infrastructure/mariadb/administration/configure-use-init-containers/).
|
||||||
|
|
||||||
|
## Persistence
|
||||||
|
|
||||||
|
The [Bitnami MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) image stores the MariaDB data and configurations at the `/bitnami/mariadb` path of the container.
|
||||||
|
|
||||||
|
The chart mounts a [Persistent Volume](https://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning, by default. An existing PersistentVolumeClaim can also be defined.
|
||||||
|
|
||||||
|
[Learn more about persistence in the chart documentation](https://docs.bitnami.com/kubernetes/infrastructure/mariadb/configuration/understand-chart-persistence/).
|
||||||
|
|
||||||
|
### Adjust permissions of persistent volume mountpoint
|
||||||
|
|
||||||
|
As the image run as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it.
|
||||||
|
|
||||||
|
By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions.
|
||||||
|
|
||||||
|
As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination. You can enable this initContainer by setting `volumePermissions.enabled` to `true`.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
It's necessary to set the `auth.rootPassword` parameter when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use under the 'Administrator credentials' section. Please note down the password and run the command below to upgrade your chart:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm upgrade my-release bitnami/mariadb --set auth.rootPassword=[ROOT_PASSWORD]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Note: you need to substitute the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes.
|
||||||
|
|
||||||
|
### To 9.0.0
|
||||||
|
|
||||||
|
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||||
|
|
||||||
|
[Learn more about this change and related upgrade considerations](https://docs.bitnami.com/kubernetes/infrastructure/mariadb/administration/upgrade-helm3/).
|
||||||
|
|
||||||
|
### To 8.0.0
|
||||||
|
|
||||||
|
- Several parameters were renamed or disappeared in favor of new ones on this major version:
|
||||||
|
- The terms *master* and *slave* have been replaced by the terms *primary* and *secondary*. Therefore, parameters prefixed with `master` or `slave` are now prefixed with `primary` or `secondary`, respectively.
|
||||||
|
- `securityContext.*` is deprecated in favor of `primary.podSecurityContext`, `primary.containerSecurityContext`, `secondary.podSecurityContext`, and `secondary.containerSecurityContext`.
|
||||||
|
- Credentials parameter are reorganized under the `auth` parameter.
|
||||||
|
- `replication.enabled` parameter is deprecated in favor of `architecture` parameter that accepts two values: `standalone` and `replication`.
|
||||||
|
- The default MariaDB version was updated from 10.3 to 10.5. According to the official documentation, upgrading from 10.3 should be painless. However, there are some things that have changed which could affect an upgrade:
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.3 to MariaDB 10.4](https://mariadb.com/kb/en/upgrading-from-mariadb-103-to-mariadb-104/#incompatible-changes-between-103-and-104).
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.4 to MariaDB 10.5](https://mariadb.com/kb/en/upgrading-from-mariadb-104-to-mariadb-105/#incompatible-changes-between-104-and-105).
|
||||||
|
- Chart labels were adapted to follow the [Helm charts standard labels](https://helm.sh/docs/chart_best_practices/labels/#standard-labels).
|
||||||
|
- This version also introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||||
|
|
||||||
|
Consequences:
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed. To upgrade to `8.0.0`, install a new release of the MariaDB chart, and migrate the data from your previous release. You have 2 alternatives to do so:
|
||||||
|
|
||||||
|
- Create a backup of the database, and restore it on the new release using tools such as [mysqldump](https://mariadb.com/kb/en/mysqldump/).
|
||||||
|
- Reuse the PVC used to hold the master data on your previous release. To do so, use the `primary.persistence.existingClaim` parameter. The following example assumes that the release name is `mariadb`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install mariadb bitnami/mariadb --set auth.rootPassword=[ROOT_PASSWORD] --set primary.persistence.existingClaim=[EXISTING_PVC]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Note: you need to substitute the placeholder _[EXISTING_PVC]_ with the name of the PVC used on your previous release, and _[ROOT_PASSWORD]_ with the root password used in your previous release.
|
||||||
|
|
||||||
|
### To 7.0.0
|
||||||
|
|
||||||
|
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.
|
||||||
|
|
||||||
|
In https://github.com/helm/charts/pull/17308 the `apiVersion` of the statefulset resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.
|
||||||
|
|
||||||
|
This major version bump signifies this change.
|
||||||
|
|
||||||
|
### To 6.0.0
|
||||||
|
|
||||||
|
MariaDB version was updated from 10.1 to 10.3, there are no changes in the chart itself. According to the official documentation, upgrading from 10.1 should be painless. However, there are some things that have changed which could affect an upgrade:
|
||||||
|
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.1 to MariaDB 10.2](https://mariadb.com/kb/en/library/upgrading-from-mariadb-101-to-mariadb-102//#incompatible-changes-between-101-and-102)
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.2 to MariaDB 10.3](https://mariadb.com/kb/en/library/upgrading-from-mariadb-102-to-mariadb-103/#incompatible-changes-between-102-and-103)
|
||||||
|
|
||||||
|
### To 5.0.0
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||||
|
Use the workaround below to upgrade from versions previous to 5.0.0. The following example assumes that the release name is mariadb:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ kubectl delete statefulset opencart-mariadb --cascade=false
|
||||||
|
```
|
||||||
22
gitea/charts/mariadb/charts/common/.helmignore
Normal file
22
gitea/charts/mariadb/charts/common/.helmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
23
gitea/charts/mariadb/charts/common/Chart.yaml
Normal file
23
gitea/charts/mariadb/charts/common/Chart.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
annotations:
|
||||||
|
category: Infrastructure
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 1.4.1
|
||||||
|
description: A Library Helm Chart for grouping common logic between bitnami charts.
|
||||||
|
This chart is not deployable by itself.
|
||||||
|
home: https://github.com/bitnami/charts/tree/master/bitnami/common
|
||||||
|
icon: https://bitnami.com/downloads/logos/bitnami-mark.png
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
- helper
|
||||||
|
- template
|
||||||
|
- function
|
||||||
|
- bitnami
|
||||||
|
maintainers:
|
||||||
|
- email: containers@bitnami.com
|
||||||
|
name: Bitnami
|
||||||
|
name: common
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts
|
||||||
|
- http://www.bitnami.com/
|
||||||
|
type: library
|
||||||
|
version: 1.4.1
|
||||||
322
gitea/charts/mariadb/charts/common/README.md
Normal file
322
gitea/charts/mariadb/charts/common/README.md
Normal file
@ -0,0 +1,322 @@
|
|||||||
|
# Bitnami Common Library Chart
|
||||||
|
|
||||||
|
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between bitnami charts.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 0.x.x
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm dependency update
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
data:
|
||||||
|
myvalue: "Hello World"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 3.1.0
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the helpers available in the library which are scoped in different sections.
|
||||||
|
|
||||||
|
### Affinities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-------------------------------|------------------------------------------------------|------------------------------------------------|
|
||||||
|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.node.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.pod.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pod.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
|
||||||
|
### Capabilities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|----------------------------------------------|------------------------------------------------------------------------------------------------|-------------------|
|
||||||
|
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
|
||||||
|
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
|
||||||
|
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
|
||||||
|
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
|
||||||
|
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
|
||||||
|
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
|
||||||
|
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
|
||||||
|
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
|
||||||
|
|
||||||
|
### Images
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
|
||||||
|
|
||||||
|
### Ingress
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------|------------------------------------------------------|-------------------|
|
||||||
|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||||
|
| `common.labels.matchLabels` | Return the proper Docker Image Registry Secret Names | `.` Chart context |
|
||||||
|
|
||||||
|
### Names
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Inpput |
|
||||||
|
|-------------------------|------------------------------------------------------------|-------------------|
|
||||||
|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||||
|
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||||
|
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|---------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $`, length, strong and chartNAme fields are optional. |
|
||||||
|
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-------------------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
|
||||||
|
|
||||||
|
### TplValues
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
|
||||||
|
|
||||||
|
### Utils
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------------|------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
|
||||||
|
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
|
||||||
|
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
|
||||||
|
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
|
||||||
|
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
|
||||||
|
|
||||||
|
### Validations
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
|
||||||
|
| `common.validations.values.postgresql.passwords` | This helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values. | `dict "secret" "postgresql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use postgresql chart and the helper. |
|
||||||
|
| `common.validations.values.redis.passwords` | This helper will ensure required password for Redis<sup>TM</sup> are not empty. It returns a shared error for all the values. | `dict "secret" "redis-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use redis chart and the helper. |
|
||||||
|
| `common.validations.values.cassandra.passwords` | This helper will ensure required password for Cassandra are not empty. It returns a shared error for all the values. | `dict "secret" "cassandra-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use cassandra chart and the helper. |
|
||||||
|
| `common.validations.values.mongodb.passwords` | This helper will ensure required password for MongoDB® are not empty. It returns a shared error for all the values. | `dict "secret" "mongodb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mongodb chart and the helper. |
|
||||||
|
|
||||||
|
### Warnings
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|------------------------------|----------------------------------|------------------------------------------------------------|
|
||||||
|
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
|
||||||
|
## Special input schemas
|
||||||
|
|
||||||
|
### ImageRoot
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
description: Docker registry where the image is located
|
||||||
|
example: docker.io
|
||||||
|
|
||||||
|
repository:
|
||||||
|
type: string
|
||||||
|
description: Repository and image name
|
||||||
|
example: bitnami/nginx
|
||||||
|
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
description: image tag
|
||||||
|
example: 1.16.1-debian-10-r63
|
||||||
|
|
||||||
|
pullPolicy:
|
||||||
|
type: string
|
||||||
|
description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||||
|
|
||||||
|
pullSecrets:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: Optionally specify an array of imagePullSecrets.
|
||||||
|
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
description: Set to true if you would like to see extra information on logs
|
||||||
|
example: false
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# registry: docker.io
|
||||||
|
# repository: bitnami/nginx
|
||||||
|
# tag: 1.16.1-debian-10-r63
|
||||||
|
# pullPolicy: IfNotPresent
|
||||||
|
# debug: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Whether enable persistence.
|
||||||
|
example: true
|
||||||
|
|
||||||
|
storageClass:
|
||||||
|
type: string
|
||||||
|
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
|
||||||
|
example: "-"
|
||||||
|
|
||||||
|
accessMode:
|
||||||
|
type: string
|
||||||
|
description: Access mode for the Persistent Volume Storage.
|
||||||
|
example: ReadWriteOnce
|
||||||
|
|
||||||
|
size:
|
||||||
|
type: string
|
||||||
|
description: Size the Persistent Volume Storage.
|
||||||
|
example: 8Gi
|
||||||
|
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
description: Path to be persisted.
|
||||||
|
example: /bitnami
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# enabled: true
|
||||||
|
# storageClass: "-"
|
||||||
|
# accessMode: ReadWriteOnce
|
||||||
|
# size: 8Gi
|
||||||
|
# path: /bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
### ExistingSecret
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Name of the existing secret.
|
||||||
|
example: mySecret
|
||||||
|
keyMapping:
|
||||||
|
description: Mapping between the expected key name and the name of the key in the existing secret.
|
||||||
|
type: object
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# name: mySecret
|
||||||
|
# keyMapping:
|
||||||
|
# password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example of use
|
||||||
|
|
||||||
|
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# templates/secret.yaml
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ include "common.names.fullname" . }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
password: {{ .Values.password | b64enc | quote }}
|
||||||
|
|
||||||
|
# templates/dpl.yaml
|
||||||
|
---
|
||||||
|
...
|
||||||
|
env:
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
|
||||||
|
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
|
||||||
|
...
|
||||||
|
|
||||||
|
# values.yaml
|
||||||
|
---
|
||||||
|
name: mySecret
|
||||||
|
keyMapping:
|
||||||
|
password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
### ValidateValue
|
||||||
|
|
||||||
|
#### NOTES.txt
|
||||||
|
|
||||||
|
```console
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
|
||||||
|
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
```
|
||||||
|
|
||||||
|
If we force those values to be empty we will see some alerts
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm install test mychart --set path.to.value00="",path.to.value01=""
|
||||||
|
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 --decode)
|
||||||
|
|
||||||
|
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 --decode)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
### To 1.0.0
|
||||||
|
|
||||||
|
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||||
|
|
||||||
|
**What changes were introduced in this major version?**
|
||||||
|
|
||||||
|
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||||
|
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
|
||||||
|
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||||
|
|
||||||
|
**Considerations when upgrading to this version**
|
||||||
|
|
||||||
|
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||||
|
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||||
|
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||||
|
|
||||||
|
**Useful links**
|
||||||
|
|
||||||
|
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
|
||||||
|
- https://helm.sh/docs/topics/v2_v3_migration/
|
||||||
|
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
|
||||||
94
gitea/charts/mariadb/charts/common/templates/_affinities.tpl
Normal file
94
gitea/charts/mariadb/charts/common/templates/_affinities.tpl
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.soft" -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.hard" -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.nodes.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.nodes.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.soft" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace | quote }}
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.hard" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace | quote }}
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.pods.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.pods.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the target Kubernetes version
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.kubeVersion" -}}
|
||||||
|
{{- if .Values.global }}
|
||||||
|
{{- if .Values.global.kubeVersion }}
|
||||||
|
{{- .Values.global.kubeVersion -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for statefulset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "apps/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for ingress.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- if .Values.ingress -}}
|
||||||
|
{{- if .Values.ingress.apiVersion -}}
|
||||||
|
{{- .Values.ingress.apiVersion -}}
|
||||||
|
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "networking.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "networking.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for RBAC resources.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for CRDs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if the used Helm version is 3.3+.
|
||||||
|
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
|
||||||
|
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
|
||||||
|
**To be removed when the catalog's minimun Helm version is 3.3**
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.supportsHelmVersion" -}}
|
||||||
|
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
20
gitea/charts/mariadb/charts/common/templates/_errors.tpl
Normal file
20
gitea/charts/mariadb/charts/common/templates/_errors.tpl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Through error when upgrading using empty passwords values that must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
|
||||||
|
|
||||||
|
Required password params:
|
||||||
|
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
|
||||||
|
- context - Context - Required. Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.upgrade.passwords.empty" -}}
|
||||||
|
{{- $validationErrors := join "" .validationErrors -}}
|
||||||
|
{{- if and $validationErrors .context.Release.IsUpgrade -}}
|
||||||
|
{{- $errorString := "\nPASSWORDS ERROR: you must provide your current passwords when upgrade the release%s" -}}
|
||||||
|
{{- printf $errorString $validationErrors | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
47
gitea/charts/mariadb/charts/common/templates/_images.tpl
Normal file
47
gitea/charts/mariadb/charts/common/templates/_images.tpl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper image name
|
||||||
|
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.image" -}}
|
||||||
|
{{- $registryName := .imageRoot.registry -}}
|
||||||
|
{{- $repositoryName := .imageRoot.repository -}}
|
||||||
|
{{- $tag := .imageRoot.tag | toString -}}
|
||||||
|
{{- if .global }}
|
||||||
|
{{- if .global.imageRegistry }}
|
||||||
|
{{- $registryName = .global.imageRegistry -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $registryName }}
|
||||||
|
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.pullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
|
||||||
|
{{- if .global }}
|
||||||
|
{{- range .global.imagePullSecrets -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
42
gitea/charts/mariadb/charts/common/templates/_ingress.tpl
Normal file
42
gitea/charts/mariadb/charts/common/templates/_ingress.tpl
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate backend entry that is compatible with all Kubernetes API versions.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- serviceName - String. Name of an existing service backend
|
||||||
|
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.backend" -}}
|
||||||
|
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}}
|
||||||
|
{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}}
|
||||||
|
serviceName: {{ .serviceName }}
|
||||||
|
servicePort: {{ .servicePort }}
|
||||||
|
{{- else -}}
|
||||||
|
service:
|
||||||
|
name: {{ .serviceName }}
|
||||||
|
port:
|
||||||
|
{{- if typeIs "string" .servicePort }}
|
||||||
|
name: {{ .servicePort }}
|
||||||
|
{{- else if typeIs "int" .servicePort }}
|
||||||
|
number: {{ .servicePort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Print "true" if the API pathType field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsPathType" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsPathType" -}}
|
||||||
|
{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||||
|
{{- print "false" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
18
gitea/charts/mariadb/charts/common/templates/_labels.tpl
Normal file
18
gitea/charts/mariadb/charts/common/templates/_labels.tpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Kubernetes standard labels
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.standard" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.matchLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
32
gitea/charts/mariadb/charts/common/templates/_names.tpl
Normal file
32
gitea/charts/mariadb/charts/common/templates/_names.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- 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).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride -}}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
129
gitea/charts/mariadb/charts/common/templates/_secrets.tpl
Normal file
129
gitea/charts/mariadb/charts/common/templates/_secrets.tpl
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Generate secret name.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||||
|
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.name" -}}
|
||||||
|
{{- $name := (include "common.names.fullname" .context) -}}
|
||||||
|
|
||||||
|
{{- if .defaultNameSuffix -}}
|
||||||
|
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .) -}}
|
||||||
|
{{- with .name -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret key.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||||
|
- key - String - Required. Name of the key in the secret.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.key" -}}
|
||||||
|
{{- $key := .key -}}
|
||||||
|
|
||||||
|
{{- if .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .existingSecret) -}}
|
||||||
|
{{- if .existingSecret.keyMapping -}}
|
||||||
|
{{- $key = index .existingSecret.keyMapping $.key -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret password or retrieve one if already created.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- length - int - Optional - Length of the generated random password.
|
||||||
|
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
|
||||||
|
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.passwords.manage" -}}
|
||||||
|
|
||||||
|
{{- $password := "" }}
|
||||||
|
{{- $subchart := "" }}
|
||||||
|
{{- $chartName := default "" .chartName }}
|
||||||
|
{{- $passwordLength := default 10 .length }}
|
||||||
|
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||||
|
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- if index $secret.data .key }}
|
||||||
|
{{- $password = index $secret.data .key }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if $providedPasswordValue }}
|
||||||
|
{{- $password = $providedPasswordValue | toString | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
{{- if .context.Values.enabled }}
|
||||||
|
{{- $subchart = $chartName }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
|
||||||
|
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
|
||||||
|
{{- $passwordValidationErrors := list $requiredPasswordError -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
|
||||||
|
|
||||||
|
{{- if .strong }}
|
||||||
|
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
|
||||||
|
{{- $password = randAscii $passwordLength }}
|
||||||
|
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||||
|
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $password -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns whether a previous generated secret already exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.exists" -}}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
23
gitea/charts/mariadb/charts/common/templates/_storage.tpl
Normal file
23
gitea/charts/mariadb/charts/common/templates/_storage.tpl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper Storage Class
|
||||||
|
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.storage.class" -}}
|
||||||
|
|
||||||
|
{{- $storageClass := .persistence.storageClass -}}
|
||||||
|
{{- if .global -}}
|
||||||
|
{{- if .global.storageClass -}}
|
||||||
|
{{- $storageClass = .global.storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if $storageClass -}}
|
||||||
|
{{- if (eq "-" $storageClass) -}}
|
||||||
|
{{- printf "storageClassName: \"\"" -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "storageClassName: %s" $storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
13
gitea/charts/mariadb/charts/common/templates/_tplvalues.tpl
Normal file
13
gitea/charts/mariadb/charts/common/templates/_tplvalues.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Renders a value that contains template.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.render" -}}
|
||||||
|
{{- if typeIs "string" .value }}
|
||||||
|
{{- tpl .value .context }}
|
||||||
|
{{- else }}
|
||||||
|
{{- tpl (.value | toYaml) .context }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
62
gitea/charts/mariadb/charts/common/templates/_utils.tpl
Normal file
62
gitea/charts/mariadb/charts/common/templates/_utils.tpl
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Print instructions to get a secret value.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.secret.getvalue" -}}
|
||||||
|
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
export {{ $varname }}=$(kubectl get secret --namespace {{ .context.Release.Namespace | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 --decode)
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Build env var name given a field
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.fieldToEnvVar" -}}
|
||||||
|
{{- $fieldNameSplit := splitList "-" .field -}}
|
||||||
|
{{- $upperCaseFieldNameSplit := list -}}
|
||||||
|
|
||||||
|
{{- range $fieldNameSplit -}}
|
||||||
|
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ join "_" $upperCaseFieldNameSplit }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Gets a value from .Values given
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getValueFromKey" -}}
|
||||||
|
{{- $splitKey := splitList "." .key -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $latestObj := $.context.Values -}}
|
||||||
|
{{- range $splitKey -}}
|
||||||
|
{{- if not $latestObj -}}
|
||||||
|
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $value = ( index $latestObj . ) -}}
|
||||||
|
{{- $latestObj = $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%v" (default "" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns first .Values key with a defined value or first of the list if all non-defined
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getKeyFromList" -}}
|
||||||
|
{{- $key := first .keys -}}
|
||||||
|
{{- $reverseKeys := reverse .keys }}
|
||||||
|
{{- range $reverseKeys }}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- $key = . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
14
gitea/charts/mariadb/charts/common/templates/_warnings.tpl
Normal file
14
gitea/charts/mariadb/charts/common/templates/_warnings.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Warning about using rolling tag.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.rollingTag" -}}
|
||||||
|
|
||||||
|
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||||
|
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||||
|
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate Cassandra required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.cassandra.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where Cassandra values are stored, e.g: "cassandra-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.cassandra.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.cassandra.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.cassandra.values.enabled" . -}}
|
||||||
|
{{- $dbUserPrefix := include "common.cassandra.values.key.dbUser" . -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $dbUserPrefix -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "cassandra-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.dbUser.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled cassandra.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.cassandra.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key dbUser
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.key.dbUser" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
cassandra.dbUser
|
||||||
|
{{- else -}}
|
||||||
|
dbUser
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MariaDB required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mariadb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mariadb.values.enabled" . -}}
|
||||||
|
{{- $architecture := include "common.mariadb.values.architecture" . -}}
|
||||||
|
{{- $authPrefix := include "common.mariadb.values.key.auth" . -}}
|
||||||
|
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||||
|
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||||
|
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mariadb-root-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||||
|
|
||||||
|
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||||
|
{{- if not (empty $valueUsername) -}}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mariadb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replication") -}}
|
||||||
|
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-replication-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mariadb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mariadb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mariadb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MongoDB(R) required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mongodb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MongoDB(R) values are stored, e.g: "mongodb-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mongodb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mongodb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mongodb.values.enabled" . -}}
|
||||||
|
{{- $authPrefix := include "common.mongodb.values.key.auth" . -}}
|
||||||
|
{{- $architecture := include "common.mongodb.values.architecture" . -}}
|
||||||
|
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||||
|
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||||
|
{{- $valueKeyDatabase := printf "%s.database" $authPrefix -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||||
|
{{- $valueKeyReplicaSetKey := printf "%s.replicaSetKey" $authPrefix -}}
|
||||||
|
{{- $valueKeyAuthEnabled := printf "%s.enabled" $authPrefix -}}
|
||||||
|
|
||||||
|
{{- $authEnabled := include "common.utils.getValueFromKey" (dict "key" $valueKeyAuthEnabled "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") (eq $authEnabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mongodb-root-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||||
|
|
||||||
|
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||||
|
{{- $valueDatabase := include "common.utils.getValueFromKey" (dict "key" $valueKeyDatabase "context" .context) }}
|
||||||
|
{{- if and $valueUsername $valueDatabase -}}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mongodb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replicaset") -}}
|
||||||
|
{{- $requiredReplicaSetKey := dict "valueKey" $valueKeyReplicaSetKey "secret" .secret "field" "mongodb-replica-set-key" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredReplicaSetKey -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mongodb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mongodb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mongodb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate PostgreSQL required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.postgresql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where postgresql values are stored, e.g: "postgresql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.postgresql.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.postgresql.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.postgresql.values.enabled" . -}}
|
||||||
|
{{- $valueKeyPostgresqlPassword := include "common.postgresql.values.key.postgressPassword" . -}}
|
||||||
|
{{- $valueKeyPostgresqlReplicationEnabled := include "common.postgresql.values.key.replicationPassword" . -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredPostgresqlPassword := dict "valueKey" $valueKeyPostgresqlPassword "secret" .secret "field" "postgresql-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlPassword -}}
|
||||||
|
|
||||||
|
{{- $enabledReplication := include "common.postgresql.values.enabled.replication" . -}}
|
||||||
|
{{- if (eq $enabledReplication "true") -}}
|
||||||
|
{{- $requiredPostgresqlReplicationPassword := dict "valueKey" $valueKeyPostgresqlReplicationEnabled "secret" .secret "field" "postgresql-replication-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlReplicationPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to decide whether evaluate global values.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.use.global" -}}
|
||||||
|
{{- if .context.Values.global -}}
|
||||||
|
{{- if .context.Values.global.postgresql -}}
|
||||||
|
{{- index .context.Values.global.postgresql .key | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.existingSecret" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled postgresql.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key postgressPassword.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.postgressPassword" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if not $globalValue -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.postgresqlPassword
|
||||||
|
{{- else -}}
|
||||||
|
postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
global.postgresql.postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled.replication.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled.replication" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" .context.Values.replication.enabled -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key replication.password.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.replicationPassword" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.replication.password
|
||||||
|
{{- else -}}
|
||||||
|
replication.password
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate Redis(TM) required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.redis.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where redis values are stored, e.g: "redis-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.redis.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.redis.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.redis.values.enabled" . -}}
|
||||||
|
{{- $valueKeyPrefix := include "common.redis.values.keys.prefix" . -}}
|
||||||
|
{{- $valueKeyRedisPassword := printf "%s%s" $valueKeyPrefix "password" -}}
|
||||||
|
{{- $valueKeyRedisUsePassword := printf "%s%s" $valueKeyPrefix "usePassword" -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $usePassword := include "common.utils.getValueFromKey" (dict "key" $valueKeyRedisUsePassword "context" .context) -}}
|
||||||
|
{{- if eq $usePassword "true" -}}
|
||||||
|
{{- $requiredRedisPassword := dict "valueKey" $valueKeyRedisPassword "secret" .secret "field" "redis-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRedisPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Redis Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Redis(TM) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.redis.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled redis.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.redis.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right prefix path for the values
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.keys.prefix" -}}
|
||||||
|
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate values must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.multiple.empty" -}}
|
||||||
|
{{- range .required -}}
|
||||||
|
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate a value must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
- subchart - String - Optional - Name of the subchart that the validated password is part of.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.single.empty" -}}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
|
||||||
|
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
|
||||||
|
|
||||||
|
{{- if not $value -}}
|
||||||
|
{{- $varname := "my-value" -}}
|
||||||
|
{{- $getCurrentValue := "" -}}
|
||||||
|
{{- if and .secret .field -}}
|
||||||
|
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
3
gitea/charts/mariadb/charts/common/values.yaml
Normal file
3
gitea/charts/mariadb/charts/common/values.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## bitnami/common
|
||||||
|
## It is required by CI/CD tools and processes.
|
||||||
|
exampleValue: common-chart
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
# Test values file for generating all of the yaml and check that
|
||||||
|
# the rendering is correct
|
||||||
|
architecture: replication
|
||||||
|
auth:
|
||||||
|
usePasswordFiles: true
|
||||||
|
|
||||||
|
primary:
|
||||||
|
extraEnvVars:
|
||||||
|
- name: TEST
|
||||||
|
value: "3"
|
||||||
|
extraEnvVarsSecret: example-secret
|
||||||
|
extraEnvVarsCM: example-cm
|
||||||
|
podDisruptionBudget:
|
||||||
|
create: true
|
||||||
|
|
||||||
|
secondary:
|
||||||
|
replicaCount: 2
|
||||||
|
extraEnvVars:
|
||||||
|
- name: TEST
|
||||||
|
value: "2"
|
||||||
|
extraEnvVarsSecret: example-secret-2
|
||||||
|
extraEnvVarsCM: example-cm-2
|
||||||
|
podDisruptionBudget:
|
||||||
|
create: true
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
name: mariadb-service-account
|
||||||
|
rbac:
|
||||||
|
create: true
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: true
|
||||||
50
gitea/charts/mariadb/templates/NOTES.txt
Normal file
50
gitea/charts/mariadb/templates/NOTES.txt
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
Please be patient while the chart is being deployed
|
||||||
|
|
||||||
|
Tip:
|
||||||
|
|
||||||
|
Watch the deployment status using the command: kubectl get pods -w --namespace {{ .Release.Namespace }} -l release={{ .Release.Name }}
|
||||||
|
|
||||||
|
Services:
|
||||||
|
|
||||||
|
echo Primary: {{ include "mariadb.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.primary.service.port }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
echo Secondary: {{ include "mariadb.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.secondary.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
Administrator credentials:
|
||||||
|
|
||||||
|
Username: root
|
||||||
|
Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.secretName" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
|
||||||
|
|
||||||
|
To connect to your database:
|
||||||
|
|
||||||
|
1. Run a pod that you can use as a client:
|
||||||
|
|
||||||
|
kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mariadb.image" . }} --namespace {{ .Release.Namespace }} --command -- bash
|
||||||
|
|
||||||
|
2. To connect to primary service (read/write):
|
||||||
|
|
||||||
|
mysql -h {{ include "mariadb.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p {{ .Values.auth.database }}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
|
||||||
|
3. To connect to secondary service (read-only):
|
||||||
|
|
||||||
|
mysql -h {{ include "mariadb.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p {{ .Values.auth.database }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
To upgrade this helm chart:
|
||||||
|
|
||||||
|
1. Obtain the password as described on the 'Administrator credentials' section and set the 'auth.rootPassword' parameter as shown below:
|
||||||
|
|
||||||
|
ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.secretName" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
|
||||||
|
helm upgrade {{ .Release.Name }} bitnami/mariadb --set auth.rootPassword=$ROOT_PASSWORD
|
||||||
|
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||||
|
{{- include "mariadb.validateValues" . }}
|
||||||
|
{{- if not .Values.auth.customPasswordFiles -}}
|
||||||
|
{{- $passwordValidationErrors := include "common.validations.values.mariadb.passwords" (dict "secret" (include "common.names.fullname" .) "context" $) -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $passwordValidationErrors) "context" $) -}}
|
||||||
|
{{- end }}
|
||||||
150
gitea/charts/mariadb/templates/_helpers.tpl
Normal file
150
gitea/charts/mariadb/templates/_helpers.tpl
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{- define "mariadb.primary.fullname" -}}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- include "common.names.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "mariadb.secondary.fullname" -}}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) "secondary" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper MariaDB image name
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper metrics image name
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.metrics.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper image name (for the init container volume-permissions image)
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.volumePermissions.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.imagePullSecrets" -}}
|
||||||
|
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ template "mariadb.initdbScriptsCM" . }}
|
||||||
|
{{/*
|
||||||
|
Get the initialization scripts ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.initdbScriptsCM" -}}
|
||||||
|
{{- if .Values.initdbScriptsConfigMap -}}
|
||||||
|
{{- printf "%s" .Values.initdbScriptsConfigMap -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-init-scripts" (include "mariadb.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the configmap with the MariaDB Primary configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.primary.configmapName" -}}
|
||||||
|
{{- if .Values.primary.existingConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.existingConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "mariadb.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for MariaDB Secondary
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.primary.createConfigmap" -}}
|
||||||
|
{{- if and .Values.primary.configuration (not .Values.primary.existingConfigmap) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the configmap with the MariaDB Primary configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secondary.configmapName" -}}
|
||||||
|
{{- if .Values.secondary.existingConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.secondary.existingConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "mariadb.secondary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for MariaDB Secondary
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secondary.createConfigmap" -}}
|
||||||
|
{{- if and (eq .Values.architecture "replication") .Values.secondary.configuration (not .Values.secondary.existingConfigmap) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with MariaDB credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secretName" -}}
|
||||||
|
{{- if .Values.auth.existingSecret -}}
|
||||||
|
{{- printf "%s" .Values.auth.existingSecret -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "common.names.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a secret object should be created for MariaDB
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.createSecret" -}}
|
||||||
|
{{- if and (not .Values.auth.existingSecret) (not .Values.auth.customPasswordFiles) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Compile all warnings into a single message, and call fail.
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.validateValues" -}}
|
||||||
|
{{- $messages := list -}}
|
||||||
|
{{- $messages := append $messages (include "mariadb.validateValues.architecture" .) -}}
|
||||||
|
{{- $messages := without $messages "" -}}
|
||||||
|
{{- $message := join "\n" $messages -}}
|
||||||
|
|
||||||
|
{{- if $message -}}
|
||||||
|
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Validate values of MariaDB - must provide a valid architecture */}}
|
||||||
|
{{- define "mariadb.validateValues.architecture" -}}
|
||||||
|
{{- if and (ne .Values.architecture "standalone") (ne .Values.architecture "replication") -}}
|
||||||
|
mariadb: architecture
|
||||||
|
Invalid architecture selected. Valid values are "standalone" and
|
||||||
|
"replication". Please set a valid architecture (--set architecture="xxxx")
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
4
gitea/charts/mariadb/templates/extra-list.yaml
Normal file
4
gitea/charts/mariadb/templates/extra-list.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{- range .Values.extraDeploy }}
|
||||||
|
---
|
||||||
|
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
|
||||||
|
{{- end }}
|
||||||
18
gitea/charts/mariadb/templates/primary/configmap.yaml
Normal file
18
gitea/charts/mariadb/templates/primary/configmap.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{{- if (include "mariadb.primary.createConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
my.cnf: |-
|
||||||
|
{{ .Values.primary.configuration | indent 4 }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
{{- if and .Values.initdbScripts (not .Values.initdbScriptsConfigMap) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-init-scripts" (include "mariadb.primary.fullname" .) }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
data:
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }}
|
||||||
|
{{ end }}
|
||||||
25
gitea/charts/mariadb/templates/primary/pdb.yaml
Normal file
25
gitea/charts/mariadb/templates/primary/pdb.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{{- if .Values.primary.pdb.enabled }}
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.primary.pdb.minAvailable }}
|
||||||
|
minAvailable: {{ .Values.primary.pdb.minAvailable }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.pdb.maxUnavailable }}
|
||||||
|
maxUnavailable: {{ .Values.primary.pdb.maxUnavailable }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- end }}
|
||||||
338
gitea/charts/mariadb/templates/primary/statefulset.yaml
Normal file
338
gitea/charts/mariadb/templates/primary/statefulset.yaml
Normal file
@ -0,0 +1,338 @@
|
|||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
serviceName: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
updateStrategy:
|
||||||
|
type: {{ .Values.primary.updateStrategy }}
|
||||||
|
{{- if (eq "Recreate" .Values.primary.updateStrategy) }}
|
||||||
|
rollingUpdate: null
|
||||||
|
{{- else if .Values.primary.rollingUpdatePartition }}
|
||||||
|
rollingUpdate:
|
||||||
|
partition: {{ .Values.primary.rollingUpdatePartition }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if (include "mariadb.primary.createConfigmap" .) }}
|
||||||
|
checksum/configuration: {{ include (print $.Template.BasePath "/primary/configmap.yaml") . | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "mariadb.imagePullSecrets" . | nindent 6 }}
|
||||||
|
{{- if .Values.primary.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.primary.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.schedulerName }}
|
||||||
|
schedulerName: {{ .Values.schedulerName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ template "mariadb.serviceAccountName" . }}
|
||||||
|
{{- if .Values.primary.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.primary.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAffinityPreset "component" "primary" "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAntiAffinityPreset "component" "primary" "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.primary.nodeAffinityPreset.type "key" .Values.primary.nodeAffinityPreset.key "values" .Values.primary.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.primary.tolerations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.primary.priorityClassName | quote }}
|
||||||
|
{{- else if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.primary.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.initContainers (and .Values.primary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.primary.persistence.enabled) }}
|
||||||
|
initContainers:
|
||||||
|
{{- if .Values.primary.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.initContainers "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.primary.persistence.enabled }}
|
||||||
|
- name: volume-permissions
|
||||||
|
image: {{ include "mariadb.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
chown -R {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }} /bitnami/mariadb
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
{{- if .Values.volumePermissions.resources }}
|
||||||
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.primary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.primary.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.primary.args "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if not (empty .Values.auth.username) }}
|
||||||
|
- name: MARIADB_USER
|
||||||
|
value: {{ .Values.auth.username | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-password" .Values.auth.customPasswordFiles.user }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
value: {{ .Values.auth.database | quote }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- name: MARIADB_REPLICATION_MODE
|
||||||
|
value: "master"
|
||||||
|
- name: MARIADB_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-replication-password" .Values.auth.customPasswordFiles.replicator }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraFlags }}
|
||||||
|
- name: MARIADB_EXTRA_FLAGS
|
||||||
|
value: "{{ .Values.primary.extraFlags }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.extraEnvVarsCM .Values.primary.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.primary.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.primary.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.primary.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: 3306
|
||||||
|
{{- if .Values.primary.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.primary.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mysqladmin status -uroot -p"${password_aux}"
|
||||||
|
{{- else if .Values.primary.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.primary.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mysqladmin status -uroot -p"${password_aux}"
|
||||||
|
{{- else if .Values.primary.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.resources }}
|
||||||
|
resources: {{ toYaml .Values.primary.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
mountPath: /docker-entrypoint-initdb.d
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf/my.cnf
|
||||||
|
subPath: my.cnf
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mariadb/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ include "mariadb.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
DATA_SOURCE_NAME="root:${password_aux}@(localhost:3306)/" /bin/mysqld_exporter {{- range .Values.metrics.extraArgs.primary }} {{ . }} {{- end }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: 9104
|
||||||
|
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mysqld-exporter/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.sidecars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.sidecars "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "mariadb.primary.configmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ template "mariadb.initdbScriptsCM" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.secretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: mariadb-root-password
|
||||||
|
- key: mariadb-password
|
||||||
|
path: mariadb-password
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumes "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.persistence.enabled .Values.primary.persistence.existingClaim }}
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ tpl .Values.primary.persistence.existingClaim . }}
|
||||||
|
{{- else if not .Values.primary.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else if and .Values.primary.persistence.enabled (not .Values.primary.persistence.existingClaim) }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
labels: {{ include "common.labels.matchLabels" . | nindent 10 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.primary.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.primary.persistence.size | quote }}
|
||||||
|
{{ include "common.storage.class" (dict "persistence" .Values.primary.persistence "global" .Values.global) }}
|
||||||
|
{{- if .Values.primary.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
49
gitea/charts/mariadb/templates/primary/svc.yaml
Normal file
49
gitea/charts/mariadb/templates/primary/svc.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.service.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.service.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.primary.service.type }}
|
||||||
|
{{- if and (eq .Values.primary.service.type "ClusterIP") .Values.primary.service.clusterIP }}
|
||||||
|
clusterIP: {{ .Values.primary.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.service.loadBalancerIP (eq .Values.primary.service.type "LoadBalancer") }}
|
||||||
|
loadBalancerIP: {{ .Values.primary.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.primary.service.type "LoadBalancer") .Values.primary.service.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges: {{- toYaml .Values.primary.service.loadBalancerSourceRanges | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: {{ .Values.primary.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: mysql
|
||||||
|
{{- if (and (or (eq .Values.primary.service.type "NodePort") (eq .Values.primary.service.type "LoadBalancer")) .Values.primary.service.nodePort) }}
|
||||||
|
nodePort: {{ .Values.primary.service.nodePort }}
|
||||||
|
{{- else if eq .Values.primary.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
port: 9104
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: metrics
|
||||||
|
{{- end }}
|
||||||
|
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
21
gitea/charts/mariadb/templates/role.yaml
Normal file
21
gitea/charts/mariadb/templates/role.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{{- if and .Values.serviceAccount.create .Values.rbac.create }}
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- endpoints
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
{{- end }}
|
||||||
21
gitea/charts/mariadb/templates/rolebinding.yaml
Normal file
21
gitea/charts/mariadb/templates/rolebinding.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{{- if and .Values.serviceAccount.create .Values.rbac.create }}
|
||||||
|
kind: RoleBinding
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ include "mariadb.serviceAccountName" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: {{ include "common.names.fullname" . -}}
|
||||||
|
{{- end }}
|
||||||
18
gitea/charts/mariadb/templates/secondary/configmap.yaml
Normal file
18
gitea/charts/mariadb/templates/secondary/configmap.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{{- if (include "mariadb.secondary.createConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
my.cnf: |-
|
||||||
|
{{ .Values.secondary.configuration | indent 4 }}
|
||||||
|
{{- end -}}
|
||||||
25
gitea/charts/mariadb/templates/secondary/pdb.yaml
Normal file
25
gitea/charts/mariadb/templates/secondary/pdb.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{{- if and (eq .Values.architecture "replication") .Values.secondary.pdb.enabled }}
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.secondary.pdb.minAvailable }}
|
||||||
|
minAvailable: {{ .Values.secondary.pdb.minAvailable }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.pdb.maxUnavailable }}
|
||||||
|
maxUnavailable: {{ .Values.secondary.pdb.maxUnavailable }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- end }}
|
||||||
311
gitea/charts/mariadb/templates/secondary/statefulset.yaml
Normal file
311
gitea/charts/mariadb/templates/secondary/statefulset.yaml
Normal file
@ -0,0 +1,311 @@
|
|||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.secondary.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
serviceName: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
updateStrategy:
|
||||||
|
type: {{ .Values.secondary.updateStrategy }}
|
||||||
|
{{- if (eq "Recreate" .Values.secondary.updateStrategy) }}
|
||||||
|
rollingUpdate: null
|
||||||
|
{{- else if .Values.secondary.rollingUpdatePartition }}
|
||||||
|
rollingUpdate:
|
||||||
|
partition: {{ .Values.secondary.rollingUpdatePartition }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if (include "mariadb.secondary.createConfigmap" .) }}
|
||||||
|
checksum/configuration: {{ include (print $.Template.BasePath "/secondary/configmap.yaml") . | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "mariadb.imagePullSecrets" . | nindent 6 }}
|
||||||
|
{{- if .Values.schedulerName }}
|
||||||
|
schedulerName: {{ .Values.schedulerName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ template "mariadb.serviceAccountName" . }}
|
||||||
|
{{- if .Values.secondary.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAffinityPreset "component" "secondary" "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAntiAffinityPreset "component" "secondary" "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.secondary.nodeAffinityPreset.type "key" .Values.secondary.nodeAffinityPreset.key "values" .Values.secondary.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.tolerations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.secondary.priorityClassName | quote }}
|
||||||
|
{{- else if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.secondary.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.initContainers (and .Values.secondary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.secondary.persistence.enabled) }}
|
||||||
|
initContainers:
|
||||||
|
{{- if .Values.secondary.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.initContainers "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.secondary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.secondary.persistence.enabled }}
|
||||||
|
- name: volume-permissions
|
||||||
|
image: {{ include "mariadb.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
chown -R {{ .Values.secondary.containerSecurityContext.runAsUser }}:{{ .Values.secondary.podSecurityContext.fsGroup }} /bitnami/mariadb
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
{{- if .Values.volumePermissions.resources }}
|
||||||
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.secondary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.secondary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.secondary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.secondary.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.args "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
||||||
|
- name: MARIADB_REPLICATION_MODE
|
||||||
|
value: "slave"
|
||||||
|
- name: MARIADB_MASTER_HOST
|
||||||
|
value: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
- name: MARIADB_MASTER_PORT_NUMBER
|
||||||
|
value: {{ .Values.primary.service.port | quote }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_USER
|
||||||
|
value: "root"
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
- name: MARIADB_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-replication-password" .Values.auth.customPasswordFiles.replicator }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraFlags }}
|
||||||
|
- name: MARIADB_EXTRA_FLAGS
|
||||||
|
value: "{{ .Values.secondary.extraFlags }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.extraEnvVarsCM .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.secondary.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.secondary.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: 3306
|
||||||
|
{{- if .Values.secondary.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.secondary.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_MASTER_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_MASTER_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mysqladmin status -uroot -p"${password_aux}"
|
||||||
|
{{- else if .Values.secondary.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.secondary.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_MASTER_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_MASTER_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mysqladmin status -uroot -p"${password_aux}"
|
||||||
|
{{- else if .Values.secondary.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.resources }}
|
||||||
|
resources: {{ toYaml .Values.secondary.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.secondary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.secondary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf/my.cnf
|
||||||
|
subPath: my.cnf
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mariadb/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ include "mariadb.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
DATA_SOURCE_NAME="root:${password_aux}@(localhost:3306)/" /bin/mysqld_exporter {{- range .Values.metrics.extraArgs.secondary }} {{ . }} {{- end }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: 9104
|
||||||
|
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mysqld-exporter/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.sidecars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.sidecars "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "mariadb.secondary.configmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.secretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: mariadb-root-password
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumes "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.secondary.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
labels: {{ include "common.labels.matchLabels" . | nindent 10 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.secondary.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.secondary.persistence.size | quote }}
|
||||||
|
{{ include "common.storage.class" (dict "persistence" .Values.secondary.persistence "global" .Values.global) }}
|
||||||
|
{{- if .Values.secondary.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
51
gitea/charts/mariadb/templates/secondary/svc.yaml
Normal file
51
gitea/charts/mariadb/templates/secondary/svc.yaml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.service.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secondary.service.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.secondary.service.type }}
|
||||||
|
{{- if and (eq .Values.secondary.service.type "ClusterIP") .Values.secondary.service.clusterIP }}
|
||||||
|
clusterIP: {{ .Values.secondary.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.secondary.service.loadBalancerIP (eq .Values.secondary.service.type "LoadBalancer") }}
|
||||||
|
loadBalancerIP: {{ .Values.secondary.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.secondary.service.type "LoadBalancer") .Values.secondary.service.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges: {{- toYaml .Values.secondary.service.loadBalancerSourceRanges | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: {{ .Values.secondary.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: mysql
|
||||||
|
{{- if (and (or (eq .Values.secondary.service.type "NodePort") (eq .Values.secondary.service.type "LoadBalancer")) .Values.secondary.service.nodePort) }}
|
||||||
|
nodePort: {{ .Values.secondary.service.nodePort }}
|
||||||
|
{{- else if eq .Values.secondary.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
port: 9104
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: metrics
|
||||||
|
{{- end }}
|
||||||
|
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- end }}
|
||||||
39
gitea/charts/mariadb/templates/secrets.yaml
Normal file
39
gitea/charts/mariadb/templates/secrets.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{{- if eq (include "mariadb.createSecret" .) "true" }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
{{- if not (empty .Values.auth.rootPassword) }}
|
||||||
|
mariadb-root-password: {{ .Values.auth.rootPassword | b64enc | quote }}
|
||||||
|
{{- else if (not .Values.auth.forcePassword) }}
|
||||||
|
mariadb-root-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-root-password: {{ required "A MariaDB Root Password is required!" .Values.auth.rootPassword }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty .Values.auth.username)) (not (empty .Values.auth.password)) }}
|
||||||
|
mariadb-password: {{ .Values.auth.password | b64enc | quote }}
|
||||||
|
{{- else if (not .Values.auth.forcePassword) }}
|
||||||
|
mariadb-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-password: {{ required "A MariaDB Database Password is required!" .Values.auth.password }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- if not (empty .Values.auth.replicationPassword) }}
|
||||||
|
mariadb-replication-password: {{ .Values.auth.replicationPassword | b64enc | quote }}
|
||||||
|
{{- else if (not .Values.auth.forcePassword) }}
|
||||||
|
mariadb-replication-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-replication-password: {{ required "A MariaDB Replication Password is required!" .Values.auth.replicationPassword }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
18
gitea/charts/mariadb/templates/serviceaccount.yaml
Normal file
18
gitea/charts/mariadb/templates/serviceaccount.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.serviceAccount.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
41
gitea/charts/mariadb/templates/servicemonitor.yaml
Normal file
41
gitea/charts/mariadb/templates/servicemonitor.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
{{- else }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- port: metrics
|
||||||
|
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||||
|
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.relabellings }}
|
||||||
|
metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ .Release.Namespace }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
176
gitea/charts/mariadb/values.schema.json
Normal file
176
gitea/charts/mariadb/values.schema.json
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/schema#",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"architecture": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "MariaDB architecture",
|
||||||
|
"form": true,
|
||||||
|
"description": "Allowed values: `standalone` or `replication`"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Authentication configuration",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"rootPassword": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "MariaDB root password",
|
||||||
|
"form": true,
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set"
|
||||||
|
},
|
||||||
|
"database": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "MariaDB custom database",
|
||||||
|
"description": "Name of the custom database to be created during the 1st initialization of MariaDB",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "MariaDB custom user",
|
||||||
|
"description": "Name of the custom user to be created during the 1st initialization of MariaDB. This user only has permissions on the MariaDB custom database",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Password for MariaDB custom user",
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": false,
|
||||||
|
"path": "usePassword"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replicationUser": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "MariaDB replication user",
|
||||||
|
"description": "Name of user used to manage replication.",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": "standalone",
|
||||||
|
"path": "architecture"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replicationPassword": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Password for MariaDB replication user",
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": "standalone",
|
||||||
|
"path": "architecture"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"primary": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Primary replicas settings",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"persistence": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Persistence for primary replicas",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"form": true,
|
||||||
|
"title": "Enable persistence",
|
||||||
|
"description": "Enable persistence using Persistent Volume Claims"
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Persistent Volume Size",
|
||||||
|
"form": true,
|
||||||
|
"render": "slider",
|
||||||
|
"sliderMin": 1,
|
||||||
|
"sliderMax": 100,
|
||||||
|
"sliderUnit": "Gi",
|
||||||
|
"hidden": {
|
||||||
|
"value": false,
|
||||||
|
"path": "persistence/enabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"secondary": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Secondary replicas settings",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": false,
|
||||||
|
"path": "replication/enabled"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"persistence": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Persistence for secondary replicas",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"form": true,
|
||||||
|
"title": "Enable persistence",
|
||||||
|
"description": "Enable persistence using Persistent Volume Claims"
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Persistent Volume Size",
|
||||||
|
"form": true,
|
||||||
|
"render": "slider",
|
||||||
|
"sliderMin": 1,
|
||||||
|
"sliderMax": 100,
|
||||||
|
"sliderUnit": "Gi",
|
||||||
|
"hidden": {
|
||||||
|
"value": false,
|
||||||
|
"path": "persistence/enabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"volumePermissions": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"form": true,
|
||||||
|
"title": "Enable Init Containers",
|
||||||
|
"description": "Use an init container to set required folder permissions on the data volume before mounting it in the final destination"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"metrics": {
|
||||||
|
"type": "object",
|
||||||
|
"form": true,
|
||||||
|
"title": "Prometheus metrics details",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Create Prometheus metrics exporter",
|
||||||
|
"description": "Create a side-car container to expose Prometheus metrics",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"serviceMonitor": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Create Prometheus Operator ServiceMonitor",
|
||||||
|
"description": "Create a ServiceMonitor to track metrics using Prometheus Operator",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": false,
|
||||||
|
"path": "metrics/enabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
870
gitea/charts/mariadb/values.yaml
Normal file
870
gitea/charts/mariadb/values.yaml
Normal file
@ -0,0 +1,870 @@
|
|||||||
|
## Global Docker image parameters
|
||||||
|
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||||
|
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||||
|
##
|
||||||
|
# global:
|
||||||
|
# imageRegistry: myRegistryName
|
||||||
|
# imagePullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
# storageClass: myStorageClass
|
||||||
|
|
||||||
|
## Bitnami MariaDB image
|
||||||
|
## ref: https://hub.docker.com/r/bitnami/mariadb/tags/
|
||||||
|
##
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: bitnami/mariadb
|
||||||
|
tag: 10.5.9-debian-10-r28
|
||||||
|
## Specify a imagePullPolicy
|
||||||
|
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||||
|
##
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace)
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
## Example:
|
||||||
|
## pullSecrets:
|
||||||
|
## - myRegistryKeySecretName
|
||||||
|
##
|
||||||
|
pullSecrets: []
|
||||||
|
## Set to true if you would like to see extra information on logs
|
||||||
|
## It turns BASH and/or NAMI debugging in the image
|
||||||
|
##
|
||||||
|
debug: false
|
||||||
|
|
||||||
|
## String to partially override mariadb.fullname template (will maintain the release name)
|
||||||
|
##
|
||||||
|
# nameOverride:
|
||||||
|
|
||||||
|
## String to fully override mariadb.fullname template
|
||||||
|
##
|
||||||
|
# fullnameOverride:
|
||||||
|
|
||||||
|
## Cluster domain
|
||||||
|
##
|
||||||
|
clusterDomain: cluster.local
|
||||||
|
|
||||||
|
## Common annotations to add to all MariaDB resources (sub-charts are not considered). Evaluated as a template
|
||||||
|
##
|
||||||
|
commonAnnotations: {}
|
||||||
|
|
||||||
|
## Common labels to add to all MariaDB resources (sub-charts are not considered). Evaluated as a template
|
||||||
|
##
|
||||||
|
commonLabels: {}
|
||||||
|
|
||||||
|
## Use an alternate scheduler, e.g. "stork".
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||||
|
##
|
||||||
|
# schedulerName:
|
||||||
|
|
||||||
|
## MariaDB architecture. Allowed values: standalone or replication
|
||||||
|
##
|
||||||
|
architecture: standalone
|
||||||
|
|
||||||
|
## MariaDB Authentication parameters
|
||||||
|
##
|
||||||
|
auth:
|
||||||
|
## MariaDB root password
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-the-root-password-on-first-run
|
||||||
|
##
|
||||||
|
rootPassword: ""
|
||||||
|
## MariaDB custom user and database
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-on-first-run
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
|
||||||
|
##
|
||||||
|
database: my_database
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
## MariaDB replication user and password
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-up-a-replication-cluster
|
||||||
|
##
|
||||||
|
replicationUser: replicator
|
||||||
|
replicationPassword: ""
|
||||||
|
## Existing secret with MariaDB credentials
|
||||||
|
## NOTE: When it's set the previous parameters are ignored.
|
||||||
|
##
|
||||||
|
# existingSecret: name-of-existing-secret
|
||||||
|
## Force users to specify required passwords
|
||||||
|
##
|
||||||
|
forcePassword: false
|
||||||
|
## Mount credentials as files instead of using an environment variable
|
||||||
|
##
|
||||||
|
usePasswordFiles: false
|
||||||
|
## Use custom secret files other than chart provided when usePasswordFiles is set to "true"
|
||||||
|
## Example:
|
||||||
|
## customPasswordFiles:
|
||||||
|
## root: /vault/secrets/mariadb-root
|
||||||
|
## user: /vault/secrets/mariadb-user
|
||||||
|
## replicator: /vault/secrets/mariadb-replicator
|
||||||
|
##
|
||||||
|
customPasswordFiles: {}
|
||||||
|
|
||||||
|
## initdb scripts
|
||||||
|
## Specify dictionary of scripts to be run at first boot
|
||||||
|
## Example:
|
||||||
|
## initdbScripts:
|
||||||
|
## my_init_script.sh: |
|
||||||
|
## #!/bin/bash
|
||||||
|
## echo "Do something."
|
||||||
|
##
|
||||||
|
initdbScripts: {}
|
||||||
|
|
||||||
|
## Existing ConfigMap with custom init scripts
|
||||||
|
##
|
||||||
|
# initdbScriptsConfigMap:
|
||||||
|
|
||||||
|
## Mariadb Primary parameters
|
||||||
|
##
|
||||||
|
primary:
|
||||||
|
## Command and args for running the container (set to default if not set). Use array form
|
||||||
|
##
|
||||||
|
command: []
|
||||||
|
args: []
|
||||||
|
|
||||||
|
## Deployment pod host aliases
|
||||||
|
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
|
||||||
|
##
|
||||||
|
hostAliases: []
|
||||||
|
|
||||||
|
## Configure MariaDB Primary with a custom my.cnf file
|
||||||
|
## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
|
||||||
|
##
|
||||||
|
configuration: |-
|
||||||
|
[mysqld]
|
||||||
|
skip-name-resolve
|
||||||
|
explicit_defaults_for_timestamp
|
||||||
|
basedir=/opt/bitnami/mariadb
|
||||||
|
plugin_dir=/opt/bitnami/mariadb/plugin
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
tmpdir=/opt/bitnami/mariadb/tmp
|
||||||
|
max_allowed_packet=16M
|
||||||
|
bind-address=0.0.0.0
|
||||||
|
pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
|
||||||
|
log-error=/opt/bitnami/mariadb/logs/mysqld.log
|
||||||
|
character-set-server=UTF8
|
||||||
|
collation-server=utf8_general_ci
|
||||||
|
|
||||||
|
[client]
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
default-character-set=UTF8
|
||||||
|
plugin_dir=/opt/bitnami/mariadb/plugin
|
||||||
|
|
||||||
|
[manager]
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
|
||||||
|
|
||||||
|
## Name of existing ConfigMap with MariaDB Primary configuration.
|
||||||
|
## NOTE: When it's set the 'configuration' parameter is ignored
|
||||||
|
##
|
||||||
|
# existingConfiguration:
|
||||||
|
|
||||||
|
## updateStrategy for Mariadb Primary statefulset
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
|
||||||
|
##
|
||||||
|
updateStrategy: RollingUpdate
|
||||||
|
|
||||||
|
## Partition update strategy for Mariadb Primary statefulset
|
||||||
|
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||||
|
##
|
||||||
|
# rollingUpdatePartition:
|
||||||
|
|
||||||
|
## Mariadb Primary pod annotations
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||||
|
##
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
|
## Mariadb Primary pod affinity preset
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAffinityPreset: ""
|
||||||
|
|
||||||
|
## Mariadb Primary pod anti-affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAntiAffinityPreset: soft
|
||||||
|
|
||||||
|
## Mariadb Primary node affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
nodeAffinityPreset:
|
||||||
|
## Node affinity type
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
type: ""
|
||||||
|
## Node label key to match
|
||||||
|
## E.g.
|
||||||
|
## key: "kubernetes.io/e2e-az-name"
|
||||||
|
##
|
||||||
|
key: ""
|
||||||
|
## Node label values to match
|
||||||
|
## E.g.
|
||||||
|
## values:
|
||||||
|
## - e2e-az1
|
||||||
|
## - e2e-az2
|
||||||
|
##
|
||||||
|
values: []
|
||||||
|
|
||||||
|
## Affinity for MariaDB primary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||||
|
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||||
|
##
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
## Node labels for MariaDB primary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
|
##
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
## Tolerations for MariaDB primary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
##
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
## Priority class for MariaDB primary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
|
##
|
||||||
|
priorityClassName: ""
|
||||||
|
|
||||||
|
## MariaDB primary Pod security context
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
|
||||||
|
##
|
||||||
|
podSecurityContext:
|
||||||
|
enabled: true
|
||||||
|
fsGroup: 1001
|
||||||
|
|
||||||
|
## MariaDB primary container security context
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
|
||||||
|
##
|
||||||
|
containerSecurityContext:
|
||||||
|
enabled: true
|
||||||
|
runAsUser: 1001
|
||||||
|
|
||||||
|
## MariaDB primary container's resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources:
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
limits: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
requests: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
|
||||||
|
## MariaDB primary container's liveness and readiness probes
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||||
|
##
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
successThreshold: 1
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
successThreshold: 1
|
||||||
|
|
||||||
|
## MariaDB primary custom liveness probe
|
||||||
|
##
|
||||||
|
customLivenessProbe: {}
|
||||||
|
|
||||||
|
## MariaDB primary custom rediness probe
|
||||||
|
##
|
||||||
|
customReadinessProbe: {}
|
||||||
|
|
||||||
|
## MariaDB primary additional command line flags
|
||||||
|
## Can be used to specify command line flags, for example:
|
||||||
|
## E.g.
|
||||||
|
## extraFlags: "--max-connect-errors=1000 --max_connections=155"
|
||||||
|
##
|
||||||
|
extraFlags: ""
|
||||||
|
|
||||||
|
## An array to add extra environment variables on MariaDB primary containers
|
||||||
|
## E.g.
|
||||||
|
## extraEnvVars:
|
||||||
|
## - name: TZ
|
||||||
|
## value: "Europe/Paris"
|
||||||
|
##
|
||||||
|
extraEnvVars: []
|
||||||
|
|
||||||
|
## ConfigMap with extra env vars for MariaDB primary containers:
|
||||||
|
##
|
||||||
|
extraEnvVarsCM: ""
|
||||||
|
|
||||||
|
## Secret with extra env vars for MariaDB primary containers:
|
||||||
|
##
|
||||||
|
extraEnvVarsSecret: ""
|
||||||
|
|
||||||
|
## Enable persistence using Persistent Volume Claims
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||||
|
##
|
||||||
|
persistence:
|
||||||
|
## If true, use a Persistent Volume Claim, If false, use emptyDir
|
||||||
|
##
|
||||||
|
enabled: true
|
||||||
|
## Name of existing PVC to hold MariaDB Primary data
|
||||||
|
## NOTE: When it's set the rest of persistence parameters are ignored
|
||||||
|
##
|
||||||
|
# existingClaim:
|
||||||
|
## Subdirectory of the volume to mount
|
||||||
|
# subPath:
|
||||||
|
## Persistent Volume Storage Class
|
||||||
|
## If defined, storageClassName: <storageClass>
|
||||||
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
|
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||||
|
## GKE, AWS & OpenStack)
|
||||||
|
##
|
||||||
|
# storageClass: "-"
|
||||||
|
## Persistent Volume Claim annotations
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
## Persistent Volume Access Mode
|
||||||
|
##
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
## Persistent Volume size
|
||||||
|
##
|
||||||
|
size: 8Gi
|
||||||
|
## selector can be used to match an existing PersistentVolume
|
||||||
|
## selector:
|
||||||
|
## matchLabels:
|
||||||
|
## app: my-app
|
||||||
|
##
|
||||||
|
selector: {}
|
||||||
|
|
||||||
|
## Extra volumes to add to the MariaDB Primary pod(s)
|
||||||
|
##
|
||||||
|
extraVolumes: []
|
||||||
|
|
||||||
|
## Extra volume mounts to add to the MariaDB Primary container(s)
|
||||||
|
##
|
||||||
|
extraVolumeMounts: []
|
||||||
|
|
||||||
|
## Extra init containers to add to the MariaDB Primary pod(s)
|
||||||
|
##
|
||||||
|
initContainers: []
|
||||||
|
|
||||||
|
## Extra sidecar containers to add to the MariaDB Primary pod(s)
|
||||||
|
##
|
||||||
|
sidecars: []
|
||||||
|
|
||||||
|
## MariaDB Primary Service parameters
|
||||||
|
##
|
||||||
|
service:
|
||||||
|
## Service type
|
||||||
|
##
|
||||||
|
type: ClusterIP
|
||||||
|
## Service port
|
||||||
|
##
|
||||||
|
port: 3306
|
||||||
|
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||||
|
##
|
||||||
|
nodePort: ""
|
||||||
|
## Service clusterIP
|
||||||
|
##
|
||||||
|
# clusterIP: None
|
||||||
|
clusterIP: ""
|
||||||
|
## Set the LoadBalancer service type to internal only.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||||
|
##
|
||||||
|
loadBalancerIP: ""
|
||||||
|
## Load Balancer sources
|
||||||
|
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||||
|
## E.g.
|
||||||
|
## loadBalancerSourceRanges:
|
||||||
|
## - 10.10.10.0/24
|
||||||
|
##
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
|
## Provide any additional annotations which may be required
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
## MariaDB primary Pod Disruption Budget configuration
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
|
||||||
|
##
|
||||||
|
pdb:
|
||||||
|
enabled: false
|
||||||
|
## Min number of pods that must still be available after the eviction
|
||||||
|
##
|
||||||
|
minAvailable: 1
|
||||||
|
## Max number of pods that can be unavailable after the eviction
|
||||||
|
##
|
||||||
|
# maxUnavailable: 1
|
||||||
|
|
||||||
|
## Mariadb Secondary parameters
|
||||||
|
##
|
||||||
|
secondary:
|
||||||
|
## Number of Mariadb Secondary replicas to deploy
|
||||||
|
##
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
## Command and args for running the container (set to default if not set). Use array form
|
||||||
|
##
|
||||||
|
command: []
|
||||||
|
args: []
|
||||||
|
|
||||||
|
## Deployment pod host aliases
|
||||||
|
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
|
||||||
|
##
|
||||||
|
hostAliases: []
|
||||||
|
|
||||||
|
## Configure MariaDB Secondary with a custom my.cnf file
|
||||||
|
## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
|
||||||
|
##
|
||||||
|
configuration: |-
|
||||||
|
[mysqld]
|
||||||
|
skip-name-resolve
|
||||||
|
explicit_defaults_for_timestamp
|
||||||
|
basedir=/opt/bitnami/mariadb
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
tmpdir=/opt/bitnami/mariadb/tmp
|
||||||
|
max_allowed_packet=16M
|
||||||
|
bind-address=0.0.0.0
|
||||||
|
pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
|
||||||
|
log-error=/opt/bitnami/mariadb/logs/mysqld.log
|
||||||
|
character-set-server=UTF8
|
||||||
|
collation-server=utf8_general_ci
|
||||||
|
|
||||||
|
[client]
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
default-character-set=UTF8
|
||||||
|
|
||||||
|
[manager]
|
||||||
|
port=3306
|
||||||
|
socket=/opt/bitnami/mariadb/tmp/mysql.sock
|
||||||
|
pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
|
||||||
|
|
||||||
|
## Name of existing ConfigMap with MariaDB Secondary configuration.
|
||||||
|
## NOTE: When it's set the 'configuration' parameter is ignored
|
||||||
|
##
|
||||||
|
# existingConfiguration:
|
||||||
|
|
||||||
|
## updateStrategy for Mariadb Secondary statefulset
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
|
||||||
|
##
|
||||||
|
updateStrategy: RollingUpdate
|
||||||
|
|
||||||
|
## Partition update strategy for Mariadb Secondary statefulset
|
||||||
|
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||||
|
##
|
||||||
|
# rollingUpdatePartition:
|
||||||
|
|
||||||
|
## Mariadb Secondary pod annotations
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||||
|
##
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
|
## Mariadb Secondary pod affinity preset
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAffinityPreset: ""
|
||||||
|
|
||||||
|
## Mariadb Secondary pod anti-affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAntiAffinityPreset: soft
|
||||||
|
|
||||||
|
## Mariadb Secondary node affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
nodeAffinityPreset:
|
||||||
|
## Node affinity type
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
type: ""
|
||||||
|
## Node label key to match
|
||||||
|
## E.g.
|
||||||
|
## key: "kubernetes.io/e2e-az-name"
|
||||||
|
##
|
||||||
|
key: ""
|
||||||
|
## Node label values to match
|
||||||
|
## E.g.
|
||||||
|
## values:
|
||||||
|
## - e2e-az1
|
||||||
|
## - e2e-az2
|
||||||
|
##
|
||||||
|
values: []
|
||||||
|
|
||||||
|
## Affinity for MariaDB secondary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||||
|
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||||
|
##
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
## Node labels for MariaDB secondary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
|
##
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
## Tolerations for MariaDB secondary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
##
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
## Priority class for MariaDB secondary pods assignment
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
|
##
|
||||||
|
priorityClassName: ""
|
||||||
|
|
||||||
|
## MariaDB secondary Pod security context
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
|
||||||
|
##
|
||||||
|
podSecurityContext:
|
||||||
|
enabled: true
|
||||||
|
fsGroup: 1001
|
||||||
|
|
||||||
|
## MariaDB secondary container security context
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
|
||||||
|
##
|
||||||
|
containerSecurityContext:
|
||||||
|
enabled: true
|
||||||
|
runAsUser: 1001
|
||||||
|
|
||||||
|
## MariaDB secondary container's resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources:
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
limits: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
requests: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
|
||||||
|
## MariaDB secondary container's liveness and readiness probes
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||||
|
##
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
successThreshold: 1
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
successThreshold: 1
|
||||||
|
|
||||||
|
## MariaDB secondary custom liveness probe
|
||||||
|
##
|
||||||
|
customLivenessProbe: {}
|
||||||
|
|
||||||
|
## MariaDB secondary custom rediness probe
|
||||||
|
##
|
||||||
|
customReadinessProbe: {}
|
||||||
|
|
||||||
|
## MariaDB secondary additional command line flags
|
||||||
|
## Can be used to specify command line flags, for example:
|
||||||
|
## E.g.
|
||||||
|
## extraFlags: "--max-connect-errors=1000 --max_connections=155"
|
||||||
|
##
|
||||||
|
extraFlags: ""
|
||||||
|
|
||||||
|
## An array to add extra environment variables on MariaDB secondary containers
|
||||||
|
## E.g.
|
||||||
|
## extraEnvVars:
|
||||||
|
## - name: TZ
|
||||||
|
## value: "Europe/Paris"
|
||||||
|
##
|
||||||
|
extraEnvVars: []
|
||||||
|
|
||||||
|
## ConfigMap with extra env vars for MariaDB secondary containers:
|
||||||
|
##
|
||||||
|
extraEnvVarsCM: ""
|
||||||
|
|
||||||
|
## Secret with extra env vars for MariaDB secondary containers:
|
||||||
|
##
|
||||||
|
extraEnvVarsSecret: ""
|
||||||
|
|
||||||
|
## Enable persistence using Persistent Volume Claims
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||||
|
##
|
||||||
|
persistence:
|
||||||
|
## If true, use a Persistent Volume Claim, If false, use emptyDir
|
||||||
|
##
|
||||||
|
enabled: true
|
||||||
|
## Subdirectory of the volume to mount
|
||||||
|
# subPath:
|
||||||
|
## Persistent Volume Storage Class
|
||||||
|
## If defined, storageClassName: <storageClass>
|
||||||
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
|
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||||
|
## GKE, AWS & OpenStack)
|
||||||
|
##
|
||||||
|
# storageClass: "-"
|
||||||
|
## Persistent Volume Claim annotations
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
## Persistent Volume Access Mode
|
||||||
|
##
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
## Persistent Volume size
|
||||||
|
##
|
||||||
|
size: 8Gi
|
||||||
|
## selector can be used to match an existing PersistentVolume
|
||||||
|
## selector:
|
||||||
|
## matchLabels:
|
||||||
|
## app: my-app
|
||||||
|
##
|
||||||
|
selector: {}
|
||||||
|
|
||||||
|
## Extra volumes to add to the MariaDB Secondary pod(s)
|
||||||
|
##
|
||||||
|
extraVolumes: []
|
||||||
|
|
||||||
|
## Extra volume mounts to add to the MariaDB Secondary container(s)
|
||||||
|
##
|
||||||
|
extraVolumeMounts: []
|
||||||
|
|
||||||
|
## Extra init containers to add to the MariaDB Secondary pod(s)
|
||||||
|
##
|
||||||
|
initContainers: []
|
||||||
|
|
||||||
|
## Extra sidecar containers to add to the MariaDB Secondary pod(s)
|
||||||
|
##
|
||||||
|
sidecars: []
|
||||||
|
|
||||||
|
## MariaDB Secondary Service parameters
|
||||||
|
##
|
||||||
|
service:
|
||||||
|
## Service type
|
||||||
|
##
|
||||||
|
type: ClusterIP
|
||||||
|
## Service port
|
||||||
|
##
|
||||||
|
port: 3306
|
||||||
|
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||||
|
##
|
||||||
|
nodePort: ""
|
||||||
|
## Service clusterIP
|
||||||
|
##
|
||||||
|
# clusterIP: None
|
||||||
|
clusterIP: ""
|
||||||
|
## Set the LoadBalancer service type to internal only.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||||
|
##
|
||||||
|
loadBalancerIP: ""
|
||||||
|
## Load Balancer sources
|
||||||
|
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||||
|
## E.g.
|
||||||
|
## loadBalancerSourceRanges:
|
||||||
|
## - 10.10.10.0/24
|
||||||
|
##
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
|
## Provide any additional annotations which may be required
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
## MariaDB secondary Pod Disruption Budget configuration
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
|
||||||
|
##
|
||||||
|
pdb:
|
||||||
|
enabled: false
|
||||||
|
## Min number of pods that must still be available after the eviction
|
||||||
|
##
|
||||||
|
minAvailable: 1
|
||||||
|
## Max number of pods that can be unavailable after the eviction
|
||||||
|
##
|
||||||
|
# maxUnavailable: 1
|
||||||
|
|
||||||
|
## MariaDB pods ServiceAccount
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||||
|
##
|
||||||
|
serviceAccount:
|
||||||
|
## Specifies whether a ServiceAccount should be created
|
||||||
|
##
|
||||||
|
create: true
|
||||||
|
## The name of the ServiceAccount to use.
|
||||||
|
## If not set and create is true, a name is generated using the mariadb.fullname template
|
||||||
|
##
|
||||||
|
# name:
|
||||||
|
## Annotations to add to the service account (evaluated as a template)
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
## Role Based Access
|
||||||
|
## ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||||
|
##
|
||||||
|
rbac:
|
||||||
|
## Specifies whether RBAC rules should be created
|
||||||
|
##
|
||||||
|
create: false
|
||||||
|
|
||||||
|
## Init containers parameters:
|
||||||
|
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
|
||||||
|
##
|
||||||
|
volumePermissions:
|
||||||
|
enabled: false
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: bitnami/bitnami-shell
|
||||||
|
tag: "10"
|
||||||
|
pullPolicy: Always
|
||||||
|
## Optionally specify an array of imagePullSecrets.
|
||||||
|
## Secrets must be manually created in the namespace.
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
##
|
||||||
|
# pullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
resources: {}
|
||||||
|
|
||||||
|
## Mysqld Prometheus exporter parameters
|
||||||
|
##
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: bitnami/mysqld-exporter
|
||||||
|
tag: 0.12.1-debian-10-r389
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
## Optionally specify an array of imagePullSecrets.
|
||||||
|
## Secrets must be manually created in the namespace.
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
##
|
||||||
|
# pullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9104"
|
||||||
|
|
||||||
|
## Extra args to be passed to mysqld_exporter
|
||||||
|
## ref: https://github.com/prometheus/mysqld_exporter/
|
||||||
|
## E.g.
|
||||||
|
## - --collect.auto_increment.columns
|
||||||
|
## - --collect.binlog_size
|
||||||
|
## - --collect.engine_innodb_status
|
||||||
|
## - --collect.engine_tokudb_status
|
||||||
|
## - --collect.global_status
|
||||||
|
## - --collect.global_variables
|
||||||
|
## - --collect.info_schema.clientstats
|
||||||
|
## - --collect.info_schema.innodb_metrics
|
||||||
|
## - --collect.info_schema.innodb_tablespaces
|
||||||
|
## - --collect.info_schema.innodb_cmp
|
||||||
|
## - --collect.info_schema.innodb_cmpmem
|
||||||
|
## - --collect.info_schema.processlist
|
||||||
|
## - --collect.info_schema.processlist.min_time
|
||||||
|
## - --collect.info_schema.query_response_time
|
||||||
|
## - --collect.info_schema.tables
|
||||||
|
## - --collect.info_schema.tables.databases
|
||||||
|
## - --collect.info_schema.tablestats
|
||||||
|
## - --collect.info_schema.userstats
|
||||||
|
## - --collect.perf_schema.eventsstatements
|
||||||
|
## - --collect.perf_schema.eventsstatements.digest_text_limit
|
||||||
|
## - --collect.perf_schema.eventsstatements.limit
|
||||||
|
## - --collect.perf_schema.eventsstatements.timelimit
|
||||||
|
## - --collect.perf_schema.eventswaits
|
||||||
|
## - --collect.perf_schema.file_events
|
||||||
|
## - --collect.perf_schema.file_instances
|
||||||
|
## - --collect.perf_schema.indexiowaits
|
||||||
|
## - --collect.perf_schema.tableiowaits
|
||||||
|
## - --collect.perf_schema.tablelocks
|
||||||
|
## - --collect.perf_schema.replication_group_member_stats
|
||||||
|
## - --collect.slave_status
|
||||||
|
## - --collect.slave_hosts
|
||||||
|
## - --collect.heartbeat
|
||||||
|
## - --collect.heartbeat.database
|
||||||
|
## - --collect.heartbeat.table
|
||||||
|
##
|
||||||
|
extraArgs:
|
||||||
|
primary: []
|
||||||
|
secondary: []
|
||||||
|
|
||||||
|
## Mysqld Prometheus exporter resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources:
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
limits: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
requests: {}
|
||||||
|
# memory: 256Mi
|
||||||
|
# cpu: 100m
|
||||||
|
|
||||||
|
## Mysqld Prometheus exporter liveness and readiness probes
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||||
|
##
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
|
||||||
|
## Prometheus Service Monitor
|
||||||
|
## ref: https://github.com/coreos/prometheus-operator
|
||||||
|
##
|
||||||
|
serviceMonitor:
|
||||||
|
## If the operator is installed in your cluster, set to true to create a Service Monitor Entry
|
||||||
|
##
|
||||||
|
enabled: false
|
||||||
|
## Specify the namespace in which the serviceMonitor resource will be created
|
||||||
|
##
|
||||||
|
# namespace: ""
|
||||||
|
## Specify the interval at which metrics should be scraped
|
||||||
|
##
|
||||||
|
interval: 30s
|
||||||
|
## Specify the timeout after which the scrape is ended
|
||||||
|
##
|
||||||
|
# scrapeTimeout: 30s
|
||||||
|
## Specify Metric Relabellings to add to the scrape endpoint
|
||||||
|
##
|
||||||
|
# relabellings:
|
||||||
|
## Specify honorLabels parameter to add the scrape endpoint
|
||||||
|
##
|
||||||
|
honorLabels: false
|
||||||
|
## Specify the release for ServiceMonitor. Sometimes it should be custom for prometheus operator to work
|
||||||
|
##
|
||||||
|
# release: ""
|
||||||
|
## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
|
||||||
|
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
|
||||||
|
##
|
||||||
|
additionalLabels: {}
|
||||||
|
|
||||||
|
## Array with extra yaml to deploy with the chart. Evaluated as a template
|
||||||
|
##
|
||||||
|
extraDeploy: []
|
||||||
21
gitea/charts/memcached/.helmignore
Normal file
21
gitea/charts/memcached/.helmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
6
gitea/charts/memcached/Chart.lock
Normal file
6
gitea/charts/memcached/Chart.lock
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
version: 1.4.2
|
||||||
|
digest: sha256:4e3ec38e0e27e9fc1defb2a13f67a0aa12374bf0b15f06a6c13b1b46df6bffeb
|
||||||
|
generated: "2021-03-25T20:52:23.855156849Z"
|
||||||
24
gitea/charts/memcached/Chart.yaml
Normal file
24
gitea/charts/memcached/Chart.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
annotations:
|
||||||
|
category: Infrastructure
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 1.6.9
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 1.x.x
|
||||||
|
description: Chart for Memcached
|
||||||
|
home: https://github.com/bitnami/charts/tree/master/bitnami/memcached
|
||||||
|
icon: https://bitnami.com/assets/stacks/memcached/img/memcached-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- memcached
|
||||||
|
- cache
|
||||||
|
maintainers:
|
||||||
|
- email: containers@bitnami.com
|
||||||
|
name: Bitnami
|
||||||
|
name: memcached
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/bitnami-docker-memcached
|
||||||
|
- http://memcached.org/
|
||||||
|
version: 5.9.0
|
||||||
224
gitea/charts/memcached/README.md
Normal file
224
gitea/charts/memcached/README.md
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
# Memcached
|
||||||
|
|
||||||
|
> [Memcached](https://memcached.org/) is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
|
$ helm install my-release bitnami/memcached
|
||||||
|
```
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart bootstraps a [Memcached](https://github.com/bitnami/bitnami-docker-memcached) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 3.1.0
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
To install the chart with the release name `my-release`:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
|
$ helm install my-release bitnami/memcached
|
||||||
|
```
|
||||||
|
|
||||||
|
These commands deploy Memcached on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||||
|
|
||||||
|
> **Tip**: List all releases using `helm list`
|
||||||
|
|
||||||
|
## Uninstalling the Chart
|
||||||
|
|
||||||
|
To uninstall/delete the `my-release` deployment:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm delete my-release
|
||||||
|
```
|
||||||
|
|
||||||
|
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following tables lists the configurable parameters of the Memcached chart and their default values per section/component:
|
||||||
|
|
||||||
|
### Global parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|---------------------------|-------------------------------------------------|---------------------------------------------------------|
|
||||||
|
| `global.imageRegistry` | Global Docker image registry | `nil` |
|
||||||
|
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
|
||||||
|
### Common parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|---------------------|----------------------------------------------------------------------|--------------------------------|
|
||||||
|
| `nameOverride` | String to partially override common.names.fullname | `nil` |
|
||||||
|
| `fullnameOverride` | String to fully override common.names.fullname | `nil` |
|
||||||
|
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||||
|
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||||
|
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||||
|
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` (evaluated as a template) |
|
||||||
|
|
||||||
|
### Memcached parameters
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|------------------------------------------|-------------------------------------------------------------------------------------------|--------------------------------------------------------------|
|
||||||
|
| `image.registry` | Memcached image registry | `docker.io` |
|
||||||
|
| `image.repository` | Memcached Image name | `bitnami/memcached` |
|
||||||
|
| `image.tag` | Memcached Image tag | `{TAG_NAME}` |
|
||||||
|
| `image.pullPolicy` | Memcached image pull policy | `IfNotPresent` |
|
||||||
|
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
| `architecture` | Memcached architecture. Allowed values: standalone or high-availability | `standalone` |
|
||||||
|
| `replicaCount` | Number of containers | `1` |
|
||||||
|
| `command` | Default container command (useful when using custom images) | `[]` |
|
||||||
|
| `arguments` | Default container args (useful when using custom images) | `["/run.sh"]` |
|
||||||
|
| `extraEnv` | Additional env vars to pass | `{}` |
|
||||||
|
| `hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `memcachedUsername` | Memcached admin user | `nil` |
|
||||||
|
| `memcachedPassword` | Memcached admin password | `nil` |
|
||||||
|
| `service.type` | Kubernetes service type for Memcached | `ClusterIP` |
|
||||||
|
| `service.port` | Memcached service port | `11211` |
|
||||||
|
| `service.clusterIP` | Specific cluster IP when service type is cluster IP. Use `None` for headless service | `nil` |
|
||||||
|
| `service.nodePort` | Kubernetes Service nodePort | `nil` |
|
||||||
|
| `service.loadBalancerIP` | `loadBalancerIP` if service type is `LoadBalancer` | `nil` |
|
||||||
|
| `service.annotations` | Additional annotations for Memcached service | `{}` |
|
||||||
|
| `resources.requests` | CPU/Memory resource requests | `{memory: "256Mi", cpu: "250m"}` |
|
||||||
|
| `resources.limits` | CPU/Memory resource limits | `{}` |
|
||||||
|
| `portName` | Name of the main port exposed by memcached | `memcache` |
|
||||||
|
| `persistence.enabled` | Enable persistence using PVC (Requires architecture: "high-availability") | `true` |
|
||||||
|
| `persistence.storageClass` | PVC Storage Class for Memcached volume | `nil` (uses alpha storage class annotation) |
|
||||||
|
| `persistence.accessMode` | PVC Access Mode for Memcached volume | `ReadWriteOnce` |
|
||||||
|
| `persistence.size` | PVC Storage Request for Memcached volume | `8Gi` |
|
||||||
|
| `securityContext.enabled` | Enable security context | `true` |
|
||||||
|
| `securityContext.fsGroup` | Group ID for the container | `1001` |
|
||||||
|
| `securityContext.runAsUser` | User ID for the container | `1001` |
|
||||||
|
| `securityContext.readOnlyRootFilesystem` | Enable read-only filesystem | `false` |
|
||||||
|
| `podAnnotations` | Pod annotations | `{}` |
|
||||||
|
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||||
|
| `podLabels` | Add additional labels to the pod (evaluated as a template) | `nil` |
|
||||||
|
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` |
|
||||||
|
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||||
|
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||||
|
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||||
|
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||||
|
| `priorityClassName` | Controller priorityClassName | `nil` |
|
||||||
|
| `serviceAccount.create` | Enable creation of ServiceAccount for memcached pods | `true` |
|
||||||
|
| `serviceAccount.name` | The name of the service account to use. If not set and `create` is `true`, a name is generated | Generated using the `memcached.serviceAccountName` template |
|
||||||
|
| `serviceAccount.automountServiceAccountToken` | Enable/disable auto mounting of the service account token | `true` |
|
||||||
|
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
|
||||||
|
| `metrics.image.registry` | Memcached exporter image registry | `docker.io` |
|
||||||
|
| `metrics.image.repository` | Memcached exporter image name | `bitnami/memcached-exporter` |
|
||||||
|
| `metrics.image.tag` | Memcached exporter image tag | `{TAG_NAME}` |
|
||||||
|
| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` |
|
||||||
|
| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||||
|
| `metrics.podAnnotations` | Additional annotations for Metrics exporter | `{prometheus.io/scrape: "true", prometheus.io/port: "9150"}` |
|
||||||
|
| `metrics.resources` | Exporter resource requests/limit | `{}` |
|
||||||
|
| `metrics.portName` | Memcached exporter port name | `metrics` |
|
||||||
|
| `metrics.service.type` | Kubernetes service type for Prometheus metrics | `ClusterIP` |
|
||||||
|
| `metrics.service.port` | Prometheus metrics service port | `9150` |
|
||||||
|
| `metrics.service.annotations` | Prometheus exporter svc annotations | `{prometheus.io/scrape: "true", prometheus.io/port: "9150"}` |
|
||||||
|
|
||||||
|
The above parameters map to the env variables defined in [bitnami/memcached](http://github.com/bitnami/bitnami-docker-memcached). For more information please refer to the [bitnami/memcached](http://github.com/bitnami/bitnami-docker-memcached) image documentation.
|
||||||
|
|
||||||
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm install my-release --set memcachedUsername=user,memcachedPassword=password bitnami/memcached
|
||||||
|
```
|
||||||
|
|
||||||
|
The above command sets the Memcached admin account username and password to `user` and `password` respectively.
|
||||||
|
|
||||||
|
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
|
||||||
|
|
||||||
|
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm install my-release -f values.yaml bitnami/memcached
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||||
|
|
||||||
|
## Configuration and installation details
|
||||||
|
|
||||||
|
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||||
|
|
||||||
|
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||||
|
|
||||||
|
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||||
|
|
||||||
|
## Persistence
|
||||||
|
|
||||||
|
When using `architecture: "high-availability"` the [Bitnami Memcached](https://github.com/bitnami/bitnami-docker-memcached) image stores the cache-state at the `/cache-state` path of the container if enabled.
|
||||||
|
|
||||||
|
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
|
||||||
|
See the [Parameters](#parameters) section to configure the PVC or to disable persistence.
|
||||||
|
|
||||||
|
### Setting Pod's affinity
|
||||||
|
|
||||||
|
This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||||
|
|
||||||
|
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||||
|
|
||||||
|
## Notable changes
|
||||||
|
|
||||||
|
### 4.0.0
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||||
|
Use the workaround below to upgrade from versions previous to 4.0.0. The following example assumes that the release name is memcached:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ kubectl delete deployment memcached --cascade=false
|
||||||
|
$ helm upgrade memcached bitnami/memcached
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.0.0
|
||||||
|
|
||||||
|
This release uses the new bash based `bitnami/memcached` container which uses bash scripts for the start up logic of the container and is smaller in size.
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
### To 5.3.0
|
||||||
|
|
||||||
|
This version introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||||
|
|
||||||
|
### To 5.0.0
|
||||||
|
|
||||||
|
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||||
|
|
||||||
|
**What changes were introduced in this major version?**
|
||||||
|
|
||||||
|
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||||
|
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||||
|
|
||||||
|
**Considerations when upgrading to this version**
|
||||||
|
|
||||||
|
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||||
|
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||||
|
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||||
|
|
||||||
|
**Useful links**
|
||||||
|
|
||||||
|
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
|
||||||
|
- https://helm.sh/docs/topics/v2_v3_migration/
|
||||||
|
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
|
||||||
|
|
||||||
|
### To 1.0.0
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||||
|
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is memcached:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ kubectl patch deployment memcached --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
|
||||||
|
```
|
||||||
22
gitea/charts/memcached/charts/common/.helmignore
Normal file
22
gitea/charts/memcached/charts/common/.helmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
23
gitea/charts/memcached/charts/common/Chart.yaml
Normal file
23
gitea/charts/memcached/charts/common/Chart.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
annotations:
|
||||||
|
category: Infrastructure
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 1.4.2
|
||||||
|
description: A Library Helm Chart for grouping common logic between bitnami charts.
|
||||||
|
This chart is not deployable by itself.
|
||||||
|
home: https://github.com/bitnami/charts/tree/master/bitnami/common
|
||||||
|
icon: https://bitnami.com/downloads/logos/bitnami-mark.png
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
- helper
|
||||||
|
- template
|
||||||
|
- function
|
||||||
|
- bitnami
|
||||||
|
maintainers:
|
||||||
|
- email: containers@bitnami.com
|
||||||
|
name: Bitnami
|
||||||
|
name: common
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts
|
||||||
|
- http://www.bitnami.com/
|
||||||
|
type: library
|
||||||
|
version: 1.4.2
|
||||||
322
gitea/charts/memcached/charts/common/README.md
Normal file
322
gitea/charts/memcached/charts/common/README.md
Normal file
@ -0,0 +1,322 @@
|
|||||||
|
# Bitnami Common Library Chart
|
||||||
|
|
||||||
|
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between bitnami charts.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 0.x.x
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm dependency update
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
data:
|
||||||
|
myvalue: "Hello World"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 3.1.0
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the helpers available in the library which are scoped in different sections.
|
||||||
|
|
||||||
|
### Affinities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-------------------------------|------------------------------------------------------|------------------------------------------------|
|
||||||
|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.node.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.pod.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pod.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
|
||||||
|
### Capabilities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|----------------------------------------------|------------------------------------------------------------------------------------------------|-------------------|
|
||||||
|
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
|
||||||
|
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
|
||||||
|
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
|
||||||
|
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
|
||||||
|
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
|
||||||
|
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
|
||||||
|
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
|
||||||
|
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
|
||||||
|
|
||||||
|
### Images
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
|
||||||
|
|
||||||
|
### Ingress
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------|------------------------------------------------------|-------------------|
|
||||||
|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||||
|
| `common.labels.matchLabels` | Return the proper Docker Image Registry Secret Names | `.` Chart context |
|
||||||
|
|
||||||
|
### Names
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Inpput |
|
||||||
|
|-------------------------|------------------------------------------------------------|-------------------|
|
||||||
|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||||
|
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||||
|
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|---------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $`, length, strong and chartNAme fields are optional. |
|
||||||
|
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-------------------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
|
||||||
|
|
||||||
|
### TplValues
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
|
||||||
|
|
||||||
|
### Utils
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------------|------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
|
||||||
|
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
|
||||||
|
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
|
||||||
|
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
|
||||||
|
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
|
||||||
|
|
||||||
|
### Validations
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
|
||||||
|
| `common.validations.values.postgresql.passwords` | This helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values. | `dict "secret" "postgresql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use postgresql chart and the helper. |
|
||||||
|
| `common.validations.values.redis.passwords` | This helper will ensure required password for Redis<sup>TM</sup> are not empty. It returns a shared error for all the values. | `dict "secret" "redis-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use redis chart and the helper. |
|
||||||
|
| `common.validations.values.cassandra.passwords` | This helper will ensure required password for Cassandra are not empty. It returns a shared error for all the values. | `dict "secret" "cassandra-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use cassandra chart and the helper. |
|
||||||
|
| `common.validations.values.mongodb.passwords` | This helper will ensure required password for MongoDB® are not empty. It returns a shared error for all the values. | `dict "secret" "mongodb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mongodb chart and the helper. |
|
||||||
|
|
||||||
|
### Warnings
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|------------------------------|----------------------------------|------------------------------------------------------------|
|
||||||
|
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
|
||||||
|
## Special input schemas
|
||||||
|
|
||||||
|
### ImageRoot
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
description: Docker registry where the image is located
|
||||||
|
example: docker.io
|
||||||
|
|
||||||
|
repository:
|
||||||
|
type: string
|
||||||
|
description: Repository and image name
|
||||||
|
example: bitnami/nginx
|
||||||
|
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
description: image tag
|
||||||
|
example: 1.16.1-debian-10-r63
|
||||||
|
|
||||||
|
pullPolicy:
|
||||||
|
type: string
|
||||||
|
description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||||
|
|
||||||
|
pullSecrets:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: Optionally specify an array of imagePullSecrets.
|
||||||
|
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
description: Set to true if you would like to see extra information on logs
|
||||||
|
example: false
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# registry: docker.io
|
||||||
|
# repository: bitnami/nginx
|
||||||
|
# tag: 1.16.1-debian-10-r63
|
||||||
|
# pullPolicy: IfNotPresent
|
||||||
|
# debug: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Whether enable persistence.
|
||||||
|
example: true
|
||||||
|
|
||||||
|
storageClass:
|
||||||
|
type: string
|
||||||
|
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
|
||||||
|
example: "-"
|
||||||
|
|
||||||
|
accessMode:
|
||||||
|
type: string
|
||||||
|
description: Access mode for the Persistent Volume Storage.
|
||||||
|
example: ReadWriteOnce
|
||||||
|
|
||||||
|
size:
|
||||||
|
type: string
|
||||||
|
description: Size the Persistent Volume Storage.
|
||||||
|
example: 8Gi
|
||||||
|
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
description: Path to be persisted.
|
||||||
|
example: /bitnami
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# enabled: true
|
||||||
|
# storageClass: "-"
|
||||||
|
# accessMode: ReadWriteOnce
|
||||||
|
# size: 8Gi
|
||||||
|
# path: /bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
### ExistingSecret
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Name of the existing secret.
|
||||||
|
example: mySecret
|
||||||
|
keyMapping:
|
||||||
|
description: Mapping between the expected key name and the name of the key in the existing secret.
|
||||||
|
type: object
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# name: mySecret
|
||||||
|
# keyMapping:
|
||||||
|
# password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example of use
|
||||||
|
|
||||||
|
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# templates/secret.yaml
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ include "common.names.fullname" . }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
password: {{ .Values.password | b64enc | quote }}
|
||||||
|
|
||||||
|
# templates/dpl.yaml
|
||||||
|
---
|
||||||
|
...
|
||||||
|
env:
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
|
||||||
|
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
|
||||||
|
...
|
||||||
|
|
||||||
|
# values.yaml
|
||||||
|
---
|
||||||
|
name: mySecret
|
||||||
|
keyMapping:
|
||||||
|
password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
### ValidateValue
|
||||||
|
|
||||||
|
#### NOTES.txt
|
||||||
|
|
||||||
|
```console
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
|
||||||
|
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
```
|
||||||
|
|
||||||
|
If we force those values to be empty we will see some alerts
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ helm install test mychart --set path.to.value00="",path.to.value01=""
|
||||||
|
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 --decode)
|
||||||
|
|
||||||
|
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 --decode)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
### To 1.0.0
|
||||||
|
|
||||||
|
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||||
|
|
||||||
|
**What changes were introduced in this major version?**
|
||||||
|
|
||||||
|
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||||
|
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
|
||||||
|
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||||
|
|
||||||
|
**Considerations when upgrading to this version**
|
||||||
|
|
||||||
|
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||||
|
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||||
|
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||||
|
|
||||||
|
**Useful links**
|
||||||
|
|
||||||
|
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
|
||||||
|
- https://helm.sh/docs/topics/v2_v3_migration/
|
||||||
|
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.soft" -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.hard" -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.nodes.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.nodes.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.soft" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace | quote }}
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.hard" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace | quote }}
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.pods.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.pods.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the target Kubernetes version
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.kubeVersion" -}}
|
||||||
|
{{- if .Values.global }}
|
||||||
|
{{- if .Values.global.kubeVersion }}
|
||||||
|
{{- .Values.global.kubeVersion -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for statefulset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "apps/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for ingress.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- if .Values.ingress -}}
|
||||||
|
{{- if .Values.ingress.apiVersion -}}
|
||||||
|
{{- .Values.ingress.apiVersion -}}
|
||||||
|
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "networking.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "networking.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for RBAC resources.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for CRDs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||||
|
{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if the used Helm version is 3.3+.
|
||||||
|
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
|
||||||
|
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
|
||||||
|
**To be removed when the catalog's minimun Helm version is 3.3**
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.supportsHelmVersion" -}}
|
||||||
|
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
23
gitea/charts/memcached/charts/common/templates/_errors.tpl
Normal file
23
gitea/charts/memcached/charts/common/templates/_errors.tpl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Through error when upgrading using empty passwords values that must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
|
||||||
|
|
||||||
|
Required password params:
|
||||||
|
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
|
||||||
|
- context - Context - Required. Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.upgrade.passwords.empty" -}}
|
||||||
|
{{- $validationErrors := join "" .validationErrors -}}
|
||||||
|
{{- if and $validationErrors .context.Release.IsUpgrade -}}
|
||||||
|
{{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
|
||||||
|
{{- $errorString = print $errorString "\n%s" -}}
|
||||||
|
{{- printf $errorString $validationErrors | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
47
gitea/charts/memcached/charts/common/templates/_images.tpl
Normal file
47
gitea/charts/memcached/charts/common/templates/_images.tpl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper image name
|
||||||
|
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.image" -}}
|
||||||
|
{{- $registryName := .imageRoot.registry -}}
|
||||||
|
{{- $repositoryName := .imageRoot.repository -}}
|
||||||
|
{{- $tag := .imageRoot.tag | toString -}}
|
||||||
|
{{- if .global }}
|
||||||
|
{{- if .global.imageRegistry }}
|
||||||
|
{{- $registryName = .global.imageRegistry -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $registryName }}
|
||||||
|
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.pullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
|
||||||
|
{{- if .global }}
|
||||||
|
{{- range .global.imagePullSecrets -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
42
gitea/charts/memcached/charts/common/templates/_ingress.tpl
Normal file
42
gitea/charts/memcached/charts/common/templates/_ingress.tpl
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate backend entry that is compatible with all Kubernetes API versions.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- serviceName - String. Name of an existing service backend
|
||||||
|
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.backend" -}}
|
||||||
|
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}}
|
||||||
|
{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}}
|
||||||
|
serviceName: {{ .serviceName }}
|
||||||
|
servicePort: {{ .servicePort }}
|
||||||
|
{{- else -}}
|
||||||
|
service:
|
||||||
|
name: {{ .serviceName }}
|
||||||
|
port:
|
||||||
|
{{- if typeIs "string" .servicePort }}
|
||||||
|
name: {{ .servicePort }}
|
||||||
|
{{- else if typeIs "int" .servicePort }}
|
||||||
|
number: {{ .servicePort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Print "true" if the API pathType field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsPathType" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsPathType" -}}
|
||||||
|
{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||||
|
{{- print "false" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
18
gitea/charts/memcached/charts/common/templates/_labels.tpl
Normal file
18
gitea/charts/memcached/charts/common/templates/_labels.tpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Kubernetes standard labels
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.standard" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.matchLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
32
gitea/charts/memcached/charts/common/templates/_names.tpl
Normal file
32
gitea/charts/memcached/charts/common/templates/_names.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- 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).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride -}}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
129
gitea/charts/memcached/charts/common/templates/_secrets.tpl
Normal file
129
gitea/charts/memcached/charts/common/templates/_secrets.tpl
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Generate secret name.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||||
|
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.name" -}}
|
||||||
|
{{- $name := (include "common.names.fullname" .context) -}}
|
||||||
|
|
||||||
|
{{- if .defaultNameSuffix -}}
|
||||||
|
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .) -}}
|
||||||
|
{{- with .name -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret key.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||||
|
- key - String - Required. Name of the key in the secret.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.key" -}}
|
||||||
|
{{- $key := .key -}}
|
||||||
|
|
||||||
|
{{- if .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .existingSecret) -}}
|
||||||
|
{{- if .existingSecret.keyMapping -}}
|
||||||
|
{{- $key = index .existingSecret.keyMapping $.key -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret password or retrieve one if already created.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- length - int - Optional - Length of the generated random password.
|
||||||
|
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
|
||||||
|
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.passwords.manage" -}}
|
||||||
|
|
||||||
|
{{- $password := "" }}
|
||||||
|
{{- $subchart := "" }}
|
||||||
|
{{- $chartName := default "" .chartName }}
|
||||||
|
{{- $passwordLength := default 10 .length }}
|
||||||
|
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||||
|
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- if index $secret.data .key }}
|
||||||
|
{{- $password = index $secret.data .key }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if $providedPasswordValue }}
|
||||||
|
{{- $password = $providedPasswordValue | toString | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
{{- if .context.Values.enabled }}
|
||||||
|
{{- $subchart = $chartName }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
|
||||||
|
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
|
||||||
|
{{- $passwordValidationErrors := list $requiredPasswordError -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
|
||||||
|
|
||||||
|
{{- if .strong }}
|
||||||
|
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
|
||||||
|
{{- $password = randAscii $passwordLength }}
|
||||||
|
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||||
|
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $password -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns whether a previous generated secret already exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.exists" -}}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
23
gitea/charts/memcached/charts/common/templates/_storage.tpl
Normal file
23
gitea/charts/memcached/charts/common/templates/_storage.tpl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper Storage Class
|
||||||
|
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.storage.class" -}}
|
||||||
|
|
||||||
|
{{- $storageClass := .persistence.storageClass -}}
|
||||||
|
{{- if .global -}}
|
||||||
|
{{- if .global.storageClass -}}
|
||||||
|
{{- $storageClass = .global.storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if $storageClass -}}
|
||||||
|
{{- if (eq "-" $storageClass) -}}
|
||||||
|
{{- printf "storageClassName: \"\"" -}}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "storageClassName: %s" $storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Renders a value that contains template.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.render" -}}
|
||||||
|
{{- if typeIs "string" .value }}
|
||||||
|
{{- tpl .value .context }}
|
||||||
|
{{- else }}
|
||||||
|
{{- tpl (.value | toYaml) .context }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
62
gitea/charts/memcached/charts/common/templates/_utils.tpl
Normal file
62
gitea/charts/memcached/charts/common/templates/_utils.tpl
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Print instructions to get a secret value.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.secret.getvalue" -}}
|
||||||
|
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
export {{ $varname }}=$(kubectl get secret --namespace {{ .context.Release.Namespace | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 --decode)
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Build env var name given a field
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.fieldToEnvVar" -}}
|
||||||
|
{{- $fieldNameSplit := splitList "-" .field -}}
|
||||||
|
{{- $upperCaseFieldNameSplit := list -}}
|
||||||
|
|
||||||
|
{{- range $fieldNameSplit -}}
|
||||||
|
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ join "_" $upperCaseFieldNameSplit }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Gets a value from .Values given
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getValueFromKey" -}}
|
||||||
|
{{- $splitKey := splitList "." .key -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $latestObj := $.context.Values -}}
|
||||||
|
{{- range $splitKey -}}
|
||||||
|
{{- if not $latestObj -}}
|
||||||
|
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $value = ( index $latestObj . ) -}}
|
||||||
|
{{- $latestObj = $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%v" (default "" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns first .Values key with a defined value or first of the list if all non-defined
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getKeyFromList" -}}
|
||||||
|
{{- $key := first .keys -}}
|
||||||
|
{{- $reverseKeys := reverse .keys }}
|
||||||
|
{{- range $reverseKeys }}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- $key = . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
14
gitea/charts/memcached/charts/common/templates/_warnings.tpl
Normal file
14
gitea/charts/memcached/charts/common/templates/_warnings.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Warning about using rolling tag.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.rollingTag" -}}
|
||||||
|
|
||||||
|
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||||
|
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||||
|
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate Cassandra required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.cassandra.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where Cassandra values are stored, e.g: "cassandra-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.cassandra.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.cassandra.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.cassandra.values.enabled" . -}}
|
||||||
|
{{- $dbUserPrefix := include "common.cassandra.values.key.dbUser" . -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $dbUserPrefix -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "cassandra-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.dbUser.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled cassandra.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.cassandra.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key dbUser
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.key.dbUser" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
cassandra.dbUser
|
||||||
|
{{- else -}}
|
||||||
|
dbUser
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MariaDB required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mariadb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mariadb.values.enabled" . -}}
|
||||||
|
{{- $architecture := include "common.mariadb.values.architecture" . -}}
|
||||||
|
{{- $authPrefix := include "common.mariadb.values.key.auth" . -}}
|
||||||
|
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||||
|
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||||
|
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mariadb-root-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||||
|
|
||||||
|
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||||
|
{{- if not (empty $valueUsername) -}}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mariadb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replication") -}}
|
||||||
|
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-replication-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mariadb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mariadb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mariadb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MongoDB(R) required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mongodb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MongoDB(R) values are stored, e.g: "mongodb-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mongodb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mongodb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mongodb.values.enabled" . -}}
|
||||||
|
{{- $authPrefix := include "common.mongodb.values.key.auth" . -}}
|
||||||
|
{{- $architecture := include "common.mongodb.values.architecture" . -}}
|
||||||
|
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||||
|
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||||
|
{{- $valueKeyDatabase := printf "%s.database" $authPrefix -}}
|
||||||
|
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||||
|
{{- $valueKeyReplicaSetKey := printf "%s.replicaSetKey" $authPrefix -}}
|
||||||
|
{{- $valueKeyAuthEnabled := printf "%s.enabled" $authPrefix -}}
|
||||||
|
|
||||||
|
{{- $authEnabled := include "common.utils.getValueFromKey" (dict "key" $valueKeyAuthEnabled "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") (eq $authEnabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mongodb-root-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||||
|
|
||||||
|
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||||
|
{{- $valueDatabase := include "common.utils.getValueFromKey" (dict "key" $valueKeyDatabase "context" .context) }}
|
||||||
|
{{- if and $valueUsername $valueDatabase -}}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mongodb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replicaset") -}}
|
||||||
|
{{- $requiredReplicaSetKey := dict "valueKey" $valueKeyReplicaSetKey "secret" .secret "field" "mongodb-replica-set-key" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredReplicaSetKey -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mongodb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mongodb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mongodb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate PostgreSQL required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.postgresql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where postgresql values are stored, e.g: "postgresql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.postgresql.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.postgresql.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.postgresql.values.enabled" . -}}
|
||||||
|
{{- $valueKeyPostgresqlPassword := include "common.postgresql.values.key.postgressPassword" . -}}
|
||||||
|
{{- $valueKeyPostgresqlReplicationEnabled := include "common.postgresql.values.key.replicationPassword" . -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $requiredPostgresqlPassword := dict "valueKey" $valueKeyPostgresqlPassword "secret" .secret "field" "postgresql-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlPassword -}}
|
||||||
|
|
||||||
|
{{- $enabledReplication := include "common.postgresql.values.enabled.replication" . -}}
|
||||||
|
{{- if (eq $enabledReplication "true") -}}
|
||||||
|
{{- $requiredPostgresqlReplicationPassword := dict "valueKey" $valueKeyPostgresqlReplicationEnabled "secret" .secret "field" "postgresql-replication-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlReplicationPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to decide whether evaluate global values.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.use.global" -}}
|
||||||
|
{{- if .context.Values.global -}}
|
||||||
|
{{- if .context.Values.global.postgresql -}}
|
||||||
|
{{- index .context.Values.global.postgresql .key | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.existingSecret" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled postgresql.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key postgressPassword.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.postgressPassword" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if not $globalValue -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.postgresqlPassword
|
||||||
|
{{- else -}}
|
||||||
|
postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
global.postgresql.postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled.replication.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled.replication" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" .context.Values.replication.enabled -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key replication.password.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.replicationPassword" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.replication.password
|
||||||
|
{{- else -}}
|
||||||
|
replication.password
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate Redis(TM) required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.redis.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where redis values are stored, e.g: "redis-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.redis.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.redis.values.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.redis.values.enabled" . -}}
|
||||||
|
{{- $valueKeyPrefix := include "common.redis.values.keys.prefix" . -}}
|
||||||
|
{{- $valueKeyRedisPassword := printf "%s%s" $valueKeyPrefix "password" -}}
|
||||||
|
{{- $valueKeyRedisUsePassword := printf "%s%s" $valueKeyPrefix "usePassword" -}}
|
||||||
|
|
||||||
|
{{- if and (not $existingSecret) (eq $enabled "true") -}}
|
||||||
|
{{- $requiredPasswords := list -}}
|
||||||
|
|
||||||
|
{{- $usePassword := include "common.utils.getValueFromKey" (dict "key" $valueKeyRedisUsePassword "context" .context) -}}
|
||||||
|
{{- if eq $usePassword "true" -}}
|
||||||
|
{{- $requiredRedisPassword := dict "valueKey" $valueKeyRedisPassword "secret" .secret "field" "redis-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredRedisPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Redis Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Redis(TM) is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.redis.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled redis.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.redis.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right prefix path for the values
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.keys.prefix" -}}
|
||||||
|
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate values must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.multiple.empty" -}}
|
||||||
|
{{- range .required -}}
|
||||||
|
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate a value must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
- subchart - String - Optional - Name of the subchart that the validated password is part of.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.single.empty" -}}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
|
||||||
|
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
|
||||||
|
|
||||||
|
{{- if not $value -}}
|
||||||
|
{{- $varname := "my-value" -}}
|
||||||
|
{{- $getCurrentValue := "" -}}
|
||||||
|
{{- if and .secret .field -}}
|
||||||
|
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
3
gitea/charts/memcached/charts/common/values.yaml
Normal file
3
gitea/charts/memcached/charts/common/values.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## bitnami/common
|
||||||
|
## It is required by CI/CD tools and processes.
|
||||||
|
exampleValue: common-chart
|
||||||
5
gitea/charts/memcached/ci/values-production.yaml
Normal file
5
gitea/charts/memcached/ci/values-production.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Test values file for generating all of the yaml and check that
|
||||||
|
# the rendering is correct
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: true
|
||||||
28
gitea/charts/memcached/templates/NOTES.txt
Normal file
28
gitea/charts/memcached/templates/NOTES.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
** Please be patient while the chart is being deployed **
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "standalone" }}
|
||||||
|
Memcached can be accessed on port 11211 on the following DNS name from within your cluster: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||||
|
{{- else if eq .Values.architecture "high-availability" }}
|
||||||
|
Memcached endpoints are exposed on the headless service named: {{ template "common.names.fullname" . }}.
|
||||||
|
Please see https://github.com/memcached/memcached/wiki/ConfiguringClient to understand the Memcached model and need for client-based consistent hashing.
|
||||||
|
You might also want to consider more advanced routing/replication approaches with mcrouter: https://github.com/facebook/mcrouter/wiki/Replicated-pools-setup
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||||
|
|
||||||
|
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||||
|
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
|
||||||
|
To access the Memcached Prometheus metrics from outside the cluster execute the following commands:
|
||||||
|
|
||||||
|
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }}-metrics {{ .Values.metrics.service.port }}:{{ .Values.metrics.service.port }} &
|
||||||
|
curl http://127.0.0.1:{{ .Values.metrics.service.port }}/metrics
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- include "memcached.validateValues" . }}
|
||||||
|
{{- include "memcached.checkRollingTags" . }}
|
||||||
95
gitea/charts/memcached/templates/_helpers.tpl
Normal file
95
gitea/charts/memcached/templates/_helpers.tpl
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
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).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.fullname" -}}
|
||||||
|
{{- include "common.names.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Memcached image name
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper image name (for the metrics image)
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.metrics.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.imagePullSecrets" -}}
|
||||||
|
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image) "global" .Values.global) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Check if there are rolling tags in the images
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.checkRollingTags" -}}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Compile all warnings into a single message, and call fail.
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.validateValues" -}}
|
||||||
|
{{- $messages := list -}}
|
||||||
|
{{- $messages := append $messages (include "memcached.validateValues.architecture" .) -}}
|
||||||
|
{{- $messages := append $messages (include "memcached.validateValues.replicaCount" .) -}}
|
||||||
|
{{- $messages := append $messages (include "memcached.validateValues.readOnlyRootFilesystem" .) -}}
|
||||||
|
{{- $messages := without $messages "" -}}
|
||||||
|
{{- $message := join "\n" $messages -}}
|
||||||
|
|
||||||
|
{{- if $message -}}
|
||||||
|
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Validate values of Memcached - must provide a valid architecture */}}
|
||||||
|
{{- define "memcached.validateValues.architecture" -}}
|
||||||
|
{{- if and (ne .Values.architecture "standalone") (ne .Values.architecture "high-availability") -}}
|
||||||
|
memcached: architecture
|
||||||
|
Invalid architecture selected. Valid values are "standalone" and
|
||||||
|
"high-availability". Please set a valid architecture (--set architecture="xxxx")
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Validate values of Memcached - number of replicas */}}
|
||||||
|
{{- define "memcached.validateValues.replicaCount" -}}
|
||||||
|
{{- $replicaCount := int .Values.replicaCount }}
|
||||||
|
{{- if and (eq .Values.architecture "standalone") (gt $replicaCount 1) -}}
|
||||||
|
memcached: replicaCount
|
||||||
|
The standalone architecture doesn't allow to run more than 1 replica.
|
||||||
|
Please set a valid number of replicas (--set memcached.replicaCount=1) or
|
||||||
|
use the "high-availability" architecture (--set architecture="high-availability")
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Validate values of Memcached - securityContext.readOnlyRootFilesystem */}}
|
||||||
|
{{- define "memcached.validateValues.readOnlyRootFilesystem" -}}
|
||||||
|
{{- if and .Values.securityContext.enabled .Values.securityContext.readOnlyRootFilesystem (not (empty .Values.memcachedPassword)) -}}
|
||||||
|
memcached: securityContext.readOnlyRootFilesystem
|
||||||
|
Enabling authentication is not compatible with using a read-only filesystem.
|
||||||
|
Please disable it (--set securityContext.readOnlyRootFilesystem=false)
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "memcached.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{ default (include "memcached.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
139
gitea/charts/memcached/templates/deployment.yaml
Normal file
139
gitea/charts/memcached/templates/deployment.yaml
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
{{- if eq .Values.architecture "standalone" }}
|
||||||
|
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||||
|
{{- if .Values.podLabels }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.podAnnotations (and .Values.metrics.enabled .Values.metrics.podAnnotations) }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "memcached.imagePullSecrets" . | nindent 6 }}
|
||||||
|
{{- if .Values.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.securityContext.enabled }}
|
||||||
|
securityContext:
|
||||||
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||||
|
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ template "memcached.serviceAccountName" . }}
|
||||||
|
containers:
|
||||||
|
- name: memcached
|
||||||
|
image: {{ template "memcached.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.arguments }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.arguments "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
||||||
|
{{- if .Values.memcachedUsername }}
|
||||||
|
- name: MEMCACHED_USERNAME
|
||||||
|
value: {{ .Values.memcachedUsername | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.memcachedPassword }}
|
||||||
|
- name: MEMCACHED_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
key: memcached-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.extraEnv }}
|
||||||
|
{{- toYaml .Values.extraEnv | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.portName }}
|
||||||
|
containerPort: 11211
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: memcache
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 6
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: memcache
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
{{- if .Values.resources }}
|
||||||
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: tmp
|
||||||
|
mountPath: /tmp
|
||||||
|
{{- if .Values.securityContext.enabled }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ template "memcached.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.metrics.portName }}
|
||||||
|
containerPort: 9150
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: tmp
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
4
gitea/charts/memcached/templates/extra-list.yaml
Normal file
4
gitea/charts/memcached/templates/extra-list.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{- range .Values.extraDeploy }}
|
||||||
|
---
|
||||||
|
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
|
||||||
|
{{- end }}
|
||||||
17
gitea/charts/memcached/templates/secrets.yaml
Normal file
17
gitea/charts/memcached/templates/secrets.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{- if .Values.memcachedPassword }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
memcached-password: {{ .Values.memcachedPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
34
gitea/charts/memcached/templates/service.yaml
Normal file
34
gitea/charts/memcached/templates/service.yaml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.service.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }}
|
||||||
|
{{- if and (eq .Values.architecture "high-availability") (eq .Values.service.type "ClusterIP") }}
|
||||||
|
clusterIP: None
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty .Values.service.loadBalancerIP)) (eq .Values.service.type "LoadBalancer") }}
|
||||||
|
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: memcache
|
||||||
|
port: {{ .Values.service.port }}
|
||||||
|
targetPort: memcache
|
||||||
|
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePort)) }}
|
||||||
|
nodePort: {{ .Values.service.nodePort }}
|
||||||
|
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||||
15
gitea/charts/memcached/templates/serviceaccount.yaml
Normal file
15
gitea/charts/memcached/templates/serviceaccount.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||||
|
metadata:
|
||||||
|
name: {{ template "memcached.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
37
gitea/charts/memcached/templates/servicemonitor.yaml
Normal file
37
gitea/charts/memcached/templates/servicemonitor.yaml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
{{- else }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
endpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
|
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||||
|
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ .Release.Namespace }}
|
||||||
|
{{- end }}
|
||||||
172
gitea/charts/memcached/templates/statefulset.yaml
Normal file
172
gitea/charts/memcached/templates/statefulset.yaml
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
{{- if eq .Values.architecture "high-availability" }}
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
serviceName: {{ template "common.names.fullname" . }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||||
|
{{- if .Values.podLabels }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.podAnnotations (and .Values.metrics.enabled .Values.metrics.podAnnotations) }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "memcached.imagePullSecrets" . | nindent 6 }}
|
||||||
|
{{- if .Values.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.securityContext.enabled }}
|
||||||
|
securityContext:
|
||||||
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||||
|
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: memcached
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command: ["/bin/sh", "-c", "/usr/bin/pkill -10 memcached ; sleep 60s"]
|
||||||
|
{{- end }}
|
||||||
|
image: {{ template "memcached.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.arguments }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.arguments "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
- -e/cache-state/memory_file
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.extraEnv .Values.memcachedUsername .Values.memcachedPassword }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.memcachedUsername }}
|
||||||
|
- name: MEMCACHED_USERNAME
|
||||||
|
value: {{ .Values.memcachedUsername | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.memcachedPassword }}
|
||||||
|
- name: MEMCACHED_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
key: memcached-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.extraEnv }}
|
||||||
|
{{- toYaml .Values.extraEnv | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.portName }}
|
||||||
|
containerPort: 11211
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: memcache
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 6
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: memcache
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
{{- if .Values.resources }}
|
||||||
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.securityContext.enabled }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
mountPath: /cache-state
|
||||||
|
{{- end }}
|
||||||
|
- name: tmp
|
||||||
|
mountPath: /tmp
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ template "memcached.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.metrics.portName }}
|
||||||
|
containerPort: 9150
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: tmp
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
{{- with .Values.persistence.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- range $key, $value := . }}
|
||||||
|
{{ $key }}: {{ $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
26
gitea/charts/memcached/templates/svc-metrics.yaml
Normal file
26
gitea/charts/memcached/templates/svc-metrics.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}-metrics
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.service.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.metrics.service.type }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.metrics.service.port }}
|
||||||
|
targetPort: metrics
|
||||||
|
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
326
gitea/charts/memcached/values.yaml
Normal file
326
gitea/charts/memcached/values.yaml
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
## Global Docker image parameters
|
||||||
|
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||||
|
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||||
|
##
|
||||||
|
# global:
|
||||||
|
# imageRegistry: myRegistryName
|
||||||
|
# imagePullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
# storageClass: myStorageClass
|
||||||
|
|
||||||
|
## Bitnami Memcached image version
|
||||||
|
## ref: https://hub.docker.com/r/bitnami/memcached/tags/
|
||||||
|
##
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: bitnami/memcached
|
||||||
|
tag: 1.6.9-debian-10-r114
|
||||||
|
## Specify a imagePullPolicy
|
||||||
|
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||||
|
##
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
## Optionally specify an array of imagePullSecrets.
|
||||||
|
## Secrets must be manually created in the namespace.
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
##
|
||||||
|
# pullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
|
||||||
|
## Set to true if you would like to see extra information on logs
|
||||||
|
##
|
||||||
|
debug: false
|
||||||
|
|
||||||
|
## String to partially override common.names.fullname template (will maintain the release name)
|
||||||
|
##
|
||||||
|
# nameOverride:
|
||||||
|
|
||||||
|
## String to fully override common.names.fullname template
|
||||||
|
##
|
||||||
|
# fullnameOverride:
|
||||||
|
|
||||||
|
## Add labels to all the deployed resources
|
||||||
|
##
|
||||||
|
commonLabels: {}
|
||||||
|
|
||||||
|
## Add annotations to all the deployed resources
|
||||||
|
##
|
||||||
|
commonAnnotations: {}
|
||||||
|
|
||||||
|
## Kubernetes Cluster Domain
|
||||||
|
##
|
||||||
|
clusterDomain: cluster.local
|
||||||
|
|
||||||
|
## Extra objects to deploy (value evaluated as a template)
|
||||||
|
##
|
||||||
|
extraDeploy: []
|
||||||
|
|
||||||
|
## Memcached architecture. Allowed values: standalone or high-availability
|
||||||
|
##
|
||||||
|
architecture: standalone
|
||||||
|
|
||||||
|
## Deployment pod host aliases
|
||||||
|
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
|
||||||
|
##
|
||||||
|
hostAliases: []
|
||||||
|
|
||||||
|
## Memcached admin user
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-memcached#creating-the-memcached-admin-user
|
||||||
|
##
|
||||||
|
# memcachedUsername:
|
||||||
|
|
||||||
|
## Memcached admin password
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-memcached#creating-the-memcached-admin-user
|
||||||
|
##
|
||||||
|
# memcachedPassword:
|
||||||
|
|
||||||
|
## Number of containers to run
|
||||||
|
##
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
## Command and args for running the container (set to default if not set). Use array form
|
||||||
|
##
|
||||||
|
command: []
|
||||||
|
arguments:
|
||||||
|
- /run.sh
|
||||||
|
# - -m <maxMemoryLimit>
|
||||||
|
# - -I <maxItemSize>
|
||||||
|
# - -vv
|
||||||
|
|
||||||
|
## Extra environment vars to pass.
|
||||||
|
## ref: https://github.com/bitnami/bitnami-docker-memcached#configuration
|
||||||
|
##
|
||||||
|
extraEnv: []
|
||||||
|
|
||||||
|
## Service parameters
|
||||||
|
##
|
||||||
|
##
|
||||||
|
service:
|
||||||
|
## Service type
|
||||||
|
##
|
||||||
|
type: ClusterIP
|
||||||
|
## Memcached port
|
||||||
|
##
|
||||||
|
port: 11211
|
||||||
|
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||||
|
##
|
||||||
|
nodePort: ""
|
||||||
|
## Set the LoadBalancer service type to internal only.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||||
|
##
|
||||||
|
# loadBalancerIP:
|
||||||
|
## Annotations for the Memcached service
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
## Memcached containers' resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources:
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
limits: {}
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
requests:
|
||||||
|
memory: 256Mi
|
||||||
|
cpu: 250m
|
||||||
|
|
||||||
|
## If you want to override the port name (can be usefull when using a service mesh)
|
||||||
|
## ref for istio: https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/
|
||||||
|
##
|
||||||
|
portName: memcache
|
||||||
|
|
||||||
|
## Pod Security Context
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
|
||||||
|
##
|
||||||
|
securityContext:
|
||||||
|
enabled: true
|
||||||
|
fsGroup: 1001
|
||||||
|
runAsUser: 1001
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
|
||||||
|
## Pod extra labels
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||||
|
##
|
||||||
|
podLabels: {}
|
||||||
|
|
||||||
|
## Pod annotations
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||||
|
##
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
|
## Pod affinity preset
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAffinityPreset: ""
|
||||||
|
|
||||||
|
## Pod anti-affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
podAntiAffinityPreset: soft
|
||||||
|
|
||||||
|
## Node affinity preset
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
nodeAffinityPreset:
|
||||||
|
## Node affinity type
|
||||||
|
## Allowed values: soft, hard
|
||||||
|
##
|
||||||
|
type: ""
|
||||||
|
## Node label key to match
|
||||||
|
## E.g.
|
||||||
|
## key: "kubernetes.io/e2e-az-name"
|
||||||
|
##
|
||||||
|
key: ""
|
||||||
|
## Node label values to match
|
||||||
|
## E.g.
|
||||||
|
## values:
|
||||||
|
## - e2e-az1
|
||||||
|
## - e2e-az2
|
||||||
|
##
|
||||||
|
values: []
|
||||||
|
|
||||||
|
## Affinity for pod assignment. Evaluated as a template.
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||||
|
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||||
|
##
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
## Node labels for pod assignment. Evaluated as a template.
|
||||||
|
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
|
##
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
## Tolerations for pod assignment. Evaluated as a template.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
##
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
## Pod priority
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
|
##
|
||||||
|
# priorityClassName: ""
|
||||||
|
|
||||||
|
## memcached pods ServiceAccount
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||||
|
##
|
||||||
|
serviceAccount:
|
||||||
|
## Specifies whether a ServiceAccount should be created
|
||||||
|
##
|
||||||
|
create: true
|
||||||
|
## The name of the ServiceAccount to use.
|
||||||
|
## If not set and create is true, a name is generated using the memcached.serviceAccountName template
|
||||||
|
##
|
||||||
|
# name:
|
||||||
|
## Enable/disable auto mounting of the service account token
|
||||||
|
##
|
||||||
|
automountServiceAccountToken: true
|
||||||
|
|
||||||
|
## Persistence - used for dumping and restoring states between recreations
|
||||||
|
## Ref: https://github.com/memcached/memcached/wiki/WarmRestart
|
||||||
|
##
|
||||||
|
persistence:
|
||||||
|
enabled: false
|
||||||
|
## Persistent Volume Storage Class
|
||||||
|
## If defined, storageClassName: <storageClass>
|
||||||
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
|
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||||
|
## GKE, AWS & OpenStack)
|
||||||
|
##
|
||||||
|
# storageClass: "-"
|
||||||
|
## Persistent Volume Claim annotations
|
||||||
|
##
|
||||||
|
annotations: {}
|
||||||
|
## Persistent Volume Access Mode
|
||||||
|
##
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
## Persistent Volume size
|
||||||
|
##
|
||||||
|
size: 8Gi
|
||||||
|
|
||||||
|
## Prometheus Exporter / Metrics
|
||||||
|
##
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
## Bitnami Memcached Prometheus Exporter image
|
||||||
|
## ref: https://hub.docker.com/r/bitnami/memcached-exporter/tags/
|
||||||
|
##
|
||||||
|
image:
|
||||||
|
registry: docker.io
|
||||||
|
repository: bitnami/memcached-exporter
|
||||||
|
tag: 0.8.0-debian-10-r105
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
## Optionally specify an array of imagePullSecrets.
|
||||||
|
## Secrets must be manually created in the namespace.
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
##
|
||||||
|
# pullSecrets:
|
||||||
|
# - myRegistryKeySecretName
|
||||||
|
## Metrics exporter pod Annotation and Labels
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||||
|
##
|
||||||
|
podAnnotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9150"
|
||||||
|
## If you want to override the port name (can be usefull when using a service mesh)
|
||||||
|
## ref for istio: https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/
|
||||||
|
##
|
||||||
|
portName: metrics
|
||||||
|
## Memcached Prometheus exporter resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources:
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
limits: {}
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
requests: {}
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
service:
|
||||||
|
## Service type
|
||||||
|
##
|
||||||
|
type: ClusterIP
|
||||||
|
## Memcached Prometheus exporter port
|
||||||
|
##
|
||||||
|
port: 9150
|
||||||
|
## Annotations for the Prometheus metrics service
|
||||||
|
##
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "{{ .Values.metrics.service.port }}"
|
||||||
|
## Prometheus Operator ServiceMonitor configuration
|
||||||
|
##
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
||||||
|
## Namespace in which Prometheus is running
|
||||||
|
##
|
||||||
|
# namespace: monitoring
|
||||||
|
|
||||||
|
## Interval at which metrics should be scraped.
|
||||||
|
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||||
|
##
|
||||||
|
# interval: 10s
|
||||||
|
|
||||||
|
## Timeout after which the scrape is ended
|
||||||
|
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||||
|
##
|
||||||
|
# scrapeTimeout: 10s
|
||||||
|
|
||||||
|
## ServiceMonitor selector labels
|
||||||
|
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||||
|
##
|
||||||
|
# selector:
|
||||||
|
# prometheus: my-prometheus
|
||||||
21
gitea/charts/mysql/.helmignore
Normal file
21
gitea/charts/mysql/.helmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
21
gitea/charts/mysql/Chart.yaml
Normal file
21
gitea/charts/mysql/Chart.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
annotations:
|
||||||
|
category: Database
|
||||||
|
apiVersion: v1
|
||||||
|
appVersion: 8.0.21
|
||||||
|
description: Chart to create a Highly available MySQL cluster
|
||||||
|
home: https://github.com/bitnami/charts/tree/master/bitnami/mysql
|
||||||
|
icon: https://bitnami.com/assets/stacks/mysql/img/mysql-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- mysql
|
||||||
|
- database
|
||||||
|
- sql
|
||||||
|
- cluster
|
||||||
|
- high availablity
|
||||||
|
maintainers:
|
||||||
|
- email: containers@bitnami.com
|
||||||
|
name: Bitnami
|
||||||
|
name: mysql
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/bitnami-docker-mysql
|
||||||
|
- https://mysql.com
|
||||||
|
version: 6.14.10
|
||||||
272
gitea/charts/mysql/README.md
Normal file
272
gitea/charts/mysql/README.md
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
# MySQL
|
||||||
|
|
||||||
|
[MySQL](https://mysql.com) is a fast, reliable, scalable, and easy to use open-source relational database system. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
|
$ helm install my-release bitnami/mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart bootstraps a [MySQL](https://github.com/bitnami/bitnami-docker-mysql) replication cluster deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.12+
|
||||||
|
- Helm 2.12+ or Helm 3.0-beta3+
|
||||||
|
- PV provisioner support in the underlying infrastructure
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
To install the chart with the release name `my-release`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
|
$ helm install my-release bitnami/mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
These commands deploy MySQL on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||||
|
|
||||||
|
> **Tip**: List all releases using `helm list`
|
||||||
|
|
||||||
|
## Uninstalling the Chart
|
||||||
|
|
||||||
|
To uninstall/delete the `my-release` deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm delete my-release
|
||||||
|
```
|
||||||
|
|
||||||
|
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following tables lists the configurable parameters of the MySQL chart and their default values.
|
||||||
|
|
||||||
|
| Parameter | Description | Default | |
|
||||||
|
|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `global.imageRegistry` | Global Docker image registry | `nil` | |
|
||||||
|
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | |
|
||||||
|
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | |
|
||||||
|
| `image.registry` | MySQL image registry | `docker.io` | |
|
||||||
|
| `image.repository` | MySQL Image name | `bitnami/mysql` | |
|
||||||
|
| `image.tag` | MySQL Image tag | `{TAG_NAME}` | |
|
||||||
|
| `image.pullPolicy` | MySQL image pull policy | `IfNotPresent` | |
|
||||||
|
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | |
|
||||||
|
| `image.debug` | Specify if debug logs should be enabled | `false` | |
|
||||||
|
| `nameOverride` | String to partially override mysql.fullname template with a string (will prepend the release name) | `nil` | |
|
||||||
|
| `fullnameOverride` | String to fully override mysql.fullname template with a string | `nil` | |
|
||||||
|
| `clusterDomain` | Kubernetes DNS Domain name to use | `cluster.local` | |
|
||||||
|
| `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` | |
|
||||||
|
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | |
|
||||||
|
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` | |
|
||||||
|
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `buster` | |
|
||||||
|
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` | |
|
||||||
|
| `volumePermissions.resources` | Init container resource requests/limit | `nil` | |
|
||||||
|
| `existingSecret` | Specify the name of an existing secret for password details (`root.password`, `db.password`, `replication.password` will be ignored and picked up from this secret). The secret has to contain the keys `mysql-root-password`, `mysql-replication-password` and `mysql-password`. | `nil` | |
|
||||||
|
| `root.password` | Password for the `root` user | _random 10 character alphanumeric string_ | |
|
||||||
|
| `root.forcePassword` | Force users to specify a password. That is required for 'helm upgrade' to work properly | `false` | |
|
||||||
|
| `root.injectSecretsAsVolume` | Mount admin user password as a file instead of using an environment variable | `false` | |
|
||||||
|
| `db.user` | Username of new user to create (should be different from replication.user) | `nil` | |
|
||||||
|
| `db.password` | Password for the new user | _random 10 character alphanumeric string if `db.user` is defined_ | |
|
||||||
|
| `db.name` | Name for new database to create | `my_database` | |
|
||||||
|
| `db.forcePassword` | Force users to specify a password. That is required for 'helm upgrade' to work properly | `false` | |
|
||||||
|
| `db.injectSecretsAsVolume` | Mount user password as a file instead of using an environment variable | `false` | |
|
||||||
|
| `replication.enabled` | MySQL replication enabled | `true` | |
|
||||||
|
| `replication.user` | MySQL replication user (should be different from db.user) | `replicator` | |
|
||||||
|
| `replication.password` | MySQL replication user password | _random 10 character alphanumeric string_ | |
|
||||||
|
| `replication.forcePassword` | Force users to specify a password. That is required for 'helm upgrade' to work properly | `false` | |
|
||||||
|
| `replication.injectSecretsAsVolume` | Mount user password as a file instead of using an environment variable | `false` | |
|
||||||
|
| `initdbScripts` | Dictionary of initdb scripts | `nil` | |
|
||||||
|
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `nil` | |
|
||||||
|
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | |
|
||||||
|
| `serviceAccount.name` | If serviceAccount.create is enabled, what should the serviceAccount name be - otherwise defaults to the fullname | `nil` | |
|
||||||
|
| `master.config` | Config file for the MySQL Master server | `_default values in the values.yaml file_` | |
|
||||||
|
| `master.updateStrategy.type` | Master statefulset update strategy policy | `RollingUpdate` | |
|
||||||
|
| `master.podAnnotations` | Pod annotations for master nodes | `{}` | |
|
||||||
|
| `master.affinity` | Map of node/pod affinities for master nodes | `{}` (The value is evaluated as a template) | |
|
||||||
|
| `master.nodeSelector` | Node labels for pod assignment on master nodes | `{}` (The value is evaluated as a template) | |
|
||||||
|
| `master.tolerations` | Tolerations for pod assignment on master nodes | `[]` (The value is evaluated as a template) | |
|
||||||
|
| `master.securityContext.enabled` | Enable security context for master nodes | `true` | |
|
||||||
|
| `master.securityContext.fsGroup` | Group ID for the master nodes' containers | `1001` | |
|
||||||
|
| `master.securityContext.runAsUser` | User ID for the master nodes' containers | `1001` | |
|
||||||
|
| `master.containerSecurityContext` | Container security context for master nodes' containers | `{}` | |
|
||||||
|
| `master.resources` | CPU/Memory resource requests/limits for master nodes' containers | `{}` | |
|
||||||
|
| `master.livenessProbe.enabled` | Turn on and off liveness probe (master nodes) | `true` | |
|
||||||
|
| `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (master nodes) | `120` | |
|
||||||
|
| `master.livenessProbe.periodSeconds` | How often to perform the probe (master nodes) | `10` | |
|
||||||
|
| `master.livenessProbe.timeoutSeconds` | When the probe times out (master nodes) | `1` | |
|
||||||
|
| `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe (master nodes) | `1` | |
|
||||||
|
| `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe (master nodes) | `3` | |
|
||||||
|
| `master.readinessProbe.enabled` | Turn on and off readiness probe (master nodes) | `true` | |
|
||||||
|
| `master.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (master nodes) | `30` | |
|
||||||
|
| `master.readinessProbe.periodSeconds` | How often to perform the probe (master nodes) | `10` | |
|
||||||
|
| `master.readinessProbe.timeoutSeconds` | When the probe times out (master nodes) | `1` | |
|
||||||
|
| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe (master nodes) | `1` | |
|
||||||
|
| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe (master nodes) | `3` | |
|
||||||
|
| `master.extraEnvVars` | Array containing extra env vars to configure MySQL master replicas | `nil` | |
|
||||||
|
| `master.extraEnvVarsCM` | Configmap containing extra env vars to configure MySQL master replicas | `nil` | |
|
||||||
|
| `master.extraEnvVarsSecret` | Secret containing extra env vars to configure MySQL master replicas | `nil` | |
|
||||||
|
| `master.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` (master nodes) | `true` | |
|
||||||
|
| `master.persistence.mountPath` | Configure `PersistentVolumeClaim` mount path (master nodes) | `/bitnami/mysql` | |
|
||||||
|
| `master.persistence.annotations` | Persistent Volume Claim annotations (master nodes) | `{}` | |
|
||||||
|
| `master.persistence.storageClass` | Persistent Volume Storage Class (master nodes) | `` | |
|
||||||
|
| `master.persistence.accessModes` | Persistent Volume Access Modes (master nodes) | `[ReadWriteOnce]` | |
|
||||||
|
| `master.persistence.size` | Persistent Volume Size (master nodes) | `8Gi` | |
|
||||||
|
| `master.persistence.existingClaim` | Provide an existing `PersistentVolumeClaim` (master nodes) | `nil` | |
|
||||||
|
| `slave.replicas` | Desired number of slave replicas | `1` | |
|
||||||
|
| `slave.updateStrategy.type` | Slave statefulset update strategy policy | `RollingUpdate` | |
|
||||||
|
| `slave.podAnnotations` | Pod annotations for slave nodes | `{}` | |
|
||||||
|
| `slave.affinity` | Map of node/pod affinities for slave nodes | `{}` (The value is evaluated as a template) | |
|
||||||
|
| `slave.nodeSelector` | Node labels for pod assignment on slave nodes | `{}` (The value is evaluated as a template) | |
|
||||||
|
| `slave.tolerations` | Tolerations for pod assignment on slave nodes | `[]` (The value is evaluated as a template) | |
|
||||||
|
| `slave.extraEnvVars` | Array containing extra env vars to configure MySQL slave replicas | `nil` | |
|
||||||
|
| `slave.extraEnvVarsCM` | ConfigMap containing extra env vars to configure MySQL slave replicas | `nil` | |
|
||||||
|
| `slave.extraEnvVarsSecret` | Secret containing extra env vars to configure MySQL slave replicas | `nil` | |
|
||||||
|
| `slave.securityContext.enabled` | Enable security context for slave nodes | `true` | |
|
||||||
|
| `slave.securityContext.fsGroup` | Group ID for the slave nodes' containers | `1001` | |
|
||||||
|
| `slave.securityContext.runAsUser` | User ID for the slave nodes' containers | `1001` | |
|
||||||
|
| `slave.containerSecurityContext` | Container security context for slave nodes' containers | `{}` | |
|
||||||
|
| `slave.resources` | CPU/Memory resource requests/limits for slave nodes' containers | `{}` | |
|
||||||
|
| `slave.livenessProbe.enabled` | Turn on and off liveness probe (slave nodes) | `true` | |
|
||||||
|
| `slave.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (slave nodes) | `120` | |
|
||||||
|
| `slave.livenessProbe.periodSeconds` | How often to perform the probe (slave nodes) | `10` | |
|
||||||
|
| `slave.livenessProbe.timeoutSeconds` | When the probe times out (slave nodes) | `1` | |
|
||||||
|
| `slave.livenessProbe.successThreshold` | Minimum consecutive successes for the probe (slave nodes) | `1` | |
|
||||||
|
| `slave.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe (slave nodes) | `3` | |
|
||||||
|
| `slave.readinessProbe.enabled` | Turn on and off readiness probe (slave nodes) | `true` | |
|
||||||
|
| `slave.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (slave nodes) | `30` | |
|
||||||
|
| `slave.readinessProbe.periodSeconds` | How often to perform the probe (slave nodes) | `10` | |
|
||||||
|
| `slave.readinessProbe.timeoutSeconds` | When the probe times out (slave nodes) | `1` | |
|
||||||
|
| `slave.readinessProbe.successThreshold` | Minimum consecutive successes for the probe (slave nodes) | `1` | |
|
||||||
|
| `slave.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe (slave nodes) | `3` | |
|
||||||
|
| `slave.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` (slave nodes) | `true` | |
|
||||||
|
| `slave.persistence.mountPath` | Configure `PersistentVolumeClaim` mount path (slave nodes) | `/bitnami/mysql` | |
|
||||||
|
| `slave.persistence.annotations` | Persistent Volume Claim annotations (slave nodes) | `{}` | |
|
||||||
|
| `slave.persistence.storageClass` | Persistent Volume Storage Class (slave nodes) | `` | |
|
||||||
|
| `slave.persistence.accessModes` | Persistent Volume Access Modes (slave nodes) | `[ReadWriteOnce]` | |
|
||||||
|
| `slave.persistence.size` | Persistent Volume Size (slave nodes) | `8Gi` | |
|
||||||
|
| `slave.persistence.existingClaim` | Provide an existing `PersistentVolumeClaim` (slave nodes) | `nil` | |
|
||||||
|
| `service.type` | Kubernetes service type | `ClusterIP` | |
|
||||||
|
| `service.port` | MySQL service port | `3306` | |
|
||||||
|
| `service.nodePort.master` | Port to bind to for NodePort service type (master service) | `nil` | |
|
||||||
|
| `service.nodePort.slave` | Port to bind to for NodePort service type (slave service) | `nil` | |
|
||||||
|
| `service.loadBalancerIP.master` | Static IP Address to use for master LoadBalancer service type | `nil` | |
|
||||||
|
| `service.loadBalancerIP.slave` | Static IP Address to use for slaves LoadBalancer service type | `nil` | |
|
||||||
|
| `service.annotations` | Kubernetes service annotations | `{}` | |
|
||||||
|
| `metrics.enabled` | Start a side-car prometheus exporter | `false` | |
|
||||||
|
| `metrics.image` | Exporter image name | `bitnami/mysqld-exporter` | |
|
||||||
|
| `metrics.imageTag` | Exporter image tag | `{TAG_NAME}` | |
|
||||||
|
| `metrics.imagePullPolicy` | Exporter image pull policy | `IfNotPresent` | |
|
||||||
|
| `metrics.resources` | Exporter resource requests/limit | `nil` | |
|
||||||
|
| `metrics.service.type` | Kubernetes service type for MySQL Prometheus Exporter | `ClusterIP` | |
|
||||||
|
| `metrics.service.port` | MySQL Prometheus Exporter service port | `9104` | |
|
||||||
|
| `metrics.service.annotations` | Prometheus exporter svc annotations | `{prometheus.io/scrape: "true", prometheus.io/port: "9104"}` | |
|
||||||
|
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` | |
|
||||||
|
| `metrics.serviceMonitor.namespace` | Optional namespace which Prometheus is running in | `nil` | |
|
||||||
|
| `metrics.serviceMonitor.interval` | How frequently to scrape metrics (use by default, falling back to Prometheus' default) | `nil` | |
|
||||||
|
| `metrics.serviceMonitor.selector` | Default to kube-prometheus install (CoreOS recommended), but should be set according to Prometheus install | `nil` | The above parameters map to the env variables defined in [bitnami/mysql](http://github.com/bitnami/bitnami-docker-mysql). For more information please refer to the [bitnami/mysql](http://github.com/bitnami/bitnami-docker-mysql) image documentation. |
|
||||||
|
|
||||||
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install my-release \
|
||||||
|
--set root.password=secretpassword,user.database=app_database \
|
||||||
|
bitnami/mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
The above command sets the MySQL `root` account password to `secretpassword`. Additionally it creates a database named `app_database`.
|
||||||
|
|
||||||
|
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm install my-release -f values.yaml bitnami/mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||||
|
|
||||||
|
## Configuration and installation details
|
||||||
|
|
||||||
|
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||||
|
|
||||||
|
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||||
|
|
||||||
|
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||||
|
|
||||||
|
### Production configuration
|
||||||
|
|
||||||
|
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
|
||||||
|
|
||||||
|
- Force users to specify a password:
|
||||||
|
```diff
|
||||||
|
- root.forcePassword: false
|
||||||
|
+ root.forcePassword: true
|
||||||
|
|
||||||
|
- db.forcePassword: false
|
||||||
|
+ db.forcePassword: true
|
||||||
|
|
||||||
|
- replication.forcePassword: false
|
||||||
|
+ replication.forcePassword: true
|
||||||
|
```
|
||||||
|
|
||||||
|
- Desired number of slave replicas:
|
||||||
|
```diff
|
||||||
|
- slave.replicas: 1
|
||||||
|
+ slave.replicas: 2
|
||||||
|
```
|
||||||
|
|
||||||
|
- Start a side-car prometheus exporter:
|
||||||
|
```diff
|
||||||
|
- metrics.enabled: false
|
||||||
|
+ metrics.enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Change MySQL version
|
||||||
|
|
||||||
|
To modify the MySQL version used in this chart you can specify a [valid image tag](https://hub.docker.com/r/bitnami/mysql/tags/) using the `image.tag` parameter. For example, `image.tag=X.Y.Z`. This approach is also applicable to other images like exporters.
|
||||||
|
|
||||||
|
### Initialize a fresh instance
|
||||||
|
|
||||||
|
The [Bitnami MySQL](https://github.com/bitnami/bitnami-docker-mysql) image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder `files/docker-entrypoint-initdb.d` so they can be consumed as a ConfigMap.
|
||||||
|
|
||||||
|
The allowed extensions are `.sh`, `.sql` and `.sql.gz`.
|
||||||
|
|
||||||
|
## Persistence
|
||||||
|
|
||||||
|
The [Bitnami MySQL](https://github.com/bitnami/bitnami-docker-mysql) image stores the MySQL data and configurations at the `/bitnami/mysql` path of the container.
|
||||||
|
|
||||||
|
The chart mounts a [Persistent Volume](https://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning by default. An existing PersistentVolumeClaim can be defined.
|
||||||
|
|
||||||
|
### Adjust permissions of persistent volume mountpoint
|
||||||
|
|
||||||
|
As the image run as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it.
|
||||||
|
|
||||||
|
By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions.
|
||||||
|
As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination.
|
||||||
|
|
||||||
|
You can enable this initContainer by setting `volumePermissions.enabled` to `true`.
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
It's necessary to set the `root.password` parameter when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use under the 'Administrator credentials' section. Please note down the password and run the command below to upgrade your chart:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ helm upgrade my-release bitnami/mysql --set root.password=[ROOT_PASSWORD]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Note: you need to substitue the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes.
|
||||||
|
|
||||||
|
### To 3.0.0
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||||
|
Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is mysql:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ kubectl delete statefulset mysql-master --cascade=false
|
||||||
|
$ kubectl delete statefulset mysql-slave --cascade=false
|
||||||
|
```
|
||||||
29
gitea/charts/mysql/ci/values-production.yaml
Normal file
29
gitea/charts/mysql/ci/values-production.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Test values file for generating all of the yaml and check that
|
||||||
|
# the rendering is correct
|
||||||
|
|
||||||
|
volumePermissions:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
master:
|
||||||
|
extraEnvVars:
|
||||||
|
- name: TEST
|
||||||
|
value: "3"
|
||||||
|
|
||||||
|
extraEnvVarsSecret: example-secret
|
||||||
|
extraEnvVarsCM: example-cm
|
||||||
|
|
||||||
|
slave:
|
||||||
|
extraEnvVars:
|
||||||
|
- name: TEST
|
||||||
|
value: "2"
|
||||||
|
|
||||||
|
extraEnvVarsSecret: example-secret-2
|
||||||
|
extraEnvVarsCM: example-cm-2
|
||||||
|
replicas: 2
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: true
|
||||||
|
## Kubeval doesn't recognise ServiceMonitor as a valid K8s object
|
||||||
|
# serviceMonitor:
|
||||||
|
# enabled: true
|
||||||
|
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
You can copy here your custom .sh, .sql or .sql.gz file so they are executed during the first boot of the image.
|
||||||
|
|
||||||
|
More info in the [bitnami-docker-mysql](https://github.com/bitnami/bitnami-docker-mysql#initializing-a-new-instance) repository.
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user