Use Kubernetes step by step

Source: Internet
Author: User

Use Kubernetes step by step
Why Docker and Kubernetes?

Containers allow us to build, publish, and run distributed applications. They free applications from machine restrictions and allow us to create a complex application in a certain way.

Writing applications using containers can bring development and QA closer to the production environment (if you try to do so ). By doing so, you can publish changes faster and test the entire system faster.

Docker, a container-based platform, makes a living for this. It can make the software independent from the cloud provider.

However, even if a container is used, the workload required to port an application to any cloud provider (or private cloud) cannot be ignored. Applications usually need automatic scaling groups, persistent remote disks, and automatic discovery. However, each cloud provider has a different mechanism. If you want to use these features, you will soon become dependent on cloud providers.

This is exactly when Kubernetes was launched. It is a container orchestration system that allows you to manage, scale, and deploy different parts of an application according to certain standards and become an important tool. Its Portable abstraction layer is compatible with major Cloud providers (Google Cloud, Amazon Web Services, and Microsoft Azure support Kubernetes ).

Imagine the application, container, and Kubernetes. An application can be regarded as a shark around it and it exists in the ocean (in this example, the ocean is your machine ). There may be other valuable things in the ocean, but you don't want your sharks to be related to clownfish. So you need to move your shark (your application) to a sealed aquarium (container ). This is good, but not very robust. Your aquarium may be broken, or you want to build a channel to connect to another aquarium where other fish lives. Maybe you want many aquariums like this in case you need to clean or maintain them ...... This is the role of the Kubernetes cluster.

Evolved to Kubernetes

Mainstream cloud providers provide Kubernetes support, from the development environment to the production environment, which makes it easier for you and your team to have almost the same environment. This is because Kubernetes does not rely on proprietary software, services, or infrastructure.

In fact, you can use the same parts in the production environment on your machine to start the application, thus narrowing the gap between the development and production environments. This gives developers a better understanding of how applications are built together, although they may only be responsible for part of the application. This also makes it easier for applications in the development process to complete tests quickly.

How to Use Kubernetes to work?

With more people adopting Kubernetes, new problems have emerged. How should we develop a cluster-based environment? Suppose there are three environments: development, quality assurance, and production. How can they adapt to Kubernetes? There are still differences between these environments, whether in the development cycle (for example, taking time to change my code in a running application) or related to data (for example: I should not test the trial production data in my quality assurance environment because it contains sensitive information ).

So should I always code, build images, and redeploy services in the Kubernetes cluster, and recreate deployments and services when I write code? Or should I try my best to make my development environment a Kubernetes cluster (or a group of clusters? Or should I work in hybrid mode?

Use a local cluster for development

If we continue with our previous analogy, the holes on both sides represent a way to modify applications while keeping them in a development cluster. This is usually achieved through volumes.

Kubernetes Series

This Kubernetes series of resources is open source, can be found here: https://github.com/red-gate/ks.

We write this series as exercises for building software in different ways. We try to restrict ourselves from using Kubernetes in all environments so that we can explore the impact of these technologies on data and database development and management.

This series begins to use Kubernetes to create basic React applications and gradually evolves into a series that can meet our more development needs. Finally, we will cover the development needs of all applications and understand how to better cater to containers and clusters in the database lifecycle.

The first five parts of this series are as follows:

  1. Ks1: Use Kubernetes to build a React Application
  2. Ks2: Use minikube to detect React code changes
  3. Ks3: Add a Python Web server that provides APIs
  4. Ks4: enables minikube to detect Python code changes
  5. Ks5: Create a test environment

The second part of this series will add a database and try to find the best way to develop our applications.

By running Kubernetes in various environments, we are forced to maintain the development cycle while solving new problems. We keep trying Kubernetes and get used to it. By doing so, the development team can be responsible for the production environment, which is not difficult because all environments (from development to production) are managed in the same way.

What is next?

We will continue this series by integrating databases and exercises to find the best way to use Kubernetes to get the best experience of the database lifecycle.

This Kubernetes series is provided by Foundry, The Redgate R & D department. We are working to make data and container management easier. If you are processing data and containers, we hope to hear your opinion. Please contact our development team directly.Foundry@red-gate.com

Docker Kubernetes1.8.3 Cluster Environment in CentOS 7.3

Install an entry-level Kubernetes cluster in CentOS 7

Kubernetes1.8.1 Installation Guide, offline installation, Intranet Installation

Build a Kubernetes 1.4 Cluster

Kubeadm build a Kubernetes Cluster

Use kubeadm to build a Kubernetes1.5 cluster on Ubuntu 16.04

Install Kubernetes1.7 DNS

We are hiring. Are you interested in developing products, creating future technologies, and adopting similar entrepreneurial approaches (no risk )? Let's take a look at our software engineer-role in future technology, and read

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.