Skip to main content

Menu

Webinar

Built for the Agentic Era: Introducing MariaDB Enterprise Platform 2027

Register now

Installing MariaDB Enterprise Kubernetes Operator on Ubuntu VM

By Susmeet Khaire

6 min read
Share
-- Add current user to sudoers (if not already added)
su -
adduser skhaire sudo

-- Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

-- Setup the Docker apt repository.
-- Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

-- Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

-- Install the latest version
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

-- Verify that the installation is successful by running the hello-world image:
sudo docker run hello-world
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64 
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64

minikube start
sudo usermod -aG docker $USER && newgrp docker
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg

curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg

echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly

sudo apt-get update
sudo apt-get install -y kubectl
kubectl create secret docker-registry mariadb-enterprise \
--docker-server=docker.wp.mariadb.com \
--docker-username=<email> \
--docker-password=<customer-download-token>
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

-- Check installation
helm version
helm repo add mariadb-enterprise-operator https://operator.wp.mariadb.com
helm install mariadb-enterprise-operator-crds mariadb-enterprise-operator/mariadb-enterprise-operator-crds
mkdir mariadb-enterprise-operator
cd mariadb-enterprise-operator
imagePullSecrets:
- name: mariadb-enterprise

webhook:
imagePullSecrets:
- name: mariadb-enterprise

certController:
imagePullSecrets:
- name: mariadb-enterprise
helm install mariadb-enterprise-operator mariadb-enterprise-operator/mariadb-enterprise-operator -f values.yaml
apiVersion: v1
kind: Secret
metadata:
name: mariadb
stringData:
password: MariaDB11!
kubectl apply -f secret.yaml
apiVersion: enterprise.wp.mariadb.com/v1alpha1
kind: MariaDB
metadata:
name: mariadb
spec:
rootPasswordSecretKeyRef:
name: mariadb
key: password
image: docker.wp.mariadb.com/enterprise-server:latest
imagePullPolicy: Always
imagePullSecrets:
- name: mariadb-enterprise

replicas: 1

port: 3306

storage:
size: 1Gi

myCnf: |
[mariadb]
bind-address=*
default_storage_engine=InnoDB
binlog_format=row
innodb_autoinc_lock_mode=2
innodb_buffer_pool_size=800M
max_allowed_packet=256M

resources:
requests:
cpu: 500m
memory: 1Gi
limits:
memory: 1Gi

metrics:
enabled: true
kubectl apply -f mariadb.yaml
kubectl get pods
kubectl describe pod/mariadb-0
kubectl logs mariadb-0
kubectl exec -it mariadb-0 -- /bin/bash

mariadb -uroot -pMariaDB11!
kubectl get pods

Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 3m6s default-scheduler Successfully assigned default/mariadb-0 to minikube
Normal Killing 35s (x3 over 2m15s) kubelet Container mariadb failed startup probe, will be restarted
Normal Pulled 34s (x4 over 3m3s) kubelet Container image "docker.wp.mariadb.com/enterprise-server:latest" already present on machine
Normal Created 34s (x4 over 3m2s) kubelet Created container: mariadb
Normal Started 34s (x4 over 3m2s) kubelet Started container mariadb
Warning Unhealthy 5s (x10 over 2m35s) kubelet Startup probe failed: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
minikube stop

minikube delete --all --purge