MOCO Helm Chart

How to use MOCO Helm repository

You need to add this repository to your Helm repositories:

$ helm repo add moco
$ helm repo update

Quick start

Installing cert-manager

$ curl -fsL | kubectl apply -f -

Installing the Chart


This installation method requires cert-manager to be installed beforehand. To install the chart with the release name moco using a dedicated namespace(recommended):

$ helm install --create-namespace --namespace moco-system moco moco/moco

Specify parameters using --set key=value[,key=value] argument to helm install.

Alternatively a YAML file that specifies the values for the parameters can be provided like this:

$ helm install --create-namespace --namespace moco-system moco -f values.yaml moco/moco


image.repositorystring""MOCO image repository to use.
image.tagstring{{ .Chart.AppVersion }}MOCO image tag to use.
resourcesobject{"requests":{"cpu":"100m","memory":"20Mi"}}resources used by moco-controller.
extraArgslist[]Additional command line flags to pass to moco-controller binary.
nodeSelectorobject{}nodeSelector used by moco-controller.
affinityobject{}affinity used by moco-controller.
tolerationslist[]tolerations used by moco-controller.
topologySpreadConstraintslist[]topologySpreadConstraints used by moco-controller.

Generate Manifests

You can use the helm template command to render manifests.

$ helm template --namespace moco-system moco moco/moco

Upgrade CRDs

There is no support at this time for upgrading or deleting CRDs using Helm. Users must manually upgrade the CRD if there is a change in the CRD used by MOCO.

Migrate to v0.3.0

Chart version v0.3.0 has breaking changes. The of the resource generated by Chart is changed.


  • {{ template "moco.fullname" . }}-foo-resources -> moco-foo-resources

Related Issue: cybozu-go/moco#426

If you are using a release name other than moco, you need to migrate.

The migration steps involve deleting and recreating each MOCO resource once, except CRDs. Since the CRDs are not deleted, the pods running existing MySQL clusters are not deleted, so there is no downtime. However, the migration process should be completed in a short time since the moco-controller will be temporarily deleted and no control over the cluster will be available.

migration steps
  1. Show the installed chart

    $ helm list -n <YOUR NAMESPACE>
    NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
    moco    moco-system     1               2022-08-17 11:28:23.418752 +0900 JST    deployed        moco-0.2.3      0.12.1
  2. Render the manifests

    $ helm template --namespace moco-system --version <YOUR CHART VERSION> <YOUR INSTALL NAME> moco/moco > render.yaml
  3. Setup kustomize

    $ cat > kustomization.yaml <<'EOF'
      - render.yaml
      - crd-patch.yaml
    $ cat > crd-patch.yaml <<'EOF'
    $patch: delete
    kind: CustomResourceDefinition
    $patch: delete
    kind: CustomResourceDefinition
  4. Delete resources

    $ kustomize build ./ | kubectl delete -f -
    serviceaccount "moco-controller-manager" deleted "moco-leader-election-role" deleted "moco-backuppolicy-editor-role" deleted "moco-backuppolicy-viewer-role" deleted "moco-manager-role" deleted "moco-mysqlcluster-editor-role" deleted "moco-mysqlcluster-viewer-role" deleted "moco-leader-election-rolebinding" deleted "moco-manager-rolebinding" deleted
    service "moco-webhook-service" deleted
    deployment.apps "moco-controller" deleted "moco-controller-grpc" deleted "moco-grpc-ca" deleted "moco-serving-cert" deleted "moco-grpc-issuer" deleted "moco-selfsigned-issuer" deleted "moco-mutating-webhook-configuration" deleted "moco-validating-webhook-configuration" deleted
  5. Delete Secret

    $ kubectl delete secret sh.helm.release.v1.<YOUR INSTALL NAME>.v1 -n <YOUR NAMESPACE>
  6. Re-install the v0.3.0 chart

    $ helm install --create-namespace --namespace moco-system --version 0.3.0 moco moco/moco

Release Chart