A beginner's Guide to KubeSphere

A beginner's Guide to KubeSphere

One Kubernetes Platform for Full Stack Solutions

What is KubeSphere?

KubeSphere is a distributed operating system for cloud-native application management, using Kubernetes as its kernel. It provides a plug-and-play architecture, allowing third-party applications to be seamlessly integrated into its ecosystem.

KubeSphere is also a multi-tenant enterprise-grade open-source Kubernetes container platform with full-stack automated IT operations and streamlined DevOps workflows. It provides developer-friendly wizard web UI, helping enterprises to build out a more robust and feature-rich Kubernetes platform, which includes the most common functionalities needed for enterprise Kubernetes strategies.

Why KubeSphere?

Here are the reasons why you should use KubeShpere.

1. Open Source i01_open-source (1).jpg It is a CNCF-certified Kubernetes platform, 100% open-source, built and improved by the community.

2. Easy to Run i02_easy-to-run.jpg It can be deployed on an existing Kubernetes cluster or Linux machines and supports the online and air-gapped installation.

3. Rich Features i03_feature-rich.jpg It delivers DevOps, service mesh, observability, application management, multi-tenancy, storage, and networking management in a unified platform.

4. Modular & Pluggable i01_modular-pluggable.jpg Its functionalities are modularized and loosely coupled with the platform. Choose the modules according to your business needs.

How to get Started

You need to have the Kubernetes cluster configured and running before you can install KubeShpere on Kubernetes.

Prerequisites

  • To install KubeSphere 3.2.1 on Kubernetes, your Kubernetes version must be v1.19.x, v1.20.x, v1.21.x or v1.22.x (experimental).
  • Make sure your machine meets the minimal hardware requirement: CPU > 1 Core, Memory > 2 GB.
  • A default Storage Class in your Kubernetes cluster needs to be configured before the installation.

    The CSR signing feature is activated in kube-apiserver when it is started with the --cluster-signing-cert-file and --cluster-signing-key-file parameters.

Installing on Kubernetes

Video Demonstration

After you make sure your machine meets the conditions, perform the following steps to install KubeSphere.

Run the following commands to start installation:

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/kubesphere-installer.yaml

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/cluster-configuration.yaml

This will be displayed if it runs successfully.

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://192.168.0.2:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After you log into the console, please check the
     monitoring status of service components in
     "Cluster Management". If any service is not
     ready, please wait patiently until all components 
     are up and running.
  2. Please change the default password after login.

#####################################################
https://kubesphere.io             20xx-xx-xx xx:xx:xx
#####################################################

After KubeSphere is successfully installed, you can run the following command to view the installation logs:

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

Untitled.png

Installing on Linux

For those who are new to KubeSphere and looking for a quick way to discover the container platform, the all-in-one mode is your best choice to get started. It features rapid deployment and hassle-free configurations with KubeSphere and Kubernetes all provisioned on your machine.

Video Demonstration

Step 1: Prepare a Linux Machine

To get started with all-in-one installation, you only need to prepare one host according to the following requirements for hardware and operating system.

Hardware recommendations

OS

  • Ubuntu 16.04, 18.04, Debian Buster, Stretch, CentOS 7.x, Red Hat Enterprise Linux 7, SUSE Linux Enterprise Server 15/openSUSE Leap 15.2

Minimum Requirements

  • 2 CPU cores, 4 GB memory, and 40 GB disk space

Node requirements

The node can be accessed through SSH.

sudo/curl/opensslshould be used.

Container runtimes

Container - Docker

Version - 19.3.8 +

Network and DNS requirements

Make sure the DNS address in /etc/resolv.conf is available. Otherwise, it may cause some issues of DNS in the cluster.

Step 2: Download KubeKey

curl -sfL https://get-kk.kubesphere.io | VERSION=v2.0.0 sh -

Make kk executable:

chmod +x kk

Step 3: Get Started with Installation

You only need to run one command for all-in-one installation. The template is as follows:

./kk create cluster [--with-kubernetes version] [--with-kubesphere version]

To create a Kubernetes cluster with KubeSphere installed, refer to the following command as an example:

./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.1

Step 4: Verify the Installation

Run the following command to check the result.

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

The output displays the IP address and port number of the web console, which is exposed through NodePort 30880 by default. Now, you can access the console at <NodeIP>:30880 with the default account and password (admin/P@88w0rd).

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://192.168.0.2:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After you log into the console, please check the
     monitoring status of service components in
     "Cluster Management". If any service is not
     ready, please wait patiently until all components 
     are up and running.
  2. Please change the default password after login.

#####################################################
https://kubesphere.io             20xx-xx-xx xx:xx:xx
#####################################################

After Installation -

Use kubectl get pod --all-namespaces to see whether all Pods are running normally in relevant namespaces of KubeSphere. If they are, check the port (30880by default) of the console by running the following command:

kubectl get svc/ks-console -n kubesphere-system

Make sure port 30880 is opened in your security group and access the web console through the NodePort (IP:30880) with the default account and password (admin/P@88w0rd).

Untitled.png After logging in to the console, you can check the status of different components in System Components. You may need to wait for some components to be up and running if you want to use related services.

Untitled.png

Benefits of KubeSphere to Different Teams

Multi-tenancy enables different teams to securely deploy and maintain containerized applications from the cloud to the edge.

It allows developers to deploy code with several clicks on the friendly console and brings integrated observability and powerful DevOps strategies to the Ops team.

It also helps the Infra team install and maintain the Kubernetes cluster with efficient, flexible network solutions that avoid locking teams into a single-vendor ecosystem.

1. For Infra Teams

i01_7.jpg Automated installation, scaling, and upgrades from cloud to data center.

  • Improve your resource utilization and reduce internal infrastructure costs
  • Provide security enhancements, and support multiple storage and network solutions.
  • Deliver a trustworthy and certified Kubernetes platform and distribution.
  • Support multi-cloud and multi-cluster Kubernetes management, avoiding vendor lock-in (coming soon).

2. For Developers

74 (1).png Liberate developers from complicated YAML, enabling them to focus on business.

  • Create a smooth user experience and reduce the learning curve of the cloud-native - stack.
  • Provide toolkits and deployment automation tailored to any application environment.
  • Offer out-of-box toolkits for building reproducible images from source code, improving development efficiency.
  • Support application lifecycle management, accelerating time to market.

3. For Ops Team

i02_71.jpg Build a one-stop enterprise-grade DevOps framework

  • Provide centralized log collection, monitoring, alerting, events, and audit logs from infrastructure to applications.
  • Streamlined process of continuous deployment, test, release, upgrade and scale.
  • Better tracking, routing, and optimized communications within Kubernetes for cloud-native apps.
  • Easy-to-use web terminal and graphical panel, satisfying the needs of different users.

4. For End-User

i04_80.jpg Running and using Apps on Kubernetes has never been so easy

  • Deploy and upgrade Apps with one click to the transparent underlying infrastructure.
  • Provide on-demand container resources and HPA, hardening the reliability and flexibility of your applications.
  • Import any Helm repository in seconds to visually deploy and upgrade applications.
  • Support operation in the application store, including metering and billing for applications (coming soon).

##Features & Architecture

Separation of frontend and backend

KubeSphere separates the frontend from the backend, and it is a cloud-native application that provides open standard REST APIs for external systems to use. Please see the API documentation for details. The following figure is the system architecture. KubeSphere can run anywhere from an on-premise data center to any cloud to edge. In addition, it can be deployed on any Kubernetes distribution.

20190810073322.png

Key Features of KubeSphere

1. Kubernetes DevOps System

I. Out-of-the-Box CI/CD Pipelines CD-pipeline.png

  • Easy integration with SCM including GitLab/GitHub/BitBucket/SVN to simplify continuous integration.
  • Graphical editing panels designed to visualize and simplify CI/CD pipeline creation without writing any Jenkinsfile.
  • Easy SonarQube Integration to implement source code quality analysis and view results on the KubeSphere console.
  • Dependency cache is available for tools like Maven running in Kubernetes Pods to accelerate image building and workloads deployment across Kubernetes Clusters.

II. Built-in Automation Toolkits for DevOps with Kubernetes Built-in-automated-toolkits.png

  • Source-to-Image builds reproducible container images from source code without writing any Dockerfile and deploys workloads to Kubernetes clusters.
  • Binary-to-Image builds your artifacts into runnable images and deploys workloads to Kubernetes clusters.
  • Automating image building and pushing to any registry and achieving continuous deployment to Kubernetes clusters.
  • Excellent resiliency and recoverability as you can copy pipelines and run them concurrently as well as rebuild and rerun S2I/B2I whenever a patch is needed.

III. Use Jenkins Pipelines to Implement DevOps on Top of Kubernetes

Clear-insight.png

  • Kubernetes combined with Git to facilitate continuous integration with code repositories and boost continuous delivery of cloud-native applications.
  • Efficient DevOps teamwork through the KubeSphere multi-tenant system based on Kubernetes RBAC to achieve better access control in CI/CD workflows.
  • Powerful DevOps observability with dynamic logs for S2I/B2I builds and pipelines to help you manage Kubernetes DevOps resources with ease.
  • Auditing, alerting, and notifications are available for pipelines to ensure quick identification and resolution of issues throughout CI/CD workflows.
  • Git webhooks for SCM pipelines to automatically trigger a Jenkins build when new commits are submitted to a branch.

2. Service Mesh (Istio-based)

I. Kubernetes Service Mesh Traffic Management traffic-management.png

  • Canary release provides canary rollouts and staged rollouts with percentage-based traffic splits.
  • Blue-green deployment allows the new version of an application to be deployed in a separate environment and tested for functionality and performance.
  • Traffic mirroring is a powerful, risk-free method of testing your app versions as it sends a copy of live traffic to a mirrored Service.
  • Circuit breakers allow users to set limits for calls to individual hosts within a Service.

II. Kubernetes Microservices Visualization visualization.png

  • Observability is extremely useful in understanding cloud-native microservice interconnections.
  • KubeSphere can visualize the connections between microservices and the topology of how they interconnect.

III. Distributed Tracing for Kubernetes traffic-management.png

  • Based on Jaeger, KubeSphere enables users to track how each Service interacts with each other.
  • It brings a deeper understanding of request latency, bottlenecks, serialization, and parallelism via visualization.

3.Cloud Native Observability

I. Multi-dimensional Kubernetes Monitoring multi-dimensional-monitoring.png

  • Infrastructure monitoring provides K8s control plane and cluster node metrics.
  • Application resources monitoring includes CPU, memory, network, and storage metrics.
  • Resource usage ranking by node, workspace, and project.
  • Service component monitoring for users to quickly locate component failures.
  • Custom metrics support includes application custom metrics dashboard (in v3.0.0).

II. Kubernetes Log Collection and Management log-query-and-collection.png

  • Multi-tenant log management ensures different tenants can only see their log information.
  • Multi-level log queries include projects, workloads, Pods, containers, and keywords, supporting drilling into each level to locate the issues.
  • Support multiple log collection platforms, such as Elasticsearch, Kafka and Fluentd
  • Service component monitoring for users to quickly locate component failures.

III. Flexible Kubernetes Alerting and Notification flexible-alerting-and-notification.png Rich alerting rules based on multi-tenancy and multi-dimensional monitoring metrics.

  • Flexible alerting policy allows you to customize an alerting policy that contains multiple alerting rules.
  • Multi-level monitoring metrics for alerting, ranging from infrastructure to workloads
  • Flexible alerting rules allow you to customize the detection period, duration and alerting priority of monitoring metrics.
  • Integration with AlertManager supports multiple notification channels (in v3.0.0).

4. App Store

  • As an open-source and app-centric container platform, KubeSphere provides users with a Helm-based App Store for application lifecycle management on the back of OpenPitrix, an open-source web-based system to package, deploy and manage different types of apps. The KubeSphere App Store allows ISVs, developers, and users to upload, test, install, and release apps with just several clicks in a one-stop-shop.
  • Internally, the KubeSphere App Store can serve as a place for different teams to share data, middleware, and office applications. Externally, it is conducive to setting industry standards of building and delivery. After you enable this feature, you can add more apps with app templates.

5. Kubernetes Multi-cluster Management

multi-cluster-overview.jpg

  • Today, it's very common for organizations to run and manage multiple Kubernetes clusters across different cloud providers or infrastructures. As each Kubernetes cluster is a relatively self-contained unit, the upstream community is struggling to research and develop a multi-cluster management solution. That said, Kubernetes Cluster Federation (KubeFed for short) may be a possible approach among others.
  • The most common use cases of multi-cluster management include service traffic load balancing, development, and production isolation, decoupling of data processing and data storage, cross-cloud backup and disaster recovery, flexible allocation of computing resources, low latency access with cross-region services, and vendor lock-in avoidance.
  • KubeSphere is developed to address multi-cluster and multi-cloud management challenges, including the scenarios mentioned above. It provides users with a unified control plane to distribute applications and their replicas to multiple clusters from the public cloud to on-premises environments. KubeSphere also boasts rich observability across multiple clusters including centralized monitoring, logging, events, and auditing logs.

6. Edge Computing Platform

kubeedge_arch.png

  • KubeEdge is an open-source system for extending native containerized application orchestration capabilities to hosts at the edge. It supports multiple edge protocols and looks to provide unified management of cloud and edge applications and resources.
  • KubeEdge has components running in two separate places - cloud and edge nodes. The components running on the cloud, collectively known as CloudCore, include Controllers and Cloud Hub. Cloud Hub serves as the gateway for the requests sent by edge nodes while Controllers function as orchestrators. The components running on edge nodes, collectively known as EdgeCore, include EdgeHub, EdgeMesh, MetadataManager, and DeviceTwin. For more information, see the KubeEdge website.
  • After you enable KubeEdge, you can add edge nodes to your cluster and deploy workloads on them.

7. Metering and Billing

  • KubeSphere metering helps you track resource consumption within a given cluster or workspace at a granular level.
  • Different tenants with different roles can only see the data to which they have access.
  • You can also set prices for varied resources to see billing information.

8. Other Features

  • Provisioning Kubernetes Deploy Kubernetes on any infrastructure out of the box, including online and air-gapped installation, and support adding GPU nodes
  • K8s Resource Management Provide a web console for creating and managing Kubernetes resources with powerful observability
  • Multi-tenant Management Provide unified authentication with fine-grained roles and a three-tier authorization system, and support AD/LDAP authentication
  • Multiple Storage and Networking Solutions Support GlusterFS, CephRBD, NFS, and LocalPV solutions, and provide CSI plugins to consume storage from multiple cloud providers. Provide a load balancer OpenELB for bare metal Kubernetes, and offers network policy management, support Calico and Flannel CNI

Use Cases

You can check this link to learn about the Use Cases of KubeSphere.

How to Contribute ✨

If you are a newbie to open source you can do the following things to get started -

  • Visit the Kubesphere GitHub page and look for first-timer issues.
  • You don't have to be good at coding you can fix documentation issues that's good enough to get started.
  • If you found any bugs you create an issue or if you have any feature requests you can submit them in the Github repo.
  • You can join Kubeshpere slack channel and connect with others.

Conclusion 😀

Thanks for reading my blog. Now you know about Kubesphere, its features, how to get started, and how to contribute. Now that you have the knowledge you should share it with others by making blogs, Twitter threads, or YouTube videos. I encourage you to do so.

Connect on KubeSphere Socials 😎

Twitter

YouTube

GitHub

Slack

LinkedIn

Facebook