Setting up a Kubernetes Cluster on AWS

Set up a Kubernetes cluster with AWS for running Hawk Container Edition components.

Procedure

  1. Create an S3 storage to store the cluster configuration and state. You can use either AWS CLI or AWS console to create the storage.
    The sample AWS CLI command for creating S3 storage is:
    aws s3 mb s3://hkce-bucket
    For more information about Amazon Simple Storage Service (Amazon S3), see Amazon S3 Documentation.
  2. Create the Kubernetes cluster on AWS using the following command:
      kops create cluster --zones us-west-2a --master-zones us-west-2a --master-size t2.large --node-size t2.large --name hkcecluster.k8s.local --state
    s3://<s3-bucket-name> --yes
    Where,
    • s3-bucket-name is a name of the s3 bucket created earlier (hkce-bucket).
    • hkcecluster.k8s.local is the name of the cluster being created. Use k8s.local prefix to identify a gossip-based Kubernetes cluster and you can skip the DNS configuration.

    For more information about the kops create cluster command either use the help parameter or see kops Documentation .

  3. Validate your cluster using the validate command.
    kops validate cluster  
    Node and master must be in ready state. The kops utility stores the connection information at ~/.kops/config, and kubectl uses the connection information to connect to the cluster.
  4. If needed, you can delete the cluster using the following command:
    kops delete cluster hkcecluster.k8s.local --state=s3://<s3-bucket-name> --yes