WordPress is the world’s most popular and stable CMS and it’s built on PHP and uses MySQL as back-end database, while Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
Today, I’ll exploring to combined both great technologies on Alibaba Cloud.
The Alibaba Cloud Container Service lets us run and manage Docker applications on a cluster of Alibaba Cloud ECS instances. It supports the popular open source container orchestrators: Docker Swarm and Kubernetes.
Alibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products. It replaces the need to install, operate and scale your container cluster infrastructure. Being a fully-managed service, Container Service for Kubernetes helps you to focus on your applications rather than managing container infrastructure.
Table of Contents
1. Create an Alibaba Cloud account and also created one or several sub-accounts, and get the corresponding UID.
2. Activated Container Service and created a Kubernetes cluster.
3. Connected to a Kubernetes cluster by using kubectl.
Log on to the Container Service console and allow Container Service to access your cloud resources. Click on the RAM Console and Confirm Authorization Policy.
Now, at the Container Service console, click to create a Kubeenetes Cluster.
Enter a cluster name and select the region and zone to place the Kubernetes cluster.
In this case, I select Auto Create when creating a VPC, the Alibaba Cloud automatically creates a NAT gateway for the VPC as well.
Next, is to configure the master nodes. In this configuration, I selected the instance type of ecs.n1.medium. Currently, Alibaba Cloud Container Services allow to create maximum of three master nodes.
Next, configure the worker nodes. In this configuration, I going to create 3 worker nodes using ecs.n1.medium instance type.
Other configuration, such as creating login credentials, enable SSH, whether or not to automatically create a NAT gateway, etc.
Now, click on Create to confirm your Kubernetes Cluster configuration.
Lastly, review the pricing of various Alibaba Cloud products and services.
During cluster creation, the following operations are performed:
- Create ECS instances, configure the public key SSH login from the management node to other nodes, configure Kubernetes Cluster through Userdata
- Create a security group that allows in-traffic for all ICMP ports in VPC
- A new VPC, VSwitch and a SNAT for the VSwitch will be created
- Create VPC routing rules
- Create NAT gateway and EIP
- Create RAM sub-account and access key, with permissions to query, create and delete ECS instances, permissions to add and delete Cloud Disk, full access to SLB, full access to Cloud Monitoring, full access to VPC, full access to SLS and full access to NAS. The Kubernetes cluster dynamically creates SLBs, Cloud Disks, and VPC routing rules based on user configurations.
- Create intranet SLB and expose port 6443
- Create internet SLB and expose ports 6443 and 22 (Only if you choose to enable Internet SSH access)
After about 15 minutes, a Kubernetes Cluster is created and showing Running state.
You can also click Manage to view the basic information and connection information of this cluster.
Finally, ssh to the master nodes to view the node information of the cluster.
I am happy to share my Alibaba Cloud referral link, if you interested to try out Alibaba Cloud products with $300 free credit.
Now, my Kubernetes cluster of 3 masters and 3 nodes are up and running. In the next post, I’ll see how to deploy WordPress on this ubernetes cluster.