×
Community Blog All-Around Kubernetes Tutorial: From Beginner to Expert

All-Around Kubernetes Tutorial: From Beginner to Expert

In this tutorial, we will help you learn about the basic knowledge and common skills of Container Kubernetes including how to deploy applications and create a cluster etc.

A Beginner's Guide to Kubernetes

This article provides a brief overview of Kubernetes and its various components.

Kubernetes was developed by Google as a solution for containerized application management in clustered environments. It is very handy when you need to manage related components that are distributed across infrastructures.

An Overview of Kubernetes

In a nutshell, Kubernetes runs and coordinates applications across machine clusters in a predictable, scalable, and highly available manner. It allows you to determine your applications' behavior and interactions with the outside world. Specifically, it allows you to:

  1. Scale services
  2. Make seamless updates
  3. Manage traffic to application versions
  4. Test faulty deployments

With Kubernetes interfaces and platform primitives, your applications are defined and managed for flexible, reliable and powerful utilization.

Kubernetes Architecture

Kubernetes utilizes a layered architecture that effectively abstracts complexities below the user level. At the basic level, a shared network allows clustered machines to communicate with each other flawlessly. Components, capabilities, and workloads are configured at the cluster level.

Within each Kubernetes cluster, there are specific roles assigned and controlled by one master server or a small group of machines. The master server is both the gateway and manager of other clusters, determining their health and balancing the workload. Master servers are the way through which clients access services through APIs, as well as maintain communication of components.

Apart from the master server, the platform also includes nodes that accept and run workloads using locally available or external resources. Kubernetes further includes containers such as Docker to isolate workload instances. Once nodes receive instructions from the master server, they create or destroy containers. All applications run within cluster containers after the master server submits either JSON or YAML plans after client input. Kubernetes determines how applications are processed entirely.

Components of the Master Server

It has been highlighted that the master server acts as the primary cluster control. It includes components that to accept requests, schedule workloads, authenticate users, control networking, manage health and scaling. The master could be a single machine or a distributed cluster. Please click the the link in the fist line to get to know the main components.

Related Blogs

Self-built Kubernetes on Alibaba Cloud

In this article, we will be setting up a self-built kubernetes on Alibaba Cloud Elastic Compute Service instances using Linux flavors (Centos7 and Ubuntu 16.

Alibaba Cloud Container Service for Kubernetes is a fully-managed service compatible with Kubernetes to help users focus on their applications rather than managing container infrastructure. There are two ways to deploy Kubernetes on Alibaba Cloud, one through Container Service (built-in) and the other through an Elastic Compute Service (ECS) instance (self-built). If you are not sure which installation method suits your needs better, then refer to the documentation Alibaba Cloud Kubernetes vs. self-built Kubernetes.

For the most part, choosing Alibaba Cloud Container Service is the preferred choice as it saves time and reduces the complexity to maintain Kubernetes clusters. However, there may be cases where a manual installation is better suited to your needs. In this article, we will be setting up a self-built kubernetes on Alibaba Cloud Elastic Compute Service instances using Linux flavors (Centos7 and Ubuntu 16.04).

Prerequisites

  1. A valid Alibaba Cloud account. If you don't have one already, sign up to the Free Trial to enjoy $300 worth in Alibaba Cloud products.
  2. An ECS instance running Ubuntu 16.04 or RHEL7 or Centos7. You can select your preferred region and configurations; this will not affect the outcome of the server setup.
  3. A sudo password for your server.

Understanding Kubernetes Configurations

In this article, we will deploy containerized Kubernetes applications and learn how to expose services as well as scaling them through replication by a controller.

We have seen, in our beginner's guide that Kubernetes is an open source platform used in containerized applications management. We have looked at the basics Kubernetes, terms, and what components do. In how to Install and Deploy Kubernetes on Ubuntu 16.04, the author has demonstrated the procedure of deploying Kubernetes on Alibaba Cloud. With our platform running successfully on the cloud platform, we are now going to explore more about primitives, deploying containerized applications. We shall also see how to expose services as well as scaling them through replication by a controller.

Prerequisites

You will need to get yourself acquainted with the concepts and deployment of Kubernetes for you to follow through with this article. There are specific terms that may need you to refer back to the articles for this tutorial.

Section 1: Kubernetes Primitives

Users leverage Kubernetes APIs for the creation, scaling and termination of applications on the platform. Kubernetes manages various types of objects, each targeted by a different operation. Objects constitute the basic building blocks of Kubernetes, availed as primitives for managing containerized applications. In summary, below are the most important Kubernetes API objects:

  1. Clusters
  2. Nodes
  3. Namespaces
  4. Pods
  5. Labels and selectors
  6. Services
  7. Replication set
  8. Deployment

Kubernetes treats nodes as objects within the cluster. Therefore, you can manage them as you would any other Kubernetes object. On top of that Namespaces on Kubernetes provide a means for the logical separation of applications. A common application of this feature is the separation of development, testing, staging and production clusters. With Namespaces, the various environments can be managed using APIs that link to them independently.

Docker containers running on Kubernetes are not deployed directly because Kubernetes does not understand the format. Kubernetes primitives are needed to package Docker into a different version that allows Kubernetes application management.

Pods can run multiple containers. For instance, we can have both Nginx and Redis containers to run a web server and cache operations in a singular pod. In the configuration, all containers in a pod are as a result of a pre-configured ped definition, and as such, they form a logical unit. Notably, inter-process communication (IPC) is the method of communication between pods.

How to Create a Cluster for Container Service with Kubernetes

In this tutorial, we will show you how to create a cluster on which you can install Alibaba Cloud's Container Service for Kubernetes.

Before you can run Kubernetes containerized application environments on Alibaba Cloud's Container Service for Kubernetes you need to create a Kubernetes cluster.

Orchestrating containerized applications with virtual management tools, such as Kubernetes and Docker Swarm, allows developers to manage and monitor production and development environments made up of containerized applications built directly into the Alibaba Cloud Container Service.

What Is Alibaba Cloud's Container Service?

Alibaba Cloud's Container Service is a scalable and reliable high-performance container management service that allows you to orchestrate and manage containerized application lifecycles with either Kubernetes or Docker Swarm.

Alibaba Cloud's Container Service offers multiple application release methods, including continuous integration, and also supports a microservices architecture. Container Service for Kubernetes provides enterprise level performance and flexibility for the management of Kubernetes containerized applications at every stage of the development lifecycle.

Alibaba Cloud's Container Service for Kubernetes simplifies cluster creation, management, and allows easy upscale. It also auto-integrates with Alibaba Cloud's virtualization, storage, network, and security services which improve and simplify the overall running environment for Kubernetes containerized applications.

Alibaba Cloud's Container Service is one of the first cloud container services to have passed the Certified Kubernetes Conformance Program.

What Is Kubernetes (k8s)?

Kubernetes is a large scale, open source, automated orchestration platform for multi-container applications. It eliminates the manual work involved in deploying and scaling containerized applications. Kubernetes orchestrates, manages, and monitors extensive, enterprise-grade clusters of nodes that together run containerized application stacks.

Kubernetes organizes containers into logical units for easy administration. It deals with the computing, networking, and storage infrastructure required by user workloads and is highly flexible and scalable. Kubernetes functions as both Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) and is flexible, simple to use, and portable.

Kubernetes mainly orchestrates applications built up of Docker containers, but it can also manage any container system that conforms to the Open Container Initiative (OCI) standards for container image formats and runtimes.

How to Deploy a SQL Server Container in Alibaba Container Service Kubernetes

In this tutorial, we are going to connect and deploy Kubernetes resources through the Alibaba Cloud console.

Prerequisites

Install a Kubernetes Cluster on Alibaba Cloud.

Connecting to Kubernetes Cluster

To manage the Kubernetes cluster, you need to connect to your cluster in using Cloud Shell CLI 2.0. It will help you execute "kubectl" command from local machine to "Kubernetes Services" which is hosted on Alibaba Cloud.

Step 1: To install "kubectl" on local machine, go to Alibaba Cloud Console Portal Link. select you "cluster" and click on "Manage" of your Kubernetes cluster.

Step 2: Scroll down and navigate to "Cluster Resource" Section and copy the key (kube config code).

Note:

  1. These commands will not work in cloud shell and must be running on your local machine.
  2. If you are planning to access the Kubernetes cluster using Public IP then copy Internet Access Code.
  3. If you have a VPN setup for this cluster then you can use VPN Access

Deploy Virtual Nodes Quickly with Container Service for Kubernetes

We will look at how Alibaba Cloud supports serverless container application scenarios with Container Service for Kubernetes and Elastic Container Instance.

Diverse Combinations of Containers and Serverless

With the popularization of containers and the serverless concept, the Alibaba Cloud Container Service team and the Elastic Compute Service team worked collaboratively and released multiple Serverless container products and solutions, including Serverless Kubernetes, Elastic Container Instance (ECI), and the virtual-nodes add-on feature. These products support a variety of serverless container application scenarios.

Serverless Kubernetes

Serverless Kubernetes, released by the Alibaba Cloud Container Service team, has been in the open beta test for a while now. Users don't need to manage servers and can normally perform various Kubernetes API operations, including creating pods, services, ingresses, and jobs. The biggest advantage of Serverless is that it not only avoids the server maintenance burden but also provides applications with powerful elastic scaling. Elasticity is no longer limited to the node scale of clusters. In addition, application billing is based on the resource usage.

Kubernetes Virtual Nodes

We released the virtual-nodes feature to further optimize the Container Service user experience, support more application scenarios and provide extremely powerful elastic scaling for users' Kubernetes clusters.

Related Market products

Using Kubernetes to Manage Containers and Cluster Resources

This course aims to help IT companies who want to container their business applications, and cloud computing engineers or enthusiasts who want to learn container technology and Kubernetes. By learning this course, you can fully understand what Kubernetes is, why we need Kubernetes, the basic architecture of Kubernetes, some core concepts and terms of Kubernetes, and how to build a Kubernetes cluster on the Alibaba cloud platform, so as to provide reference for the evaluation, design and implementation of application containerization.

Related Documentation

Alibaba Cloud Kubernetes vs. self-built Kubernetes

Advantages of Alibaba Cloud Kubernetes

Easy to use

  1. Supports creating a Kubernetes cluster with one click in the Container Service console.
  2. Supports upgrading Kubernetes clusters with one click in the Container Service console.
  3. You may have to deal with self-built Kubernetes clusters of different versions at the same time, including version 1.8.6, 1.9.4, and 1.10 in the future. Upgrading clusters each time brings you great adjustments and Operation & Maintenance (O&M) costs. Container Service upgrade solution performs rolling update by using images and uses the backup policy of complete metadata, which allows you to conveniently roll back to the previous version.
  4. Supports expanding or contracting Kubernetes clusters conveniently in the Container Service console.

Container Service Kubernetes clusters allow you to expand or contract the capacity vertically with one click to respond to the peak of the data analysis business quickly.

Comparison of Kubernetes clusters supported by Container Service for Kubernetes

This topic compares the following types of Kubernetes clusters: Dedicated Kubernetes clusters, Managed Kubernetes clusters, and Serverless Kubernetes clusters.

Container Service for Kubernetes provides high-performance and scalable capabilities for native cloud application management, and enables you to manage the entire lifecycle of enterprise-level containerized applications.

Related Courses

Using Kubernetes to Manage Containers and Cluster Resources

This course aims to help IT companies who want to container their business applications, and cloud computing engineers or enthusiasts who want to learn container technology and Kubernetes. By learning this course, you can fully understand what Kubernetes is, why we need Kubernetes, the basic architecture of Kubernetes, some core concepts and terms of Kubernetes, and how to build a Kubernetes cluster on the Alibaba cloud platform, so as to provide reference for the evaluation, design and implementation of application containerization.

Provisioning a Multi-zone ACK Kubernetes Cluster Using Terraform

This course is associated with Provisioning a Multi-zone ACK Kubernetes Cluster Using Terraform. You must purchase the certification package before you are able to complete all lessons for a certificate.

0 0 0
Share on

Alibaba Clouder

2,599 posts | 763 followers

You may also like

Comments