sacloud-archives / terraform-sakuracloud-kubernetes-single-master

Install single-master Kubernetes cluster
Apache License 2.0
5 stars 1 forks source link

Kubernetes(Single Master)

This module deploys single-master Kubernetes cluster to SAKURA Cloud using kubeadm.

This project is for develop environment, so please do not use this in production

Overview

overview.png

Getting Started

Prerequisites

Customize the deployment

Customizations to the base installation are made to the Terraform variables for each deployment.
Examples of variables are provided in the file examples/kubernetes.tf.

Initialize and configure Terraform

Get Terraform's SAKURA Cloud modules and providers

Get the modules and providers that Terraform will use to create the cluster resources:

$ terraform init

Deploy the cluster

Test the blueprint before deploying:

$ terraform plan

Next, deploy the cluster:

$ terraform apply

This should run for a short time, and when complete, the cluster should be ready.

Access the cluster

Access to nodes with ssh

Nodes credentials are written beneath the certs/ directory. You can use this to access the cluster by ssh.

$ usacloud server ssh -i certs/id_rsa <your-node-name>

Using kubectl

To use kubectl command on the local machine, you need to download the kubeconfig file as follows:

$ usacloud server scp -i certs/id_rsa <your-master-node-name>:/etc/kubernetes/admin.conf ./admin.conf
$ export KUBECONFIG=$(pwd)/admin.conf
$ kubectl cluster-info

License

terraform-sakuracloud-kubernetes-single-master Copyright (C) 2018-2019 Kazumichi Yamamoto.

This project is published under Apache 2.0 License.

Author