Packet

    To perform this installation, you will need a localhost to run Terraform/Ansible (laptop, VM, etc) and an account with Packet.In this example, we’re using an m1.large CentOS 7 OpenStack VM as the localhost to kickoff the Kubernetes installation.You’ll need Ansible, Git, and PIP.

    Playbook SSH Key

    An SSH key is needed by Kubespray/Ansible to run the playbooks.This key is installed into the bare metal hosts during the Terraform deployment.You can generate a key new key or use an existing one.

    Grab the latest version of Terraform and install it.

    1. echo "https://releases.hashicorp.com/terraform/$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')/terraform_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')_darwin_amd64.zip"
    2. sudo yum install unzip

    Download Kubespray

    Pull over Kubespray and setup any required libraries.

    1. cp -LRp contrib/terraform/packet/sample-inventory inventory/alpha
    2. cd inventory/alpha/

    Details about the cluster, such as the name, as well as the authentication tokens and project IDfor Packet need to be defined. To find these values see Packet API Integration

    1. vi cluster.tf
    • cluster_name = alpha
    • packet_project_id = ABCDEFGHIJKLMNOPQRSTUVWXYZ123456
    • public_key_path = 12345678-90AB-CDEF-GHIJ-KLMNOPQRSTUV

    Deploy Bare Metal Hosts

    Initializing Terraform will pull down any necessary plugins/providers.

    1. terraform apply -var-file=cluster.tf ../../contrib/terraform/packet

    With the bare metal infrastructure deployed, Kubespray can now install Kubernetes and setup the cluster.