On-Premise Installation

Objectives

  1. Deploy simple master (single) and worker node (single) Kubernetes cluster for demo purposes.
  2. Configure kubectl.
  3. Use Helm to deploy WordPress to a cluster.

Before you get started

To use Kublr, you’ll downloaded and installed Kublr-in-a-Box, which you can download at https://kublr.com/demo/

Prerequisites

System Requirements for the cluster nodes

  1. x86 64-bit hardware
  2. At least 4Gb of RAM for each master node and each worker node.
  3. You’ll need at least a total of 8Gb for your worker nodes if you plan to deploy the full Kublr platform.
  4. Supported OS on nodes: RHEL 7.2+ or Ubuntu 16.04 LTS
  5. Root access to each node.
  6. Nodes are connected in your network and Kublr-in-a-Box configured IP is accessible from these nodes (ping).
  7. From your nodes, firewall rules should allow traffic to Kublr-in-a-Box on ports 9080 / 9443.
  8. 100Mbs stable internet connection.
  9. Kublr-in-a-Box should be correctly configured to be accessible in your local network. That’s why, it is critical that you provide the correct IP address during the virtual machine startup. If you skipped this step, please re-run provisioning and configure your firewall rules to allow traffic to your computer. If you skipped this step, please re-run provisioning and configire your firewall rules to allow traffic to your computer.

Re-provisioning Kublr-in-a-Box

If you would like to install clusters on-premiss, please set the environment variable EXTERNAL_IP with the IP address to access your computer from the network. Usually, it is your computer’s IP address, but it may be different if you use NAT. Example command:

EXTERNAL_IP=192.168.0.1 vagrant up --provision

This will reconfigure Kublr to use a proper DNS/IP address for the installation scripts used on your nodes.

Determine Your Own IP Address

Creating a cluster in your machine’s network is simple. Just use your machine’s IP address for this network. If you don’t know how to get the IP address, contact your system administrator or read your OS manual.

To install Kublr clusters in a different network on complex network topologies, provide an IP address of your machine from that network.

Creating On-Premise cluster in Kublr

  1. Click on Cluster Menu in Left Navigation Menu Bar Cluster Menu
  2. Click on Add Cluster Add New Cluster
  3. Enter Cluster Name Cluster Name
  4. Select Provider: BARE-METAL Bare-metal provider
  5. Select Number of Master Nodes Number of Masters
  6. Enter IP/DNS of Master IP/DNS of Master 1
  7. Select Number of Worker Nodes Work nodes
  8. Click on Confirm and Install button
  9. Page with setup instructions should be opened. Copy the Instruction for Master Node by clicking the button Copy Masters for Bare-metal
  10. Open Terminal and login to the master node machine with ssh:
ssh <user_name>@192.168.31.201

After you login to the machine you might need to change current user to root:

sudo -i

Insert the instruction copied earlier in command line:

curl 'http://192.168.99.106:9080/api/install/5a7a04dc7556e10001193f82/download?nodeGroup=master&nodeOrdinal=0' -o ./kublr-install.sh; chmod a+x ./kublr-install.sh; ./kublr-install.sh

You will see the following message for login Masters setup script

Enter the username and password of the user you are logged into Kublr-in-a-Box Masters setup script

At the end you will see Masters setup script

  1. In Kublr-in-a-Box UI Master Node status should be OK Masters Status
  2. Copy the instructions for Worker Node and do the same as for Master Node Work Nodes script

Open Terminal and login to the worker node ssh:

ssh <user_name>@192.168.31.204

After you login to the machine you might need to change current user to root:

sudo -i

Insert the instruction copied earlier in command line:

curl 'http://192.168.99.106:9080/api/install/5a7a04dc7556e10001193f82/download?nodeGroup=default' -o ./kublr-install.sh; chmod a+x ./kublr-install.sh; ./kublr-install.sh

Enter the username and password of the user you are logged into Kublr and wait until the installation is complete Work Nodes Complete

Go into the Kublr UI and wait until cluster is switched to Running status Bare-metal cluster is Running

kubectl

Install and Configure kubectl

More details can be found here

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

Copy Kublr config file

To retrieve config from Kublr */:

  1. Click on cluster in the cluster list to access the cluster details page
  2. On the overview tab, download the config file Config File
mkdir ~/.kube
cp ~/Downloads/config.yaml ~/.kube/config
kubectl cluster-info

Helm

Install and use Helm to deploy WordPress to your cluster

Install Helm. Click here for detailed guidelines.

curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod +x get_helm.sh
./get_helm.sh --version v2.5.0
helm init

Install WordPress

By default both WordPress and MariaDB requires support for Persistent Volume storage provisioner. Configuration of it goes beyond the scope of the Quickstart, so we install Wordpress with persistence disabled. Also, for on-premise installation we will use Service with Type = NodePort.

Note: Additional configuration parameters for WordPress and MariaDB are available. See documentation at https://github.com/kubernetes/charts/tree/master/stable/wordpress and https://github.com/kubernetes/charts/tree/master/stable/mariadb, respectively.

helm install stable/wordpress --name wordpress --set persistence.enabled=false,serviceType=NodePort,mariadb.persistence.enabled=false
export SERVICE_PORT=$(kubectl get svc --namespace default wordpress-wordpress -o jsonpath='{.spec.ports[?(@.name=="http")].nodePort}')
export SERVICE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
echo http://$SERVICE_IP:$SERVICE_PORT/admin
echo Username: user
echo Password: $(kubectl get secret --namespace default wordpress-wordpress -o jsonpath='{.data.wordpress-password}' | base64 --decode)

Open the browser and navigate to the URL from console output.

Congrats! You just deployed your first app in a Kubernetes cluster with Kublr.


Questions? Suggestions? Need help? Contact us.