percona

by joaquinito2051

Helm chartv1.0.0App 5.7.17

free, fully compatible, enhanced, open source drop-in replacement for MySQL

About this chart

Percona

Percona Server for MySQL® is a free, fully compatible, enhanced, open source drop-in replacement for MySQL that provides superior performance, scalability and instrumentation. With over 3,000,000 downloads, Percona Server for MySQL's self-tuning algorithms and support for extremely high-performance hardware delivers excellent performance and reliability.

Notable users include Netflix, Amazon Web Services, Alcatel-Lucent, and Smug Mug.

Introduction

This chart, based off of the MySQL chart, bootstraps a single node Percona Server deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.6+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/percona

$ helm install --name my-release stable/percona The command deploys Percona Server on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

By default a random password will be generated for the root user. If you'd like to set your own password change the perconaRootPassword in the values.yaml.

You can retrieve your root password by running the following command. Make sure to replace [YOUR_RELEASE_NAME]:

printf $(printf '\%o' `kubectl get secret [YOUR_RELEASE_NAME]-percona -o jsonpath="{.data.mysql-root-password[*]}"`)

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

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

ParameterDescriptionDefault
imagepercona image.Percona official image on Docker Hub
imageTagpercona image tag.Most recent release
imagePullPolicyImage pull policyIfNotPresent
perconaRootPasswordPassword for the root user.nil
perconaUserUsername of new user to create.nil
perconaPasswordPassword for the new user.nil
perconaDatabaseName for new database to create.nil
persistence.enabledCreate a volume to store datafalse
persistence.sizeSize of persistent volume claim8Gi RW
persistence.storageClassType of persistent volume claimnil (uses alpha storage class annotation)
persistence.accessModeReadWriteOnce or ReadOnlyReadWriteOnce
resourcesCPU/Memory resource requests/limitsMemory: 256Mi, CPU: 100m
nodeSelectorNode labels for pod assignment{}
tolerationsNode labels for pod assignment[]
affinityNode labels for pod assignment{}

Some of the parameters above map to the env variables defined in the Percona Server DockerHub image.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release \
  --set mysqlLRootPassword=secretpassword,mysqlUser=my-user,mysqlPassword=my-password,mysqlDatabase=my-database \
    <helm-repo>/percona
$ helm install --name my-release \

The above command sets the MySQL root account password to secretpassword. Additionally it creates a standard database user named my-user, with the password my-password, who has access to a database named my-database.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml <helm-repo>/percona

$ helm install --name my-release -f values.yaml stable/percona

Tip: You can use the default values.yaml

Persistence

The Percona Server image stores the MySQL data and configurations at the /var/lib/mysql path of the container.

By default, an emptyDir volume is mounted at that location.

"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."

You can change the values.yaml to enable persistence and use a PersistentVolumeClaim instead.

Deploy percona with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has percona on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpercona is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply