Close
    logo                                         

    k8s-minio-operator

    MinIO operator

    Template version:v24-12-11

    Helm charts used:minio/operator v6.0.4

    MinIO is a Kubernetes-native high performance object store with an S3-compatible API. The MinIO Kubernetes Operator supports deploying MinIO Tenants onto private and public cloud infrastructures ("Hybrid" Cloud). This namespace deploys a MinIO Operator in a Kubernetes cluster.

    Note: MinIO Operator should be considered as cluster service. It is recommended to deploy it as a cluster singleton.


    Template override parameters

    File _values-tpl.yaml contains template configuration parameters and their default values:

    #
    # _values-tpl.yaml
    #
    # cskygen template default values file
    #
    _tplname: k8s-minio-operator
    _tpldescription: Kubernetes MinIO Operator
    _tplversion: 24-12-11
    #
    # Values to override
    #
    ## k8s cluster credentials kubeconfig file
    kubeconfig: config-k8s-mod
    namespace:
    ## k8s namespace name
    name: minio-operator
    publishing:
    ## External url
    url: minio-operator.cskylab.net
    certificate:
    ## Cert-manager clusterissuer
    clusterissuer: ca-test-internal
    registry:
    ## Proxy Repository for Docker
    proxy: harbor.cskylab.net/dockerhub

    TL;DR

    Install namespace and charts:

    # Pull charts to './charts/' directory
    ./csdeploy.sh -m pull-charts
    # Install
    ./csdeploy.sh -m install
    # Check status
    ./csdeploy.sh -l

    Run:

    • Published at: {{ .publishing.url }}
    • Get the JWT for logging in to the console:
    kubectl get secret $(kubectl get serviceaccount console-sa --namespace {{ .namespace.name }} -o jsonpath="{.secrets[0].name}") --namespace {{ .namespace.name }} -o jsonpath="{.data.token}" | base64 --decode

    Prerequisites

    • Administrative access to Kubernetes cluster.
    • Helm v3.

    How-to guides

    Pull Charts

    To pull charts, change the repositories and charts needed in variable source_charts inside the script csdeploy.sh and run:

    # Pull charts to './charts/' directory
    ./csdeploy.sh -m pull-charts

    When pulling new charts, all the content of ./charts directory will be removed, and replaced by the new pulled charts.

    After pulling new charts redeploy the new versions with: ./csdeploy -m update.

    Install

    To Create namespace, secrets, config-maps, PV's, apply module manifests and install charts:

    # Create namespace, secrets, config-maps, PV's, apply manifests and install charts.
    ./csdeploy.sh -m install

    Notice that PV's are not namespaced. They are deployed at cluster scope.

    Update

    To update charts settings, change values in override files values-*.yaml.

    Reapply module manifests and update or upgrade charts by running:

    # Reapply manifests and update or upgrade charts
    ./csdeploy.sh -m update

    Uninstall

    To uninstall charts, delete module manifests, remove PV's and namespace run:

    # Uninstall charts, delete manifests, remove PV's and namespace
    ./csdeploy.sh -m uninstall

    Remove

    This option is intended to be used only to remove the namespace when chart deployment is failed. Otherwise, you must run ./csdeploy.sh -m uninstall.

    To remove PV's, namespace and all its contents run:

    # Remove PV's namespace and all its contents
    ./csdeploy.sh -m remove

    Display status

    To display namespace, persistence and chart status run:

    # Display namespace, persistence and charts status:
    ./csdeploy.sh -l

    Operator console

    Connect to operator console with the following procedure:

    • Get the JWT for logging in to the console:
    kubectl get secret $(kubectl get serviceaccount console-sa --namespace {{ .namespace.name }} -o jsonpath="{.secrets[0].name}") --namespace {{ .namespace.name }} -o jsonpath="{.data.token}" | base64 --decode

    Utilities

    Passwords and secrets

    Generate passwords and secrets with:

    # Screen
    echo $(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 16)
    # File (without newline)
    printf $(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 16) > RESTIC-PASS.txt

    Change the parameter head -c 16 according with the desired length of the secret.

    Reference

    To learn more about minio/operator chart see:

    Helm charts and values

    ChartValues
    minio/operatorvalues-operator.yaml

    Scripts

    cs-deploy

    Purpose:
    Kubernetes basic namespace for app deployment.
    Usage:
    sudo csdeploy.sh [-l] [-m <execution_mode>] [-h] [-q]
    Execution modes:
    -l [list-status] - List current status.
    -m <execution_mode> - Valid modes are:
    [pull-charts] - Pull charts to './charts/' directory.
    [install] - Create namespace, secrets, config-maps, PV's,
    apply manifests and install charts.
    [update] - Reapply manifests and update or upgrade charts.
    [uninstall] - Uninstall charts, delete manifests, remove PV's and namespace.
    [remove] - Remove PV's, namespace and all its contents.
    Options and arguments:
    -h Help
    -q Quiet (Nonstop) execution.
    Examples:
    # Pull charts to './charts/' directory
    ./csdeploy.sh -m pull-charts
    # Create namespace, secrets, config-maps, PV's, apply manifests and install charts.
    ./csdeploy.sh -m install
    # Reapply manifests and update or upgrade charts.
    ./csdeploy.sh -m update
    # Uninstall charts, delete manifests, remove PV's and namespace.
    ./csdeploy.sh -m uninstall
    # Remove PV's, namespace and all its contents
    ./csdeploy.sh -m remove
    # Display namespace, persistence and charts status:
    ./csdeploy.sh -l

    License

    Copyright © 2021 cSkyLab.com ™

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.