Creating K8s Cluster¶
Configuring kOps Environment¶
-
Open the Linux shell inside the VM.
-
Set the AWS credentials (AWS access key ID and AWS secret access key) as environment variables:
export AWS_ACCESS_KEY_ID=<your-access-key-id> export AWS_SECRET_ACCESS_KEY=<your-secret-access-key> -
Set the applicable AWS region:
export AWS_DEFAULT_REGION=<your-aws-region>e. g.
export AWS_DEFAULT_REGION=eu-central-1 -
Set the S3 location in AWS for kOps to store the configuration files:
export KOPS_STATE_STORE=s3://<your-s3-location>e. g.
export KOPS_STATE_STORE=s3://kops-clusters.eu1.edge.siemens.cloud
Deploying K8s Cluster¶
-
Use a unique name for the K8s cluster, which must be a valid DNS name and for which you have access to the domain to configure the DNS:
export CLUSTER_NAME=<your-cluster-name.your-DNS>e. g.
export CLUSTER_NAME=cluster-kops.eu1.edge.siemens.cloud -
Create the cluster on AWS (consider the applied AWS region):
kops create cluster --zones eu-central-1a $CLUSTER_NAMEThe K8s cluster will start and should be ready in few minutes.