tmc/k8s-terraform-aws-ubuntu

语言: Shell

git: https://github.com/tmc/k8s-terraform-aws-ubuntu

Gubernets的terraform供应是在AWS
terraform provisioning of Kubernetes on AWS
README.md (中文)

Terraforming Gubernets是AWS

状态:上游v1.1.3奇偶校验

这组terraform描述旨在匹配相当标准的AWS部署的结果。

该项目的目标实际上是以下形式:

$ export KUBERNETES_PROVIDER=aws MASTER_RESERVED_IP=auto; curl -sS https://get.k8s.io | bash

我将接受增加HA和其他方面的贡献,但是为了教育目的,我希望保持接近上游。

terraform graph output

先决条件

你应该安装terraform。应正确填充AWS_ACCESS_KEY和AWS_SECRET_ACCESS_KEY环境变量。

您应该带上自己的ssh密钥对,它应该出现在您当前的ssh-agent会话中。

kubectl应该在你的$ PATH上。

用法

克隆此存储库以进行实验。

基本调用由'kube-up'目标控制:

make kube-up

但是这需要输入公钥导入作为新实例的密钥对,因此它将失败:

$ make kube-up
terraform apply -var-file=tokens.tfvars
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * 1 error(s) occurred:

  * Required variable not set: aws_key_pair_pubkey
  make: *** [kube-up] Error 1

提供公钥的内容以便在新集群中使用,如下所示:

$ ssh-keygen -f "~/.ssh/kube_aws_rsa" -N ''
$ export TF_VAR_aws_key_pair_pubkey="$(cat ~/.ssh/kube_aws_rsa.pub)"
$ ssh-add ~/.ssh/kube_aws_rsa
$ make kube-up

参数

有关完整列表,请参阅variables.tf,但有一些有趣的内容如下:

提供自定义Kubernetes版本(当前默认为v1.1.3)

$ TF_VAR_KUBE_VERSION=v1.1.3 make kube-up

提供自定义群集标识符:

$ TF_VAR_CLUSTER_ID=terranetes make kube-up

这将创建一个以'terranetes'作为命名前缀和KubernetesCluster集群名称的集群。

证书

在第一次调用'tokens.tfvars'时会生成一些随机生成的值。保存此文件。

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Terraforming Kubernetes on AWS

Status: upstream v1.1.3 parity

This set of terraform descriptions aims to match the result of a fairly standard AWS deployment.

The goal of this project is effectively a terraform version of:

$ export KUBERNETES_PROVIDER=aws MASTER_RESERVED_IP=auto; curl -sS https://get.k8s.io | bash

I will accept contributions that add HA and other aspects but would like to remain close to upstream for educational purposes.

terraform graph output

Prerequisites

You should have terraform installed. Your AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY environment variables should be populated correctly.

You are expected to bring your own ssh keypair and it should be present in your current ssh-agent session.

kubectl should be on your $PATH.

Usage

Clone this repository to experiment with it.

Basic invocation is controlled by the 'kube-up' target:

make kube-up

But this requires the input of the public key import as a keypair for the new instances so it will fail as such:

$ make kube-up
terraform apply -var-file=tokens.tfvars
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * 1 error(s) occurred:

  * Required variable not set: aws_key_pair_pubkey
  make: *** [kube-up] Error 1

Supply the contents of your public key to use in new cluster like so:

$ ssh-keygen -f "~/.ssh/kube_aws_rsa" -N ''
$ export TF_VAR_aws_key_pair_pubkey="$(cat ~/.ssh/kube_aws_rsa.pub)"
$ ssh-add ~/.ssh/kube_aws_rsa
$ make kube-up

Parameters

See variables.tf for full list but a few interesting ones follow:

Supplying a custom Kubernetes version (currently defaults to v1.1.3)

$ TF_VAR_KUBE_VERSION=v1.1.3 make kube-up

Supplying a custom cluster identifier:

$ TF_VAR_CLUSTER_ID=terranetes make kube-up

This will create a a cluster with 'terranetes' as the naming prefix and KubernetesCluster cluster name.

Credentials

On first invocation 'tokens.tfvars' is generated with some randomly generated values. Save this file.