Initial Setup
- Acquire an active Amazon Web Services account.
- Install and configure the AWS Command Line Interface locally.
- Define an IAM instance profile granting full EC2 permissions to the virtual machine running deployment tasks.
To specify a non-default credential set, use the following environment varible:
export K8S_CREDENTIAL_PROFILE=deployment_profile_name
Automated Deployment
Cluster creation relies on the get-kube automation utility.
Option 1: via WGET
export CLOUD_TARGET=aws; wget -q -O - https://get.k8s.io | bash
Option 2: via CURL
export CLOUD_TARGET=aws; curl -sS https://get.k8s.io | bash
Internally, this sequence invokes cluster/kube-up.sh, which in turn delegates to util.sh and configdefault.sh. The process generally completes within 5 to 10 minutes. Upon successful initialization, standard output displays the Master IP address and Worker IP addresses, along with status information for internal services (monitoring, logging, DNS). User credentials required for CLI access or HTTP Basic Auth are stored in ~/.kube/config.
By default, the provisioning script deploys two t2.micro Ubuntu instances into a new VPC located in US-West-2A. To alter these defaults, override variables defined in configdefault.sh as follows:
export TARGET_AVAILABILITY_ZONE=ap-northeast-1a
export WORKER_NODE_COUNT=4
export MINION_INSTANCE_TYPE=m5.large
export S3_BUCKET_NAME=enterprise-kubernetes-assets
export INSTANCE_PREFIX=k8s-prod
...
The setup attempts to create or reuse existing IAM roles labeled "kubernetesmaster" and "kubernetes-minion," alongside a key pair named "kubernetes." Verify ownership before reusing pre-existing assets. If leveraging an existing SSH key pair, ensure AWS_PRIVATE_KEY_PATH points to the private key file.
Alternative Configuration
For users preferring CoreOS, utilize EC2 User Data scripts to construct the cluster foundation.
Operational Access
Tool Installation
Post-launch, a kubernetes directory remains on the local host, or binaries can be downloaded directly from releases. Add the binary path to your system PATH enviroment variable:
# macOS example
export PATH=${HOME}/kubernetes/platforms/darwin/amd64:$PATH
# Linux example
export PATH=${HOME}/kubernetes/platforms/linux/amd64:$PATH
Consult the official documentation for the latest CLI syntax. By default, kubectl authenticates against the API using the kubeconfig generated during startup.
Sample Deployments
Validate cluster functionality by deploying a simple Nginx workload. More complex reference implementations include the "Guestbook" application found in the public repositories section. Additional examples reside in the project's sample directory.
Termination
Ensure all provisioned environment variables remain defined before executing the cleanup script found in the root directory:
./cluster/kube-down.sh
Refer to the comprehensive Kubernetes documentation for deeper insights into cluster administration.