Giter Club home page Giter Club logo

cortx-k8s's Introduction

CORTX on Kubernetes

Codacy Badge

CORTX Community Object Storage is 100% open-source object storage, uniquely optimized for mass capacity storage devices. This repository provides capability and support for deploying CORTX onto the Kubernetes container orchestration platform.

Table of Contents

  1. Project Overview
  2. Reference Architecture
  3. CORTX on Kubernetes Prerequisites
  4. Kubernetes Reference Deployments
  5. Quick Starts
    1. Using the prereq deploy script (Optional)
    2. Deploying CORTX on Kubernetes
    3. Upgrading CORTX on Kubernetes
    4. Using CORTX on Kubernetes
    5. Log collection for CORTX on Kubernetes
    6. Undeploying CORTX on Kubernetes
  6. Solution YAML Overview
  7. Troubleshooting
  8. License

Project Overview

This repository provides application-specific Helm charts and deployment scripts for deploying CORTX on to an existing Kubernetes cluster.

Deploying and managing Kubernetes is outside the scope of this repository, however configuration and best practices are offered as guidance where appropriate, along with links to reference Kubernetes cluster deployment processes.

Reference Architecture

CORTX on Kubernetes Reference Architecture

CORTX on Kubernetes consists of five primary components:

  1. Prerequisite services, consisting of Consul, Apache Kafka, and OpenLDAP.

  2. CORTX Control Pods

    • These pods maintain the CORTX control plane
    • Usually with a cardinality of one pod per CORTX deployment
  3. CORTX Data Pods

    • These pods maintain the CORTX data plane
    • Usually with a cardinality of one pod per CORTX node
  4. CORTX Server Pods

    • These pods maintain the CORTX API and user interfaces
    • Usually with a cardinality of one pod per CORTX node (but scalable based on system traffic)
  5. CORTX HA Pods

    • These pods maintain the overall high-availability of the CORTX deployment
    • Usually with a cardinality of one pod per CORTX deployment

CORTX on Kubernetes Prerequisites

  1. Helm

    CORTX on Kubernetes is provided via Helm Charts. As such, you will need Helm installed locally to deploy CORTX on Kubernetes. You can find the specific installation instructions for your local platform via the Installing Helm section of the official Helm documentation.

  2. Uniform device paths

    CORTX on Kubernetes currently expects all Kubernetes Nodes to have a uniform device/drive setup across the Kubernetes cluster. This is to say that CORTX on Kubernetes expects all Kubernetes Nodes to have the same /dev/sdb, /dev/sdc, /dev/sdN, etc device paths on every node.

    ℹ️ This requirement will be going away in a future release (some time after v0.0.20).

  3. Required kernel parameters

    CORTX on Kubernetes currently requires the vm.max_map_count set to a specific minimum level of 30000000 (thirty million) on the Kubernetes Nodes which cortx-data Pods will run.

    • The prereq-deploy-cortx-cloud.sh script will set this value prior to deployment if you choose to utilize it.
    • The cortx-data Pods include an initContainer that will check for this minimal value and halt deployment if not met.
  4. Local path provisioner

    CORTX on Kubernetes currently uses the Rancher Local Provisioner to manage some dynamic provisioning of local storage for prerequisite services.

    • The prereq-deploy-cortx-cloud.sh script will ensure this directory exists, if you choose to utilize it.
    • This directory prefix is configurable in the solution.yaml file via the solution.common.storage_provisioner_path, while appending local-path-provisioner to it.
      • You can manually create this path via the default values of /mnt/fs-local-volume/local-path-provisioner on every Kubernetes Node
      • Or you can customize the value of solution.common.storage_provisioner_path and create directories on every Kubernetes Node to match (i.e. /mnt/cortx-k8s/local-volumes/local-path-provisioner.
  5. OpenLDAP directories

    CORTX on Kubernetes currently leverages OpenLDAP as a required service. The deployment scripts require specific local directories to exist on the Kubernetes Nodes which OpenLDAP will run on.

    • The prereq-deploy-cortx-cloud.sh script will ensure these directories exist, if you choose to utilize it.
    • Or you can manually create the following directories on every Kubernetes Node to ensure functional operation of OpenLDAP:
      1. /etc/3rd-party/openldap
      2. /var/data/3rd-party
      3. /var/log/3rd-party

    ℹ️ This requirement will be going away in a future release (some time after v0.0.20).

Kubernetes Reference Deployments

There are numerous ways to install and configure a complete Kubernetes cluster. As long as the prerequisites in the previous step are all satisfied, CORTX on Kubernetes should deploy successfully.

For reference material, we have provided existing Kubernetes deployment models that have been verified to work with CORTX on Kubernetes. These are only provided for reference and are not meant to be explicit deployment constraints.

  1. Seagate Internal Jenkins Job
  2. CORTX on AWS and Kubernetes - Quick Install Guide
  3. CORTX on Minikube - Quick Install Guide

Should you have trouble deploying CORTX on Kubernetes to your Kubernetes cluster, please open an Issue in this repository for further troubleshooting.

Quick Starts

All steps in the following quick starts assume the proper prerequisites have been installed or configured as described in CORTX on Kubernetes Prerequisites above.

Using the prereq deploy script (Optional)

If you have direct access to the underlying Kubernetes Nodes in your cluster, CORTX on Kubernetes provides a prerequisite deployment script that will configure the majority of the low-level system configuration requirements prior to CORTX deployment. This is not a required step if you choose to ensure all the prerequisites mentioned above are satisfied manually.

  1. Copy prereq-deploy-cortx-cloud.sh script, and the solution yaml file to all worker nodes:
scp prereq-deploy-cortx-cloud.sh <user>@<worker-node-IP-address>:<path-to-prereq-script>
scp <solution_yaml_file> <user>@<worker-node-IP-address>:<path-to-solution-yaml>
  1. Run prerequisite script on all worker nodes in the cluster, and any untainted control nodes which allow Pod scheduling. <disk> is a required input to run this script. This disk should NOT be any of the devices listed in solution.storage.cvg* in the solution.yaml file:
sudo ./prereq-deploy-cortx-cloud.sh <disk> [<solution-file>]

ℹ️ <solution-file> is an optional input to run prereq-deploy-cortx-cloud.sh script. Make sure to use the same solution file for prereqs, deploy and destroy scripts. The default <solution-file> is solution.yaml.

Deploying CORTX on Kubernetes

  1. Clone this repository to a machine with connectivity to your Kubernetes cluster:
git clone https://github.com/Seagate/cortx-k8s

ℹ️ You can also use the latest released version of the CORTX on Kubernetes code via the Releases page found at https://github.com/Seagate/cortx-k8s/releases/latest

  1. Update or clone ./k8_cortx_cloud/solution.yaml to reflect your environment. The most common and expected updates are reflected below:

    • Update all passwords in solution.yaml. The csm-secret should include one special character in cortx-secret.
    • Update the images section with cortx-all image tag desired to be used.
      • Each specific release of the CORTX on Kubernetes code will point to a specific predefined container image.
      • This can be overriden as desired.
    • Update SNS and DIX durability values. The default value for both parameters is 1+0+0.
    • Update storage cvg devices for data and metadata with respect to the devices in your environment.
    • Update nodes section with proper node hostnames from your Kubernetes cluster.
      • If the Kubernetes control plane nodes are required to be used for deployment, make sure to remove the taint from it before deploying CORTX.
      • For further details and reference, you can view the official Kubernetes documentation topic on Taints & Tolerations
    • For further details on solution.yaml specifics, review the Solution YAML Overview below.
  2. Run the deploy-cortx-cloud.sh script, passing in the path to your updated solution.yaml file.

./deploy-cortx-cloud.sh solution.yaml
  1. Validate CORTX on Kubernetes status
DATA_POD=$(kubectl get pods -l cortx.io/service-type=cortx-data --no-headers | awk '{print $1}' | head -n 1)
kubectl exec -it $DATA_POD -c cortx-hax -- /bin/bash -c "hctl status"

Upgrading CORTX on Kubernetes

ℹ️ As the CORTX on Kubernetes architecture is evolving, the upgrade path for CORTX on Kubernetes is evolving as well. As a workaround until more foundational upgrade capabilities exist, the following steps are available to manually upgrade your CORTX on Kubernetes environment to a more recent release.

  1. Deploy CORTX on Kubernetes according to the Deploying CORTX on Kubernetes steps above.

  2. Run the upgrade script to patch the CORTX on Kubernetes Deployments using an updated image (:information_source: You will want to update the TARGET_IMAGE variable below to your desired image tag). The script will stop all CORTX Pods, update the Deployments, and then re-start the Pods.

TARGET_IMAGE="ghcr.io/seagate/cortx-all:2.0.0-641-custom-ci"
./upgrade-cortx-cloud.sh -s solution.yaml -i $TARGET_IMAGE

Using CORTX on Kubernetes

TODO Port https://seagate-systems.atlassian.net/wiki/spaces/PUB/pages/754155622/CORTX+Kubernetes+N-Pod+Deployment+and+Upgrade+Document+using+Services+Framework#5.-Understanding-Management-and-S3-Endpoints-and-configuring-External-Load-balancer-service(Optional) here or into a linked doc/readme file.

Log collection for CORTX on Kubernetes

To gather logs from a CORTX on Kubernetes deployment, run the logs-cortx-cloud.sh script while passing in the solution.yaml file to it.

./logs-cortx-cloud.sh --solution-config solution.yaml

Undeploying CORTX on Kubernetes

Run the destroy-cortx-cloud.sh script, passing in the path to the previously updated solution.yaml file

./destroy-cortx-cloud.sh solution.yaml

Solution YAML Overview

The CORTX solution consists of all paramaters required to deploy CORTX on Kubernetes. The pre-req, deploy, and destroy scripts parse the solution file and extract information they need to deploy and destroy CORTX.

All paths below are prefixed with solution. for fully-qualified naming.

Global parameters

Name Description Value
namespace The kubernetes namespace for CORTX Pods to be deployed in. default

Secret parameters

This section contains the CORTX and third-party authentication information used to deploy CORTX on Kubernetes.

Name Description Value
secrets.name Name for the Kubernetes secret CORTX uses to store solution-specific secrets. cortx-secret
secrets.content.openldap_admin_secret Administrator password for the OpenLDAP required service seagate1
secrets.content.kafka_admin_secret Administrator password for the Kafka required service Seagate@123
secrets.content.consul_admin_secret Administrator password for the Consul required service Seagate@123
secrets.content.common_admin_secret Administrator password for the CORTX common services Seagate@123
secrets.content.s3_auth_admin_secret Administrator password for the S3 Auth CORTX component ldapadmin
secrets.content.csm_auth_admin_secret Administrator password for the CSM Auth CORTX component seagate2
secrets.content.csm_mgmt_admin_secret Administrator password for the CSM Managment CORTX component Cortxadmin@123

Image parameters

This section contains the CORTX and third-party images used to deploy CORTX on Kubernetes.

Name Description Value
images.cortxcontrolprov Image name (registry, repository, & tag) for the CORTX Control Provisioner components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxcontrol Image name (registry, repository, & tag) for the CORTX Control components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxdataprov Image name (registry, repository, & tag) for the CORTX Data Provisioner components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxdata Image name (registry, repository, & tag) for the CORTX Data components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxserverprov Image name (registry, repository, & tag) for the CORTX Server Provisioner components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxserver Image name (registry, repository, & tag) for the CORTX Server components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxha Image name (registry, repository, & tag) for the CORTX HA components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.cortxclient Image name (registry, repository, & tag) for the CORTX Client components ghcr.io/seagate/cortx-all:2.0.0-stable-custom-ci
images.openldap Image name (registry, repository, & tag) for the OpenLDAP required service ghcr.io/seagate/symas-openldap:2.4.58
images.consul Image name (registry, repository, & tag) for the Consul required service ghcr.io/seagate/consul:1.10.0
images.kafka Image name (registry, repository, & tag) for the Kafka required service ghcr.io/seagate/kafka:3.0.0-debian-10-r7
images.zookeeper Image name (registry, repository, & tag) for the Zookeeper required service ghcr.io/seagate/zookeeper:3.7.0-debian-10-r182
images.rancher Image name (registry, repository, & tag) for the Rancher Local Path Provisioner container ghcr.io/seagate/local-path-provisioner:v0.0.20
images.busybox Image name (registry, repository, & tag) for the utility busybox container ghcr.io/seagate/busybox:latest

Common parameters

This section contains common paramaters that applies to all CORTX Data nodes.

Name Description Value
_TODO_ TBD TBD

Storage parameters

The metadata and data drives are defined in this section. All drives must be the same across all nodes on which CORTX Data will be deployed. A minimum of 1 CVG of type ios with one metadata drive and one data drive is required.

Name Description Value
_TODO_ TBD TBD

Node parameters

This section contains information about all the worker nodes used to deploy CORTX cloud cluster. All nodes must have all the metadata and data drives mentioned in the "Storage" section above.

Name Description Value
nodes.node1.name Kubernetes node name for the first node in the Kubernetes cluster available to deploy CORTX components. node-1
nodes.node2.name Kubernetes node name for the second node in the Kubernetes cluster available to deploy CORTX components. node-2
... ... ...
nodes.nodeN.name Kubernetes node name for the Nth node in the Kubernetes cluster available to deploy CORTX components. ""

Troubleshooting

Using stub containers

The Helm charts work with both "stub" and "CORTX ALL" containers, allowing users to deploy both placeholder Kubernetes artifacts and functioning CORTX deployments using the same code base. If you are encountering issues deploying CORTX on Kubernetes, you can utilize the stub container method by setting the necessary component in solution.yaml to use an image of ghcr.io/seagate/centos:7 instead of a CORTX-based image. This will deploy the same Kubernetes structure, expect the container entrypoints will be set to sleep 3650d to allow for deployment progression and user inspection of the overall deployment.

License

CORTX is 100% Open Source. Most of the project is licensed under the Apache 2.0 License and the rest is under AGPLv3; check the specific License file of each CORTX submodule to determine which is which.

cortx-k8s's People

Contributors

alfhad avatar christopherigm2 avatar codacy-badger avatar danthanhton avatar gregnsk avatar john-a-fletcher avatar johnbent avatar jugalpatil avatar keithpine avatar mend-for-github-com[bot] avatar mukul-seagate11 avatar osowski avatar r-wambui avatar sumedhak27 avatar udayan-y21 avatar venkuppu-chn avatar walterlopatka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.