mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 00:48:45 +01:00
*: cleanup bazel rules
This commit cleans up several Bazel rules to remove mentions of code that was previously in the Track-1 flow of the Tectonic Installer.
This commit is contained in:
30
BUILD.bazel
30
BUILD.bazel
@@ -4,12 +4,6 @@ package(
|
||||
default_visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
template_files = glob([
|
||||
"modules/**/*",
|
||||
"platforms/**/*",
|
||||
"steps/**/*",
|
||||
])
|
||||
|
||||
config_setting(
|
||||
name = "darwin",
|
||||
values = {"cpu": "darwin"},
|
||||
@@ -47,21 +41,6 @@ genrule(
|
||||
|
||||
exports_files(["config.tf"])
|
||||
|
||||
genrule(
|
||||
name = "templates",
|
||||
message = "Copying templates...",
|
||||
output_to_bindir = 1,
|
||||
srcs = template_files,
|
||||
outs = ["templates/%s" % f for f in template_files],
|
||||
cmd = '\n'.join([
|
||||
"for tf_file in $(SRCS); do",
|
||||
"target=\"$(@D)/templates/$$(dirname $${tf_file})\"",
|
||||
"mkdir -p $${target}",
|
||||
"cp $${tf_file} $${target}",
|
||||
"done"
|
||||
]),
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
|
||||
|
||||
go_prefix("github.com/coreos/tectonic-installer")
|
||||
@@ -120,7 +99,7 @@ genrule(
|
||||
pkg_tar(
|
||||
name = "tarball_terraform_configuration",
|
||||
mode = "0644",
|
||||
srcs = glob(["modules/**"]) + glob(["platforms/**"]) + glob(["steps/**"]) + ["config.tf"],
|
||||
srcs = glob(["modules/**"], exclude=["modules/update-payload/**"]) + glob(["steps/**"]) + ["config.tf"],
|
||||
strip_prefix = ".",
|
||||
)
|
||||
|
||||
@@ -166,14 +145,12 @@ pkg_tar(
|
||||
srcs = ["@terraform_provider_matchbox_linux//:terraform-provider-matchbox"],
|
||||
)
|
||||
|
||||
load("//:variables.bzl", "PLATFORMS")
|
||||
|
||||
pkg_tar(
|
||||
name = "tarball_examples",
|
||||
package_dir = "examples",
|
||||
# As long as we are not auto-generating the tectonic cli configuration
|
||||
# examples, make sure to add the manually created once to the tarball.
|
||||
srcs = ["//examples:terraform.tfvars." + p for p in PLATFORMS] + ["//examples:tectonic_cli_configs"],
|
||||
srcs = ["//examples:tectonic_cli_configs"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
@@ -181,9 +158,6 @@ filegroup(
|
||||
srcs = glob(
|
||||
["modules/**/*.tf"],
|
||||
exclude_directories=1,
|
||||
) + glob(
|
||||
["platforms/**/*.tf"],
|
||||
exclude_directories=1,
|
||||
) + glob(
|
||||
["steps/**/*.tf"],
|
||||
exclude_directories=1,
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
load("//:variables.bzl", "PLATFORMS")
|
||||
|
||||
# DOCS is a dict of tuples matching {"name": ("src", "out"), ...}.
|
||||
DOCS = {p: (PLATFORMS[p] + "/variables.tf", "variables/" + p + ".md") for p in PLATFORMS.keys()}
|
||||
DOCS["config"] = ("//:config.tf", "variables/config.md")
|
||||
|
||||
[genrule(
|
||||
name = doc[0],
|
||||
message = "Compiling docs for " + doc[0] + "...",
|
||||
srcs = [doc[1][0]],
|
||||
outs = [doc[1][1]],
|
||||
cmd = "echo '<!-- DO NOT EDIT. THIS FILE IS AUTOMATICALLY GENERATED. -->' > $@ && echo '# Terraform variables' >> $@ && $(location @com_github_segmentio_terraform-docs//:terraform-docs) --no-required markdown $< >> $@",
|
||||
tools = ["@com_github_segmentio_terraform-docs//:terraform-docs"],
|
||||
) for doc in DOCS.items()]
|
||||
@@ -64,7 +64,7 @@ tectonic
|
||||
├── config.tf
|
||||
├── examples
|
||||
├── modules
|
||||
├── platforms
|
||||
├── steps
|
||||
└── tectonic-installer
|
||||
├── darwin
|
||||
│ ├── tectonic
|
||||
@@ -90,7 +90,7 @@ tectonic_1.2.3-beta
|
||||
├── config.tf
|
||||
├── examples
|
||||
├── modules
|
||||
├── platforms
|
||||
├── steps
|
||||
└── tectonic-installer
|
||||
```
|
||||
|
||||
|
||||
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -174,14 +174,6 @@ pipeline {
|
||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'tectonic.tar.gz'
|
||||
}
|
||||
|
||||
withDockerContainer(params.builder_image) {
|
||||
sh """#!/bin/bash -ex
|
||||
mkdir -p \$(dirname $GO_PROJECT) && ln -sf $WORKSPACE $GO_PROJECT
|
||||
|
||||
cd $GO_PROJECT/
|
||||
make structure-check
|
||||
"""
|
||||
}
|
||||
withDockerContainer(tectonicSmokeTestEnvImage) {
|
||||
sh"""#!/bin/bash -ex
|
||||
cd tests/rspec
|
||||
|
||||
214
Makefile
214
Makefile
@@ -1,214 +0,0 @@
|
||||
CLUSTER ?= demo
|
||||
PLATFORM ?= aws
|
||||
TMPDIR ?= /tmp
|
||||
GOOS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||
GOARCH=amd64
|
||||
TOP_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
|
||||
BUILD_DIR = $(TOP_DIR)/build/$(CLUSTER)
|
||||
PLUGIN_DIR = $(BUILD_DIR)/terraform.d/plugins/$(GOOS)_$(GOARCH)
|
||||
INSTALLER_PATH = $(TOP_DIR)/installer/bin/$(shell uname | tr '[:upper:]' '[:lower:]')
|
||||
INSTALLER_BIN = $(INSTALLER_PATH)/installer
|
||||
TF_DOCS := $(shell which terraform-docs 2> /dev/null)
|
||||
TF_EXAMPLES := $(shell which terraform-examples 2> /dev/null)
|
||||
TF_CMD = terraform
|
||||
TEST_COMMAND = /bin/bash -c "bundler exec rspec spec/${TEST}"
|
||||
|
||||
include ./makelib/*.mk
|
||||
|
||||
$(info Using build directory [${BUILD_DIR}])
|
||||
|
||||
.PHONY: all
|
||||
all: $(INSTALLER_BIN) custom-providers
|
||||
|
||||
$(INSTALLER_BIN):
|
||||
$(MAKE) build -C $(TOP_DIR)/installer
|
||||
|
||||
.PHONY: localconfig
|
||||
localconfig:
|
||||
mkdir -p $(BUILD_DIR)
|
||||
cp examples/*$(subst /,-,$(PLATFORM)) $(BUILD_DIR)/terraform.tfvars
|
||||
|
||||
$(PLUGIN_DIR):
|
||||
mkdir -p $(PLUGIN_DIR)
|
||||
ln -s $(INSTALLER_PATH)/terraform-provider-* $(PLUGIN_DIR)
|
||||
|
||||
.PHONY: terraform-init
|
||||
terraform-init: custom-providers $(PLUGIN_DIR)
|
||||
ifneq ($(shell $(TF_CMD) version | grep -E "Terraform v0\.1[0-9]\.[0-9]+"), )
|
||||
cd $(BUILD_DIR) && $(TF_CMD) init $(TF_INIT_OPTIONS) $(TOP_DIR)/platforms/$(PLATFORM)
|
||||
else
|
||||
cd $(BUILD_DIR) && $(TF_CMD) get $(TF_GET_OPTIONS) $(TOP_DIR)/platforms/$(PLATFORM)
|
||||
endif
|
||||
|
||||
.PHONY: plan
|
||||
plan: terraform-init
|
||||
cd $(BUILD_DIR) && $(TF_CMD) plan $(TF_PLAN_OPTIONS) $(TOP_DIR)/platforms/$(PLATFORM)
|
||||
|
||||
.PHONY: apply
|
||||
apply: terraform-init
|
||||
cd $(BUILD_DIR) && $(TF_CMD) apply $(TF_APPLY_OPTIONS) -auto-approve $(TOP_DIR)/platforms/$(PLATFORM)
|
||||
|
||||
.PHONY: destroy
|
||||
destroy: terraform-init
|
||||
cd $(BUILD_DIR) && $(TF_CMD) destroy $(TF_DESTROY_OPTIONS) -force $(TOP_DIR)/platforms/$(PLATFORM)
|
||||
|
||||
define terraform-docs
|
||||
$(if $(TF_DOCS),,$(error terraform-docs revision >= a8b59f8 is required (https://github.com/segmentio/terraform-docs)))
|
||||
|
||||
@echo '<!-- DO NOT EDIT. THIS FILE IS GENERATED BY THE MAKEFILE. -->' > $1
|
||||
@echo '# Terraform variables' >> $1
|
||||
@echo $2 >> $1
|
||||
terraform-docs --no-required markdown $3 $4 $5 $6 >> $1
|
||||
endef
|
||||
|
||||
define terraform-examples
|
||||
$(if $(TF_EXAMPLES),,$(error terraform-examples is required. Execute "go get github.com/coreos/tectonic-installer/contrib/terraform-examples" to install it.))
|
||||
terraform-examples $2 $3 $4 $5 > $1
|
||||
endef
|
||||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
$(call terraform-docs, Documentation/variables/config.md, \
|
||||
'This document gives an overview of variables used in all platforms of the Tectonic SDK.', \
|
||||
config.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/aws.md, \
|
||||
'This document gives an overview of variables used in the AWS platform of the Tectonic SDK.', \
|
||||
platforms/aws/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/govcloud.md, \
|
||||
'This document gives an overview of variables used in the GovCloud AWS platform of the Tectonic SDK.', \
|
||||
platforms/govcloud/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/azure.md, \
|
||||
'This document gives an overview of variables used in the Azure platform of the Tectonic SDK.', \
|
||||
platforms/azure/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/openstack-neutron.md, \
|
||||
'This document gives an overview of variables used in the Openstack/Neutron platform of the Tectonic SDK.', \
|
||||
platforms/openstack/neutron/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/metal.md, \
|
||||
'This document gives an overview of variables used in the bare metal platform of the Tectonic SDK.', \
|
||||
platforms/metal/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/vmware.md, \
|
||||
'This document gives an overview of variables used in the VMware platform of the Tectonic SDK.', \
|
||||
platforms/vmware/variables.tf)
|
||||
|
||||
$(call terraform-docs, Documentation/variables/gcp.md, \
|
||||
'This document gives an overview of variables used in the Google Cloud platform of the Tectonic SDK.', \
|
||||
platforms/gcp/variables.tf)
|
||||
|
||||
.PHONY: examples
|
||||
examples:
|
||||
$(call terraform-examples, examples/terraform.tfvars.aws, \
|
||||
config.tf, \
|
||||
platforms/aws/variables.tf)
|
||||
|
||||
$(call terraform-examples, examples/terraform.tfvars.govcloud, \
|
||||
config.tf, \
|
||||
platforms/govcloud/variables.tf)
|
||||
|
||||
$(call terraform-examples, \
|
||||
examples/terraform.tfvars.azure, \
|
||||
config.tf, \
|
||||
platforms/azure/variables.tf)
|
||||
|
||||
$(call terraform-examples, \
|
||||
examples/terraform.tfvars.openstack-neutron, \
|
||||
config.tf, \
|
||||
platforms/openstack/neutron/variables.tf)
|
||||
|
||||
$(call terraform-examples, \
|
||||
examples/terraform.tfvars.metal, \
|
||||
config.tf, \
|
||||
platforms/metal/variables.tf)
|
||||
|
||||
$(call terraform-examples, \
|
||||
examples/terraform.tfvars.vmware, \
|
||||
config.tf, \
|
||||
platforms/vmware/variables.tf)
|
||||
|
||||
$(call terraform-examples, \
|
||||
examples/terraform.tfvars.gcp, \
|
||||
config.tf, \
|
||||
platforms/gcp/variables.tf)
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
$(MAKE) clean -C $(TOP_DIR)/installer
|
||||
rm -f $(TF_RC)
|
||||
|
||||
# This target is used by the GitHub PR checker to validate canonical syntax on all files.
|
||||
#
|
||||
.PHONY: structure-check
|
||||
structure-check:
|
||||
$(eval FMT_ERR := $(shell terraform fmt -list -write=false .))
|
||||
@if [ "$(FMT_ERR)" != "" ]; then echo "misformatted files (run 'terraform fmt .' to fix):" $(FMT_ERR); exit 1; fi
|
||||
|
||||
@if $(MAKE) docs && ! git diff --exit-code; then echo "outdated docs (run 'make docs' to fix)"; exit 1; fi
|
||||
@if $(MAKE) examples && ! git diff --exit-code; then echo "outdated examples (run 'make examples' to fix)"; exit 1; fi
|
||||
|
||||
SMOKE_SOURCES := $(shell find $(TOP_DIR)/tests/smoke -name '*.go')
|
||||
bin/smoke: $(SMOKE_SOURCES)
|
||||
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test ./tests/smoke/ -c -o bin/smoke
|
||||
|
||||
.PHONY: vendor-smoke
|
||||
vendor-smoke: $(TOP_DIR)/tests/smoke/glide.yaml
|
||||
@cd $(TOP_DIR)/tests/smoke && glide up -v
|
||||
@cd $(TOP_DIR)/tests/smoke && glide-vc --use-lock-file --no-tests --only-code
|
||||
|
||||
.PHONY: e2e-docker-image
|
||||
e2e-docker-image: images/kubernetes-e2e/Dockerfile
|
||||
@export E2E_IMAGE="quay.io/coreos/kube-conformance:$$(grep 'ARG E2E_REF' $< | cut -d '=' -f2 | sed 's/+/_/')"; \
|
||||
echo "Building E2E image $${E2E_IMAGE}"; \
|
||||
docker build -t $${E2E_IMAGE} $(dir $<)
|
||||
|
||||
.PHONY: smoke-test-env-docker-image
|
||||
smoke-test-env-docker-image:
|
||||
docker build -t quay.io/coreos/tectonic-smoke-test-env -f images/tectonic-smoke-test-env/Dockerfile .
|
||||
|
||||
.PHONY: tests/smoke
|
||||
tests/smoke: bin/smoke smoke-test-env-docker-image
|
||||
docker run \
|
||||
--rm \
|
||||
-it \
|
||||
-v "${CURDIR}":"${CURDIR}" \
|
||||
-w "${CURDIR}/tests/rspec" \
|
||||
-v "${TF_VAR_tectonic_license_path}":"${TF_VAR_tectonic_license_path}" \
|
||||
-v "${TF_VAR_tectonic_pull_secret_path}":"${TF_VAR_tectonic_pull_secret_path}" \
|
||||
-v "${HOME}/.ssh:/root/.ssh:ro" \
|
||||
-v "/var/run/docker.sock:/var/run/docker.sock" \
|
||||
-v "${TF_VAR_tectonic_azure_ssh_key}":"${TF_VAR_tectonic_azure_ssh_key}" \
|
||||
-e CLUSTER \
|
||||
-e AWS_ACCESS_KEY_ID \
|
||||
-e AWS_SECRET_ACCESS_KEY \
|
||||
-e ARM_CLIENT_ID \
|
||||
-e ARM_CLIENT_SECRET \
|
||||
-e ARM_ENVIRONMENT \
|
||||
-e ARM_SUBSCRIPTION_ID \
|
||||
-e ARM_TENANT_ID \
|
||||
-e GOOGLE_APPLICATION_CREDENTIALS \
|
||||
-e GOOGLE_CREDENTIALS \
|
||||
-e GOOGLE_CLOUD_KEYFILE_JSON \
|
||||
-e GCLOUD_KEYFILE_JSON \
|
||||
-e GOOGLE_PROJECT \
|
||||
-e TF_VAR_tectonic_gcp_ssh_key \
|
||||
-e TF_VAR_tectonic_aws_region \
|
||||
-e TF_VAR_tectonic_aws_ssh_key \
|
||||
-e TF_VAR_tectonic_azure_location \
|
||||
-e TF_VAR_tectonic_license_path \
|
||||
-e TF_VAR_tectonic_pull_secret_path \
|
||||
-e TF_VAR_tectonic_base_domain \
|
||||
-e TF_VAR_tectonic_admin_email \
|
||||
-e TF_VAR_tectonic_admin_password \
|
||||
-e TECTONIC_TESTS_DONT_CLEAN_UP \
|
||||
-e RUN_SMOKE_TESTS \
|
||||
-e RUN_CONFORMANCE_TESTS \
|
||||
-e KUBE_CONFORMANCE_IMAGE \
|
||||
-e COMPONENT_TEST_IMAGES \
|
||||
--cap-add NET_ADMIN \
|
||||
--device /dev/net/tun \
|
||||
quay.io/coreos/tectonic-smoke-test-env \
|
||||
$(TEST_COMMAND)
|
||||
19
WORKSPACE
19
WORKSPACE
@@ -54,22 +54,3 @@ visibility = ["//visibility:public"]
|
||||
strip_prefix = "terraform-provider-matchbox-v%s-%s-amd64/" % (provider_matchbox_version, platform),
|
||||
url = "https://github.com/coreos/terraform-provider-matchbox/releases/download/v%s/terraform-provider-matchbox-v%s-%s-amd64.tar.gz" % (provider_matchbox_version, provider_matchbox_version, platform),
|
||||
) for platform in supported_platforms]
|
||||
|
||||
# Import Go dependencies.
|
||||
go_repository(
|
||||
name = "com_github_hashicorp_hcl",
|
||||
importpath = "github.com/hashicorp/hcl",
|
||||
commit = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_segmentio_terraform-docs",
|
||||
importpath = "github.com/segmentio/terraform-docs",
|
||||
tag = "v0.3.0",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_tj_docopt",
|
||||
importpath = "github.com/tj/docopt",
|
||||
tag = "v1.0.0",
|
||||
)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# gazelle:ignore
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["main.go"],
|
||||
importpath = "github.com/coreos/tectonic-installer/contrib/terraform-examples",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"@com_github_hashicorp_hcl//:go_default_library",
|
||||
"@com_github_hashicorp_hcl//hcl/ast:go_default_library",
|
||||
"@com_github_hashicorp_hcl//hcl/token:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "terraform-examples",
|
||||
embed = [":go_default_library"],
|
||||
importpath = "github.com/coreos/tectonic-installer/contrib/terraform-examples",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
@@ -1,3 +0,0 @@
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/hashicorp/hcl"
|
||||
@@ -1,8 +0,0 @@
|
||||
## terraform-examples
|
||||
|
||||
This is a very simple (and most probably incomplete) tool to generate example terraform.tfvars from files or stdin with variable declarations.
|
||||
|
||||
Usage:
|
||||
```
|
||||
$ usage: terraform-example [-|<FILE>...]
|
||||
```
|
||||
@@ -1,213 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/hcl"
|
||||
"github.com/hashicorp/hcl/hcl/ast"
|
||||
"github.com/hashicorp/hcl/hcl/token"
|
||||
)
|
||||
|
||||
type Variable struct {
|
||||
Name string
|
||||
Description string
|
||||
Default string
|
||||
}
|
||||
|
||||
type Index struct {
|
||||
Variables []Variable
|
||||
}
|
||||
|
||||
type ByName []Variable
|
||||
|
||||
func (s ByName) Len() int { return len(s) }
|
||||
func (s ByName) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s ByName) Less(i, j int) bool { return s[i].Name < s[j].Name }
|
||||
|
||||
type stateFunc func(n ast.Node, v *Variable) stateFunc
|
||||
|
||||
func newIndex(c []byte) (*Index, error) {
|
||||
file, err := hcl.ParseBytes(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
v := &Variable{}
|
||||
idx := &Index{}
|
||||
state := idx.content
|
||||
|
||||
ast.Walk(file.Node, func(n ast.Node) (ast.Node, bool) {
|
||||
state = state(n, v)
|
||||
return n, true
|
||||
})
|
||||
|
||||
idx.Variables = append(idx.Variables, *v)
|
||||
idx.Variables = idx.Variables[1:]
|
||||
|
||||
return idx, nil
|
||||
}
|
||||
|
||||
func (i *Index) content(n ast.Node, v *Variable) stateFunc {
|
||||
key, ok := n.(*ast.ObjectKey)
|
||||
if !ok {
|
||||
return i.content
|
||||
}
|
||||
|
||||
if key.Token.Type != token.IDENT {
|
||||
return i.content
|
||||
}
|
||||
|
||||
switch key.Token.Text {
|
||||
case "default":
|
||||
return i.defaultValue
|
||||
case "description":
|
||||
return i.description
|
||||
case "variable":
|
||||
i.Variables = append(i.Variables, *v)
|
||||
*v = Variable{}
|
||||
return i.variableName
|
||||
}
|
||||
|
||||
return i.content
|
||||
}
|
||||
|
||||
func (i *Index) variableName(n ast.Node, v *Variable) stateFunc {
|
||||
key, ok := n.(*ast.ObjectKey)
|
||||
if !ok {
|
||||
return i.variableName
|
||||
}
|
||||
|
||||
if key.Token.Type != token.STRING {
|
||||
return i.variableName
|
||||
}
|
||||
|
||||
v.Name = key.Token.Text
|
||||
|
||||
return i.content
|
||||
}
|
||||
|
||||
func (i *Index) defaultValue(n ast.Node, v *Variable) stateFunc {
|
||||
if _, ok := n.(*ast.ListType); ok {
|
||||
return i.content
|
||||
}
|
||||
|
||||
if _, ok := n.(*ast.ObjectType); ok {
|
||||
return i.content
|
||||
}
|
||||
|
||||
key, ok := n.(*ast.LiteralType)
|
||||
if !ok {
|
||||
return i.defaultValue
|
||||
}
|
||||
|
||||
switch key.Token.Type {
|
||||
case token.BOOL:
|
||||
v.Default = key.Token.Text
|
||||
return i.content
|
||||
case token.STRING:
|
||||
v.Default = key.Token.Text
|
||||
return i.content
|
||||
}
|
||||
|
||||
return i.defaultValue
|
||||
}
|
||||
|
||||
func (i *Index) description(n ast.Node, v *Variable) stateFunc {
|
||||
key, ok := n.(*ast.LiteralType)
|
||||
if !ok {
|
||||
return i.description
|
||||
}
|
||||
|
||||
switch key.Token.Type {
|
||||
case token.HEREDOC:
|
||||
v.Description = key.Token.Value().(string)
|
||||
return i.content
|
||||
case token.STRING:
|
||||
v.Description = key.Token.Value().(string)
|
||||
return i.content
|
||||
}
|
||||
|
||||
return i.description
|
||||
}
|
||||
|
||||
func contents(args []string) ([]byte, error) {
|
||||
if args[0] == "-" {
|
||||
if len(args) > 1 {
|
||||
return nil, errors.New("invalid stdin qualifier: multiple files provided")
|
||||
}
|
||||
|
||||
return ioutil.ReadAll(os.Stdin)
|
||||
}
|
||||
|
||||
var contents []byte
|
||||
|
||||
for _, path := range flag.Args() {
|
||||
c, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
contents = append(contents, c...)
|
||||
contents = append(contents, []byte("\n")...)
|
||||
}
|
||||
|
||||
return contents, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "usage: terraform-example [-|<FILE>...]\n")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
flag.Parse()
|
||||
|
||||
if len(flag.Args()) == 0 {
|
||||
flag.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var c []byte
|
||||
c, err := contents(flag.Args())
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
idx, err := newIndex(c)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
sort.Sort(ByName(idx.Variables))
|
||||
|
||||
for _, v := range idx.Variables {
|
||||
if strings.HasPrefix(v.Description, "(internal)") {
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("\n")
|
||||
|
||||
v.Name = strings.Trim(v.Name, `"`)
|
||||
|
||||
if strings.HasPrefix(v.Description, "(optional)") {
|
||||
v.Name = `// ` + v.Name
|
||||
}
|
||||
|
||||
for _, l := range strings.Split(strings.TrimSpace(v.Description), "\n") {
|
||||
fmt.Printf("// %s\n", l)
|
||||
}
|
||||
|
||||
if v.Default == "" {
|
||||
fmt.Printf("%s = \"\"\n", v.Name)
|
||||
} else {
|
||||
fmt.Printf("%s = %s\n", v.Name, v.Default)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,3 @@
|
||||
load("//:variables.bzl", "PLATFORMS")
|
||||
|
||||
# EXAMPLES is a dict of tuples matching {"name": ("src", "out"), ...}.
|
||||
EXAMPLES = {p: (PLATFORMS[p] + "/variables.tf", "terraform.tfvars." + p) for p in PLATFORMS.keys()}
|
||||
|
||||
[genrule(
|
||||
name = example[0],
|
||||
message = "Compiling examples for " + example[0] + "...",
|
||||
srcs = ["//:config.tf", example[1][0]],
|
||||
outs = [example[1][1]],
|
||||
cmd = "$(location //contrib/terraform-examples:terraform-examples) $(SRCS) > $@",
|
||||
tools = ["//contrib/terraform-examples:terraform-examples"],
|
||||
visibility = ["//visibility:public"],
|
||||
) for example in EXAMPLES.items()]
|
||||
|
||||
filegroup(
|
||||
name= "tectonic_cli_configs",
|
||||
srcs = glob(["tectonic.*.yaml"]),
|
||||
|
||||
@@ -1,342 +0,0 @@
|
||||
|
||||
// (optional) Extra AWS tags to be applied to created autoscaling group resources.
|
||||
// This is a list of maps having the keys `key`, `value` and `propagate_at_launch`.
|
||||
//
|
||||
// Example: `[ { key = "foo", value = "bar", propagate_at_launch = true } ]`
|
||||
// tectonic_autoscaling_group_extra_tags = ""
|
||||
|
||||
// (optional) Unique name under which the Amazon S3 bucket will be created. Bucket name must start with a lower case name and is limited to 63 characters.
|
||||
// The Tectonic Installer uses the bucket to store tectonic assets and kubeconfig.
|
||||
// If name is not provided the installer will construct the name using "tectonic_cluster_name", current AWS region and "tectonic_base_domain"
|
||||
// tectonic_aws_assets_s3_bucket_name = ""
|
||||
|
||||
// (optional) AMI override for all nodes. Example: `ami-foobar123`.
|
||||
// tectonic_aws_ec2_ami_override = ""
|
||||
|
||||
// Instance size for the etcd node(s). Example: `t2.medium`. Read the [etcd recommended hardware](https://coreos.com/etcd/docs/latest/op-guide/hardware.html) guide for best performance
|
||||
tectonic_aws_etcd_ec2_type = "t2.medium"
|
||||
|
||||
// (optional) List of additional security group IDs for etcd nodes.
|
||||
//
|
||||
// Example: `["sg-51530134", "sg-b253d7cc"]`
|
||||
// tectonic_aws_etcd_extra_sg_ids = ""
|
||||
|
||||
// (optional) Name of IAM role to use for the instance profiles of etcd nodes.
|
||||
// The name is also the last part of a role's ARN.
|
||||
//
|
||||
// Example:
|
||||
// * Role ARN = arn:aws:iam::123456789012:role/tectonic-installer
|
||||
// * Role Name = tectonic-installer
|
||||
// tectonic_aws_etcd_iam_role_name = ""
|
||||
|
||||
// The amount of provisioned IOPS for the root block device of etcd nodes.
|
||||
// Ignored if the volume type is not io1.
|
||||
tectonic_aws_etcd_root_volume_iops = "100"
|
||||
|
||||
// The size of the volume in gigabytes for the root block device of etcd nodes.
|
||||
tectonic_aws_etcd_root_volume_size = "30"
|
||||
|
||||
// The type of volume for the root block device of etcd nodes.
|
||||
tectonic_aws_etcd_root_volume_type = "gp2"
|
||||
|
||||
// (optional) List of subnet IDs within an existing VPC to deploy master nodes into.
|
||||
// Required to use an existing VPC and the list must match the AZ count.
|
||||
//
|
||||
// Example: `["subnet-111111", "subnet-222222", "subnet-333333"]`
|
||||
// tectonic_aws_external_master_subnet_ids = ""
|
||||
|
||||
// (optional) If set, the given Route53 zone ID will be used as the internal (private) zone.
|
||||
// This zone will be used to create etcd DNS records as well as internal API and internal Ingress records.
|
||||
// If set, no additional private zone will be created.
|
||||
//
|
||||
// Example: `"Z1ILINNUJGTAO1"`
|
||||
// tectonic_aws_external_private_zone = ""
|
||||
|
||||
// (optional) ID of an existing VPC to launch nodes into.
|
||||
// If unset a new VPC is created.
|
||||
//
|
||||
// Example: `vpc-123456`
|
||||
// tectonic_aws_external_vpc_id = ""
|
||||
|
||||
// (optional) List of subnet IDs within an existing VPC to deploy worker nodes into.
|
||||
// Required to use an existing VPC and the list must match the AZ count.
|
||||
//
|
||||
// Example: `["subnet-111111", "subnet-222222", "subnet-333333"]`
|
||||
// tectonic_aws_external_worker_subnet_ids = ""
|
||||
|
||||
// (optional) Extra AWS tags to be applied to created resources.
|
||||
//
|
||||
// Example: `{ "key" = "value", "foo" = "bar" }`
|
||||
// tectonic_aws_extra_tags = ""
|
||||
|
||||
// (optional) Name of IAM role to use to access AWS in order to deploy the Tectonic Cluster.
|
||||
// The name is also the full role's ARN.
|
||||
//
|
||||
// Example:
|
||||
// * Role ARN = arn:aws:iam::123456789012:role/tectonic-installer
|
||||
// tectonic_aws_installer_role = ""
|
||||
|
||||
// (optional) This configures master availability zones and their corresponding subnet CIDRs directly.
|
||||
//
|
||||
// Example:
|
||||
// `{ eu-west-1a = "10.0.0.0/20", eu-west-1b = "10.0.16.0/20" }`
|
||||
// tectonic_aws_master_custom_subnets = ""
|
||||
|
||||
// Instance size for the master node(s). Example: `t2.medium`.
|
||||
tectonic_aws_master_ec2_type = "t2.medium"
|
||||
|
||||
// (optional) List of additional security group IDs for master nodes.
|
||||
//
|
||||
// Example: `["sg-51530134", "sg-b253d7cc"]`
|
||||
// tectonic_aws_master_extra_sg_ids = ""
|
||||
|
||||
// (optional) Name of IAM role to use for the instance profiles of master nodes.
|
||||
// The name is also the last part of a role's ARN.
|
||||
//
|
||||
// Example:
|
||||
// * Role ARN = arn:aws:iam::123456789012:role/tectonic-installer
|
||||
// * Role Name = tectonic-installer
|
||||
// tectonic_aws_master_iam_role_name = ""
|
||||
|
||||
// The amount of provisioned IOPS for the root block device of master nodes.
|
||||
// Ignored if the volume type is not io1.
|
||||
tectonic_aws_master_root_volume_iops = "100"
|
||||
|
||||
// The size of the volume in gigabytes for the root block device of master nodes.
|
||||
tectonic_aws_master_root_volume_size = "30"
|
||||
|
||||
// The type of volume for the root block device of master nodes.
|
||||
tectonic_aws_master_root_volume_type = "gp2"
|
||||
|
||||
// (optional) If set to true, create private-facing ingress resources (ELB, A-records).
|
||||
// If set to false, no private-facing ingress resources will be provisioned and all DNS records will be created in the public Route53 zone.
|
||||
// tectonic_aws_private_endpoints = true
|
||||
|
||||
// (optional) This declares the AWS credentials profile to use.
|
||||
// tectonic_aws_profile = "default"
|
||||
|
||||
// (optional) If set to true, create public-facing ingress resources (ELB, A-records).
|
||||
// If set to false, no public-facing ingress resources will be created.
|
||||
// tectonic_aws_public_endpoints = true
|
||||
|
||||
// The target AWS region for the cluster.
|
||||
tectonic_aws_region = "eu-west-1"
|
||||
|
||||
// Name of an SSH key located within the AWS region. Example: coreos-user.
|
||||
tectonic_aws_ssh_key = ""
|
||||
|
||||
// Block of IP addresses used by the VPC.
|
||||
// This should not overlap with any other networks, such as a private datacenter connected via Direct Connect.
|
||||
tectonic_aws_vpc_cidr_block = "10.0.0.0/16"
|
||||
|
||||
// (optional) This configures worker availability zones and their corresponding subnet CIDRs directly.
|
||||
//
|
||||
// Example: `{ eu-west-1a = "10.0.64.0/20", eu-west-1b = "10.0.80.0/20" }`
|
||||
// tectonic_aws_worker_custom_subnets = ""
|
||||
|
||||
// Instance size for the worker node(s). Example: `t2.medium`.
|
||||
tectonic_aws_worker_ec2_type = "t2.medium"
|
||||
|
||||
// (optional) List of additional security group IDs for worker nodes.
|
||||
//
|
||||
// Example: `["sg-51530134", "sg-b253d7cc"]`
|
||||
// tectonic_aws_worker_extra_sg_ids = ""
|
||||
|
||||
// (optional) Name of IAM role to use for the instance profiles of worker nodes.
|
||||
// The name is also the last part of a role's ARN.
|
||||
//
|
||||
// Example:
|
||||
// * Role ARN = arn:aws:iam::123456789012:role/tectonic-installer
|
||||
// * Role Name = tectonic-installer
|
||||
// tectonic_aws_worker_iam_role_name = ""
|
||||
|
||||
// (optional) List of ELBs to attach all worker instances to.
|
||||
// This is useful for exposing NodePort services via load-balancers managed separately from the cluster.
|
||||
//
|
||||
// Example:
|
||||
// * `["ingress-nginx"]`
|
||||
// tectonic_aws_worker_load_balancers = ""
|
||||
|
||||
// The amount of provisioned IOPS for the root block device of worker nodes.
|
||||
// Ignored if the volume type is not io1.
|
||||
tectonic_aws_worker_root_volume_iops = "100"
|
||||
|
||||
// The size of the volume in gigabytes for the root block device of worker nodes.
|
||||
tectonic_aws_worker_root_volume_size = "30"
|
||||
|
||||
// The type of volume for the root block device of worker nodes.
|
||||
tectonic_aws_worker_root_volume_type = "gp2"
|
||||
|
||||
// The base DNS domain of the cluster. It must NOT contain a trailing period. Some
|
||||
// DNS providers will automatically add this if necessary.
|
||||
//
|
||||
// Example: `openstack.dev.coreos.systems`.
|
||||
//
|
||||
// Note: This field MUST be set manually prior to creating the cluster.
|
||||
// This applies only to cloud platforms.
|
||||
//
|
||||
// [Azure-specific NOTE]
|
||||
// To use Azure-provided DNS, `tectonic_base_domain` should be set to `""`
|
||||
// If using DNS records, ensure that `tectonic_base_domain` is set to a properly configured external DNS zone.
|
||||
// Instructions for configuring delegated domains for Azure DNS can be found here: https://docs.microsoft.com/en-us/azure/dns/dns-delegate-domain-azure-dns
|
||||
tectonic_base_domain = ""
|
||||
|
||||
// (optional) The content of the PEM-encoded CA certificate, used to generate Tectonic Console's server certificate.
|
||||
// If left blank, a CA certificate will be automatically generated.
|
||||
// tectonic_ca_cert = ""
|
||||
|
||||
// (optional) The content of the PEM-encoded CA key, used to generate Tectonic Console's server certificate.
|
||||
// This field is mandatory if `tectonic_ca_cert` is set.
|
||||
// tectonic_ca_key = ""
|
||||
|
||||
// (optional) The algorithm used to generate tectonic_ca_key.
|
||||
// The default value is currently recommended.
|
||||
// This field is mandatory if `tectonic_ca_cert` is set.
|
||||
// tectonic_ca_key_alg = "RSA"
|
||||
|
||||
// (optional) This declares the IP range to assign Kubernetes pod IPs in CIDR notation.
|
||||
// tectonic_cluster_cidr = "10.2.0.0/16"
|
||||
|
||||
// The name of the cluster.
|
||||
// If used in a cloud-environment, this will be prepended to `tectonic_base_domain` resulting in the URL to the Tectonic console.
|
||||
//
|
||||
// Note: This field MUST be set manually prior to creating the cluster.
|
||||
// Warning: Special characters in the name like '.' may cause errors on OpenStack platforms due to resource name constraints.
|
||||
tectonic_cluster_name = ""
|
||||
|
||||
// (optional) The Container Linux update channel.
|
||||
//
|
||||
// Examples: `stable`, `beta`, `alpha`
|
||||
// tectonic_container_linux_channel = "stable"
|
||||
|
||||
// The Container Linux version to use. Set to `latest` to select the latest available version for the selected update channel.
|
||||
//
|
||||
// Examples: `latest`, `1465.6.0`
|
||||
tectonic_container_linux_version = "latest"
|
||||
|
||||
// (optional) A list of PEM encoded CA files that will be installed in /etc/ssl/certs on etcd, master, and worker nodes.
|
||||
// tectonic_custom_ca_pem_list = ""
|
||||
|
||||
// (optional) This only applies if you use the modules/dns/ddns module.
|
||||
//
|
||||
// Specifies the RFC2136 Dynamic DNS server key algorithm.
|
||||
// tectonic_ddns_key_algorithm = ""
|
||||
|
||||
// (optional) This only applies if you use the modules/dns/ddns module.
|
||||
//
|
||||
// Specifies the RFC2136 Dynamic DNS server key name.
|
||||
// tectonic_ddns_key_name = ""
|
||||
|
||||
// (optional) This only applies if you use the modules/dns/ddns module.
|
||||
//
|
||||
// Specifies the RFC2136 Dynamic DNS server key secret.
|
||||
// tectonic_ddns_key_secret = ""
|
||||
|
||||
// (optional) This only applies if you use the modules/dns/ddns module.
|
||||
//
|
||||
// Specifies the RFC2136 Dynamic DNS server IP/host to register IP addresses to.
|
||||
// tectonic_ddns_server = ""
|
||||
|
||||
// (optional) DNS prefix used to construct the console and API server endpoints.
|
||||
// tectonic_dns_name = ""
|
||||
|
||||
// (optional) Enable boot diagnostics for example the boot logs.
|
||||
// It is only supported for Azure cloud provider.
|
||||
// Used to collect the boot logs for debug purposes.
|
||||
// tectonic_enable_boot_diagnostics = "false"
|
||||
|
||||
// (optional) The path of the file containing the CA certificate for TLS communication with etcd.
|
||||
//
|
||||
// Note: This works only when used in conjunction with an external etcd cluster.
|
||||
// If set, the variable `tectonic_etcd_servers` must also be set.
|
||||
// tectonic_etcd_ca_cert_path = "/dev/null"
|
||||
|
||||
// (optional) The path of the file containing the client certificate for TLS communication with etcd.
|
||||
//
|
||||
// Note: This works only when used in conjunction with an external etcd cluster.
|
||||
// If set, the variables `tectonic_etcd_servers`, `tectonic_etcd_ca_cert_path`, and `tectonic_etcd_client_key_path` must also be set.
|
||||
// tectonic_etcd_client_cert_path = "/dev/null"
|
||||
|
||||
// (optional) The path of the file containing the client key for TLS communication with etcd.
|
||||
//
|
||||
// Note: This works only when used in conjunction with an external etcd cluster.
|
||||
// If set, the variables `tectonic_etcd_servers`, `tectonic_etcd_ca_cert_path`, and `tectonic_etcd_client_cert_path` must also be set.
|
||||
// tectonic_etcd_client_key_path = "/dev/null"
|
||||
|
||||
// The number of etcd nodes to be created.
|
||||
// If set to zero, the count of etcd nodes will be determined automatically.
|
||||
//
|
||||
// Note: This is not supported on bare metal.
|
||||
tectonic_etcd_count = "0"
|
||||
|
||||
// (optional) List of external etcd v3 servers to connect with (hostnames/IPs only).
|
||||
// Needs to be set if using an external etcd cluster.
|
||||
// Note: If this variable is defined, the installer will not create self-signed certs.
|
||||
// To provide a CA certificate to trust the etcd servers, set "tectonic_etcd_ca_cert_path".
|
||||
//
|
||||
// Example: `["etcd1", "etcd2", "etcd3"]`
|
||||
// tectonic_etcd_servers = ""
|
||||
|
||||
// (optional) HTTP proxy address.
|
||||
//
|
||||
// Example: `http://myproxy.example.com`
|
||||
// tectonic_http_proxy_address = ""
|
||||
|
||||
// (optional) HTTPS proxy address.
|
||||
//
|
||||
// Example: `http://myproxy.example.com`
|
||||
// tectonic_https_proxy_address = ""
|
||||
|
||||
// (optional) Start iscsid.service to enable iscsi volume attachment.
|
||||
// tectonic_iscsi_enabled = "false"
|
||||
|
||||
// The path to the tectonic licence file.
|
||||
// You can download the Tectonic license file from your Account overview page at [1].
|
||||
//
|
||||
// [1] https://account.coreos.com/overview
|
||||
tectonic_license_path = ""
|
||||
|
||||
// The number of master nodes to be created.
|
||||
// This applies only to cloud platforms.
|
||||
tectonic_master_count = "1"
|
||||
|
||||
// (optional) Configures the network to be used in Tectonic. One of the following values can be used:
|
||||
//
|
||||
// - "flannel": enables overlay networking only. This is implemented by flannel using VXLAN.
|
||||
//
|
||||
// - "canal": enables overlay networking including network policy. Overlay is implemented by flannel using VXLAN. Network policy is implemented by Calico.
|
||||
//
|
||||
// - "calico-ipip": [ALPHA] enables BGP based networking. Routing and network policy is implemented by Calico. Note this has been tested on baremetal installations only.
|
||||
//
|
||||
// - "none": disables the installation of any Pod level networking layer provided by Tectonic. By setting this value, users are expected to deploy their own solution to enable network connectivity for Pods and Services.
|
||||
// tectonic_networking = "canal"
|
||||
|
||||
// (optional) List of local endpoints that will not use HTTP proxy.
|
||||
//
|
||||
// Example: `["127.0.0.1","localhost",".example.com","10.3.0.1"]`
|
||||
// tectonic_no_proxy = ""
|
||||
|
||||
// The path the pull secret file in JSON format.
|
||||
// This is known to be a "Docker pull secret" as produced by the docker login [1] command.
|
||||
// A sample JSON content is shown in [2].
|
||||
// You can download the pull secret from your Account overview page at [3].
|
||||
//
|
||||
// [1] https://docs.docker.com/engine/reference/commandline/login/
|
||||
//
|
||||
// [2] https://coreos.com/os/docs/latest/registry-authentication.html#manual-registry-auth-setup
|
||||
//
|
||||
// [3] https://account.coreos.com/overview
|
||||
tectonic_pull_secret_path = ""
|
||||
|
||||
// (optional) This declares the IP range to assign Kubernetes service cluster IPs in CIDR notation.
|
||||
// The maximum size of this IP range is /12
|
||||
// tectonic_service_cidr = "10.3.0.0/16"
|
||||
|
||||
// Validity period of the self-signed certificates (in hours).
|
||||
// Default is 3 years.
|
||||
// This setting is ignored if user provided certificates are used.
|
||||
tectonic_tls_validity_period = "26280"
|
||||
|
||||
// The number of worker nodes to be created.
|
||||
// This applies only to cloud platforms.
|
||||
tectonic_worker_count = "3"
|
||||
@@ -1,12 +0,0 @@
|
||||
PROVIDER_MATCHBOX_VERSION = v0.2.2
|
||||
|
||||
.PHONY:
|
||||
custom-providers: $(INSTALLER_PATH)/terraform-provider-matchbox
|
||||
|
||||
$(INSTALLER_PATH)/terraform-provider-matchbox:
|
||||
curl -L -o $(TMPDIR)/terraform-provider-matchbox-$(PROVIDER_MATCHBOX_VERSION)-$(GOOS)-$(GOARCH).tar.gz \
|
||||
https://github.com/coreos/terraform-provider-matchbox/releases/download/$(PROVIDER_MATCHBOX_VERSION)/terraform-provider-matchbox-$(PROVIDER_MATCHBOX_VERSION)-$(GOOS)-$(GOARCH).tar.gz
|
||||
cd $(TMPDIR) && tar xvf terraform-provider-matchbox-$(PROVIDER_MATCHBOX_VERSION)-$(GOOS)-$(GOARCH).tar.gz
|
||||
mkdir -p $(INSTALLER_PATH)
|
||||
cp $(TMPDIR)/terraform-provider-matchbox-$(PROVIDER_MATCHBOX_VERSION)-$(GOOS)-$(GOARCH)/terraform-provider-matchbox $(INSTALLER_PATH)/
|
||||
rm -rf $(TMPDIR)/terraform-provider-matchbox-$(PROVIDER_MATCHBOX_VERSION)-$(GOOS)-$(GOARCH)*
|
||||
@@ -1,188 +0,0 @@
|
||||
# Kubelet tls bootstraping id and secret
|
||||
resource "random_string" "kubelet_bootstrap_token_id" {
|
||||
length = 6
|
||||
special = false
|
||||
upper = false
|
||||
}
|
||||
|
||||
resource "random_string" "kubelet_bootstrap_token_secret" {
|
||||
length = 16
|
||||
special = false
|
||||
upper = false
|
||||
}
|
||||
|
||||
# Self-hosted manifests (resources/generated/manifests/)
|
||||
resource "template_dir" "bootkube" {
|
||||
source_dir = "${path.module}/resources/manifests"
|
||||
destination_dir = "./generated/manifests"
|
||||
|
||||
vars {
|
||||
tectonic_network_operator_image = "${var.container_images["tectonic_network_operator"]}"
|
||||
tnc_bootstrap_image = "${var.container_images["tnc_bootstrap"]}"
|
||||
|
||||
kco_config = "${indent(4, chomp(data.template_file.kco-config_yaml.rendered))}"
|
||||
|
||||
calico_mtu = "${var.calico_mtu}"
|
||||
cloud_provider_config = "${var.cloud_provider_config}"
|
||||
cluster_cidr = "${var.cluster_cidr}"
|
||||
tectonic_networking = "${var.tectonic_networking}"
|
||||
|
||||
root_ca_cert = "${base64encode(var.root_ca_cert_pem)}"
|
||||
aggregator_ca_cert = "${base64encode(var.aggregator_ca_cert_pem)}"
|
||||
kube_ca_cert = "${base64encode(var.kube_ca_cert_pem)}"
|
||||
kube_ca_key = "${base64encode(var.kube_ca_key_pem)}"
|
||||
kubelet_bootstrap_token_id = "${random_string.kubelet_bootstrap_token_id.result}"
|
||||
kubelet_bootstrap_token_secret = "${random_string.kubelet_bootstrap_token_secret.result}"
|
||||
apiserver_key = "${base64encode(var.apiserver_key_pem)}"
|
||||
apiserver_cert = "${base64encode(var.apiserver_cert_pem)}"
|
||||
apiserver_proxy_key = "${base64encode(var.apiserver_proxy_key_pem)}"
|
||||
apiserver_proxy_cert = "${base64encode(var.apiserver_proxy_cert_pem)}"
|
||||
oidc_ca_cert = "${base64encode(var.oidc_ca_cert)}"
|
||||
pull_secret = "${base64encode(file(var.pull_secret_path))}"
|
||||
serviceaccount_pub = "${base64encode(tls_private_key.service_account.public_key_pem)}"
|
||||
serviceaccount_key = "${base64encode(tls_private_key.service_account.private_key_pem)}"
|
||||
kube_dns_service_ip = "${cidrhost(var.service_cidr, 10)}"
|
||||
|
||||
etcd_ca_cert = "${base64encode(var.etcd_ca_cert_pem)}"
|
||||
etcd_client_cert = "${base64encode(var.etcd_client_cert_pem)}"
|
||||
etcd_client_key = "${base64encode(var.etcd_client_key_pem)}"
|
||||
|
||||
tnc_config = "${indent(4, chomp(data.template_file.tnc_config.rendered))}"
|
||||
}
|
||||
}
|
||||
|
||||
# kubeconfig (resources/generated/auth/kubeconfig)
|
||||
data "template_file" "kubeconfig" {
|
||||
template = "${file("${path.module}/resources/kubeconfig")}"
|
||||
|
||||
vars {
|
||||
root_ca_cert = "${base64encode(var.root_ca_cert_pem)}"
|
||||
admin_cert = "${base64encode(var.admin_cert_pem)}"
|
||||
admin_key = "${base64encode(var.admin_key_pem)}"
|
||||
server = "${var.kube_apiserver_url}"
|
||||
cluster_name = "${var.cluster_name}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_file" "kubeconfig" {
|
||||
content = "${data.template_file.kubeconfig.rendered}"
|
||||
filename = "./generated/auth/kubeconfig"
|
||||
}
|
||||
|
||||
# kubeconfig-kubelet (resources/generated/auth/kubeconfig-kubelet)
|
||||
data "template_file" "kubeconfig-kubelet" {
|
||||
template = "${file("${path.module}/resources/kubeconfig-kubelet")}"
|
||||
|
||||
vars {
|
||||
root_ca_cert = "${base64encode(var.root_ca_cert_pem)}"
|
||||
kubelet_bootstrap_token_id = "${random_string.kubelet_bootstrap_token_id.result}"
|
||||
kubelet_bootstrap_token_secret = "${random_string.kubelet_bootstrap_token_secret.result}"
|
||||
server = "${var.kube_apiserver_url}"
|
||||
cluster_name = "${var.cluster_name}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_file" "kubeconfig-kubelet" {
|
||||
content = "${data.template_file.kubeconfig-kubelet.rendered}"
|
||||
filename = "./generated/auth/kubeconfig-kubelet"
|
||||
}
|
||||
|
||||
# kvo-config.yaml (resources/generated/kco-config.yaml)
|
||||
data "template_file" "kco-config_yaml" {
|
||||
template = "${file("${path.module}/resources/kco-config.yaml")}"
|
||||
|
||||
vars {
|
||||
kube_apiserver_url = "${var.kube_apiserver_url}"
|
||||
|
||||
cloud_config_path = "${var.cloud_config_path}"
|
||||
cloud_provider_profile = "${var.cloud_provider != "" ? "${var.cloud_provider}" : "metal"}"
|
||||
|
||||
advertise_address = "${var.advertise_address}"
|
||||
cluster_cidr = "${var.cluster_cidr}"
|
||||
|
||||
etcd_servers = "${join(",", formatlist("https://%s:2379", var.etcd_endpoints))}"
|
||||
|
||||
service_cidr = "${var.service_cidr}"
|
||||
|
||||
oidc_client_id = "${var.oidc_client_id}"
|
||||
oidc_groups_claim = "${var.oidc_groups_claim}"
|
||||
oidc_issuer_url = "${var.oidc_issuer_url}"
|
||||
oidc_username_claim = "${var.oidc_username_claim}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_file" "kco-config_yaml" {
|
||||
content = "${data.template_file.kco-config_yaml.rendered}"
|
||||
filename = "./generated/kco-config.yaml"
|
||||
}
|
||||
|
||||
# bootkube.sh (resources/generated/bootkube.sh)
|
||||
data "template_file" "bootkube_sh" {
|
||||
template = "${file("${path.module}/resources/bootkube.sh")}"
|
||||
|
||||
vars {
|
||||
bootkube_image = "${var.container_images["bootkube"]}"
|
||||
kube_core_renderer_image = "${var.container_images["kube_core_renderer"]}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_file" "bootkube_sh" {
|
||||
content = "${data.template_file.bootkube_sh.rendered}"
|
||||
filename = "./generated/bootkube.sh"
|
||||
}
|
||||
|
||||
# bootkube.service (available as output variable)
|
||||
data "template_file" "bootkube_service" {
|
||||
template = "${file("${path.module}/resources/bootkube.service")}"
|
||||
}
|
||||
|
||||
data "ignition_systemd_unit" "bootkube_service" {
|
||||
name = "bootkube.service"
|
||||
enabled = false
|
||||
content = "${data.template_file.bootkube_service.rendered}"
|
||||
}
|
||||
|
||||
# bootkube.path (available as output variable)
|
||||
data "template_file" "bootkube_path_unit" {
|
||||
template = "${file("${path.module}/resources/bootkube.path")}"
|
||||
}
|
||||
|
||||
data "ignition_systemd_unit" "bootkube_path_unit" {
|
||||
name = "bootkube.path"
|
||||
enabled = true
|
||||
content = "${data.template_file.bootkube_path_unit.rendered}"
|
||||
}
|
||||
|
||||
# TNC
|
||||
resource "local_file" "tnc_pod_config" {
|
||||
content = "${data.template_file.tnc_config.rendered}"
|
||||
filename = "./generated/tnc-config"
|
||||
}
|
||||
|
||||
data "template_file" "tnc_config" {
|
||||
template = "${file("${path.module}/resources/tnc-config")}"
|
||||
|
||||
vars {
|
||||
cloud_provider_config = "${var.cloud_provider_config}"
|
||||
|
||||
http_proxy = "${var.http_proxy}"
|
||||
https_proxy = "${var.https_proxy}"
|
||||
no_proxy = "${join(",", var.no_proxy)}"
|
||||
kubelet_image_url = "${replace(var.container_images["hyperkube"],var.image_re,"$1")}"
|
||||
kubelet_image_tag = "${replace(var.container_images["hyperkube"],var.image_re,"$2")}"
|
||||
iscsi_enabled = "${var.iscsi_enabled}"
|
||||
kubeconfig_fetch_cmd = "${var.kubeconfig_fetch_cmd != "" ? "ExecStartPre=${var.kubeconfig_fetch_cmd}" : ""}"
|
||||
tectonic_torcx_image_url = "${replace(var.container_images["tectonic_torcx"],var.image_re,"$1")}"
|
||||
tectonic_torcx_image_tag = "${replace(var.container_images["tectonic_torcx"],var.image_re,"$2")}"
|
||||
torcx_skip_setup = "false"
|
||||
torcx_store_url = "${var.torcx_store_url}"
|
||||
bootstrap_upgrade_cl = "${var.bootstrap_upgrade_cl}"
|
||||
master_node_label = "${var.kubelet_master_node_label}"
|
||||
worker_node_label = "${var.kubelet_worker_node_label}"
|
||||
node_taints_param = "${var.kubelet_node_taints != "" ? "--register-with-taints=${var.kubelet_node_taints}" : ""}"
|
||||
cluster_dns_ip = "${var.kube_dns_service_ip}"
|
||||
cloud_provider = "${var.cloud_provider}"
|
||||
debug_config = "${var.kubelet_debug_config}"
|
||||
cluster_name = "${var.cluster_name}"
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
# This output is meant to be used to inject a dependency on the generated
|
||||
# assets. As of Terraform v0.9, it is difficult to make a module depend on
|
||||
# another module (no depends_on, no triggers), or to make a data source
|
||||
# depend on a module (no depends_on, no triggers, generally no dummy variable).
|
||||
#
|
||||
# For instance, using the 'archive_file' data source against the generated
|
||||
# assets, which is a common use-case, is tricky. There is no mechanism for
|
||||
# defining explicit dependencies and the only available variables are for the
|
||||
# source, destination and archive type, leaving little opportunities for us to
|
||||
# inject a dependency. Thanks to the property described below, this output can
|
||||
# be used as part of the output filename, in order to enforce the creation of
|
||||
# the archive after the assets have been properly generated.
|
||||
#
|
||||
# Both localfile and template_dir providers compute their IDs by hashing
|
||||
# the content of the resources on disk. Because this output is computed from the
|
||||
# combination of all the resources' IDs, it can't be guessed and can only be
|
||||
# interpolated once the assets have all been created.
|
||||
output "id" {
|
||||
value = "${sha1("
|
||||
${local_file.kubeconfig.id}
|
||||
${local_file.kubeconfig-kubelet.id}
|
||||
${local_file.bootkube_sh.id}
|
||||
${local_file.kco-config_yaml.id}
|
||||
${template_dir.bootkube.id}
|
||||
")}"
|
||||
}
|
||||
|
||||
output "kubeconfig" {
|
||||
value = "${data.template_file.kubeconfig.rendered}"
|
||||
}
|
||||
|
||||
output "kubeconfig-kubelet" {
|
||||
value = "${data.template_file.kubeconfig-kubelet.rendered}"
|
||||
}
|
||||
|
||||
output "systemd_service_rendered" {
|
||||
value = "${data.template_file.bootkube_service.rendered}"
|
||||
}
|
||||
|
||||
output "systemd_service_id" {
|
||||
value = "${data.ignition_systemd_unit.bootkube_service.id}"
|
||||
}
|
||||
|
||||
output "systemd_path_unit_rendered" {
|
||||
value = "${data.template_file.bootkube_path_unit.rendered}"
|
||||
}
|
||||
|
||||
output "systemd_path_unit_id" {
|
||||
value = "${data.ignition_systemd_unit.bootkube_path_unit.id}"
|
||||
}
|
||||
|
||||
output "kube_dns_service_ip" {
|
||||
value = "${cidrhost(var.service_cidr, 10)}"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
[Unit]
|
||||
Description=Trigger for bootkube.service
|
||||
[Path]
|
||||
PathExists=/opt/tectonic/bootkube.sh
|
||||
Unit=bootkube.service
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=Bootstrap a Kubernetes cluster
|
||||
ConditionPathExists=!/opt/tectonic/init_bootkube.done
|
||||
Wants=kubelet.service
|
||||
After=kubelet.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
WorkingDirectory=/opt/tectonic
|
||||
|
||||
User=root
|
||||
Group=root
|
||||
|
||||
ExecStart=/usr/bin/bash /opt/tectonic/bootkube.sh
|
||||
ExecStartPost=/bin/touch /opt/tectonic/init_bootkube.done
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
/usr/bin/docker run \
|
||||
--volume "$(pwd)":/assets \
|
||||
--volume /etc/kubernetes:/etc/kubernetes \
|
||||
"${kube_core_renderer_image}" \
|
||||
--config=/assets/kco-config.yaml \
|
||||
--output=/assets
|
||||
|
||||
mkdir -p /etc/kubernetes/manifests/
|
||||
mv /opt/tectonic/manifests/tectonic-node-controller-pod.yaml /etc/kubernetes/manifests/
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
/usr/bin/docker run \
|
||||
--volume "$(pwd)":/assets \
|
||||
--volume /etc/kubernetes:/etc/kubernetes \
|
||||
--network=host \
|
||||
--entrypoint=/bootkube \
|
||||
"${bootkube_image}" \
|
||||
start --asset-dir=/assets
|
||||
@@ -1,17 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: KubeCoreOperatorConfig
|
||||
clusterConfig:
|
||||
apiserver_url: ${kube_apiserver_url}
|
||||
authConfig:
|
||||
oidc_client_id: ${oidc_client_id}
|
||||
oidc_issuer_url: ${oidc_issuer_url}
|
||||
oidc_groups_claim: ${oidc_groups_claim}
|
||||
oidc_username_claim: ${oidc_username_claim}
|
||||
cloudProviderConfig:
|
||||
cloud_config_path: ${cloud_config_path}
|
||||
cloud_provider_profile: ${cloud_provider_profile}
|
||||
networkConfig:
|
||||
advertise_address: ${advertise_address}
|
||||
cluster_cidr: ${cluster_cidr}
|
||||
etcd_servers: ${etcd_servers}
|
||||
service_cidr: ${service_cidr}
|
||||
@@ -1,16 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- name: ${cluster_name}
|
||||
cluster:
|
||||
server: ${server}
|
||||
certificate-authority-data: ${root_ca_cert}
|
||||
users:
|
||||
- name: admin
|
||||
user:
|
||||
client-certificate-data: ${admin_cert}
|
||||
client-key-data: ${admin_key}
|
||||
contexts:
|
||||
- context:
|
||||
cluster: ${cluster_name}
|
||||
user: admin
|
||||
@@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- name: ${cluster_name}
|
||||
cluster:
|
||||
server: ${server}
|
||||
certificate-authority-data: ${root_ca_cert}
|
||||
users:
|
||||
- name: kubelet
|
||||
user:
|
||||
token: ${kubelet_bootstrap_token_id}.${kubelet_bootstrap_token_secret}
|
||||
contexts:
|
||||
- context:
|
||||
cluster: ${cluster_name}
|
||||
user: kubelet
|
||||
@@ -1,6 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: tectonic-system # Create the namespace first.
|
||||
labels: # network policy can only select by labels
|
||||
name: tectonic-system
|
||||
@@ -1,9 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
# This is the namespace used to hold the tectonic ingress controllers
|
||||
name: tectonic-ingress
|
||||
# Give the namespace a label, so we can select for it in networkpolicy
|
||||
labels:
|
||||
kubernetes.io/ingress.class: tectonic
|
||||
name: tectonic-ingress
|
||||
@@ -1,10 +0,0 @@
|
||||
apiVersion: "apiextensions.k8s.io/v1beta1"
|
||||
kind: "CustomResourceDefinition"
|
||||
metadata:
|
||||
name: "appversions.tco.coreos.com"
|
||||
spec:
|
||||
group: "tco.coreos.com"
|
||||
version: "v1"
|
||||
names:
|
||||
plural: "appversions"
|
||||
kind: "AppVersion"
|
||||
@@ -1,15 +0,0 @@
|
||||
apiVersion: tco.coreos.com/v1
|
||||
kind: AppVersion
|
||||
metadata:
|
||||
name: tectonic-network
|
||||
namespace: tectonic-system
|
||||
labels:
|
||||
managed-by-channel-operator: "true"
|
||||
spec:
|
||||
desiredVersion:
|
||||
paused: false
|
||||
status:
|
||||
currentVersion:
|
||||
paused: false
|
||||
upgradereq: 1
|
||||
upgradecomp: 0
|
||||
@@ -1,19 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kube-apiserver
|
||||
namespace: kube-system
|
||||
type: Opaque
|
||||
data:
|
||||
aggregator-ca.crt: ${aggregator_ca_cert}
|
||||
apiserver.key: ${apiserver_key}
|
||||
apiserver.crt: ${apiserver_cert}
|
||||
apiserver-proxy.key: ${apiserver_proxy_key}
|
||||
apiserver-proxy.crt: ${apiserver_proxy_cert}
|
||||
service-account.pub: ${serviceaccount_pub}
|
||||
root-ca.crt: ${root_ca_cert}
|
||||
kube-ca.crt: ${kube_ca_cert}
|
||||
etcd-client-ca.crt: ${etcd_ca_cert}
|
||||
etcd-client.crt: ${etcd_client_cert}
|
||||
etcd-client.key: ${etcd_client_key}
|
||||
oidc-ca.crt: ${oidc_ca_cert}
|
||||
@@ -1,8 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kube-cloud-cfg
|
||||
namespace: kube-system
|
||||
type: Opaque
|
||||
data:
|
||||
config: ${base64encode(cloud_provider_config)}
|
||||
@@ -1,11 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kube-controller-manager
|
||||
namespace: kube-system
|
||||
type: Opaque
|
||||
data:
|
||||
service-account.key: ${serviceaccount_key}
|
||||
root-ca.crt: ${root_ca_cert}
|
||||
kube-ca.crt: ${kube_ca_cert}
|
||||
kube-ca.key: ${kube_ca_key}
|
||||
@@ -1,10 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: bootstrap-token-${kubelet_bootstrap_token_id}
|
||||
namespace: kube-system
|
||||
type: bootstrap.kubernetes.io/token
|
||||
stringData:
|
||||
token-id: ${kubelet_bootstrap_token_id}
|
||||
token-secret: ${kubelet_bootstrap_token_secret}
|
||||
usage-bootstrap-authentication: "true"
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Secret",
|
||||
"type": "kubernetes.io/dockerconfigjson",
|
||||
"metadata": {
|
||||
"namespace": "kube-system",
|
||||
"name": "coreos-pull-secret"
|
||||
},
|
||||
"data": {
|
||||
".dockerconfigjson": "${pull_secret}"
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: tectonic-network-operator
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: tectonic-network-operator
|
||||
managed-by-channel-operator: "true"
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: tectonic-network-operator
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: tectonic-network-operator
|
||||
tectonic-app-version-name: tectonic-network
|
||||
spec:
|
||||
containers:
|
||||
- name: tectonic-network-operator
|
||||
image: ${tectonic_network_operator_image}
|
||||
resources:
|
||||
limits:
|
||||
cpu: 20m
|
||||
memory: 50Mi
|
||||
requests:
|
||||
cpu: 20m
|
||||
memory: 50Mi
|
||||
volumeMounts:
|
||||
- name: cluster-config
|
||||
mountPath: /etc/cluster-config
|
||||
hostNetwork: true
|
||||
restartPolicy: Always
|
||||
imagePullSecrets:
|
||||
- name: coreos-pull-secret
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534
|
||||
volumes:
|
||||
- name: cluster-config
|
||||
configMap:
|
||||
name: cluster-config-v1
|
||||
items:
|
||||
- key: network-config
|
||||
path: network-config
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/master: ""
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
@@ -1,15 +0,0 @@
|
||||
# Kubernete's Service Account (resources/generated/tls/{service-account.key,service-account.pub})
|
||||
resource "tls_private_key" "service_account" {
|
||||
algorithm = "RSA"
|
||||
rsa_bits = "2048"
|
||||
}
|
||||
|
||||
resource "local_file" "service_account_key" {
|
||||
content = "${tls_private_key.service_account.private_key_pem}"
|
||||
filename = "./generated/tls/service-account.key"
|
||||
}
|
||||
|
||||
resource "local_file" "service_account_crt" {
|
||||
content = "${tls_private_key.service_account.public_key_pem}"
|
||||
filename = "./generated/tls/service-account.pub"
|
||||
}
|
||||
@@ -1,257 +0,0 @@
|
||||
variable "advertise_address" {
|
||||
description = "The IP address on which to advertise the apiserver to members of the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "apiserver_cert_pem" {
|
||||
type = "string"
|
||||
description = "The API server certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "apiserver_key_pem" {
|
||||
type = "string"
|
||||
description = "The API server key in PEM format."
|
||||
}
|
||||
|
||||
variable "apiserver_proxy_cert_pem" {
|
||||
type = "string"
|
||||
description = "The API server proxy certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "apiserver_proxy_key_pem" {
|
||||
type = "string"
|
||||
description = "The API server proxy key in PEM format."
|
||||
}
|
||||
|
||||
variable "cloud_provider" {
|
||||
description = "The provider for cloud services (empty string for no provider)"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cloud_provider_config" {
|
||||
description = "Content of cloud provider config"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "cluster_cidr" {
|
||||
description = "A CIDR notation IP range from which to assign pod IPs"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "container_images" {
|
||||
description = "Container images to use"
|
||||
type = "map"
|
||||
}
|
||||
|
||||
variable "etcd_ca_cert_pem" {
|
||||
type = "string"
|
||||
description = "The etcd CA certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_client_cert_pem" {
|
||||
type = "string"
|
||||
description = "The etcd client certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_client_key_pem" {
|
||||
type = "string"
|
||||
description = "The etcd client key in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_endpoints" {
|
||||
description = "List of etcd endpoints to connect with (hostnames/IPs only)"
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "etcd_peer_cert_pem" {
|
||||
type = "string"
|
||||
description = "The etcd peer certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_peer_key_pem" {
|
||||
type = "string"
|
||||
description = "The etcd peer key in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_server_cert_pem" {
|
||||
type = "string"
|
||||
description = "The etcd server certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "etcd_server_key_pem" {
|
||||
type = "string"
|
||||
description = "The etcd server key in PEM format."
|
||||
}
|
||||
|
||||
variable "kube_apiserver_url" {
|
||||
description = "URL used to reach kube-apiserver"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "root_ca_cert_pem" {
|
||||
type = "string"
|
||||
description = "The Root CA in PEM format."
|
||||
}
|
||||
|
||||
variable "aggregator_ca_cert_pem" {
|
||||
type = "string"
|
||||
description = "The Aggregated API Server CA in PEM format."
|
||||
}
|
||||
|
||||
variable "kube_ca_cert_pem" {
|
||||
type = "string"
|
||||
description = "The Kubernetes CA in PEM format."
|
||||
}
|
||||
|
||||
variable "kube_ca_key_pem" {
|
||||
type = "string"
|
||||
description = "The Kubernetes CA key in PEM format."
|
||||
}
|
||||
|
||||
variable "admin_cert_pem" {
|
||||
type = "string"
|
||||
description = "The kubelet certificate in PEM format."
|
||||
}
|
||||
|
||||
variable "admin_key_pem" {
|
||||
type = "string"
|
||||
description = "The kubelet key in PEM format."
|
||||
}
|
||||
|
||||
variable "master_count" {
|
||||
description = "The number of the master nodes"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "oidc_ca_cert" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "oidc_client_id" {
|
||||
description = "The client ID for the OpenID Connect client"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "oidc_groups_claim" {
|
||||
description = "The OpenID claim to use for specifying user groups (string or array of strings)"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "oidc_issuer_url" {
|
||||
description = "The URL of the OpenID issuer, only HTTPS scheme will be accepted"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "oidc_username_claim" {
|
||||
description = "The OpenID claim to use as the user name"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cloud_config_path" {
|
||||
description = "The path to the secret file that contains the cloud config contents. Either be empty ('') or ('/etc/kubernetes/cloud/config')."
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "service_cidr" {
|
||||
description = "A CIDR notation IP range from which to assign service cluster IPs"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "versions" {
|
||||
description = "Container versions to use"
|
||||
type = "map"
|
||||
}
|
||||
|
||||
variable "pull_secret_path" {
|
||||
type = "string"
|
||||
description = "Path on disk to your Tectonic pull secret. Obtain this from your Tectonic Account: https://account.coreos.com."
|
||||
default = "/Users/coreos/Desktop/config.json"
|
||||
}
|
||||
|
||||
variable "calico_mtu" {
|
||||
description = "sets the MTU size for workload interfaces and the IP-in-IP tunnel device"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "tectonic_networking" {
|
||||
description = "configures the network to be used in the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "http_proxy" {
|
||||
type = "string"
|
||||
description = "HTTP proxy address."
|
||||
}
|
||||
|
||||
variable "https_proxy" {
|
||||
type = "string"
|
||||
description = "HTTPS proxy address."
|
||||
}
|
||||
|
||||
variable "no_proxy" {
|
||||
type = "list"
|
||||
description = "List of local endpoints that will not use HTTP proxy."
|
||||
}
|
||||
|
||||
variable "iscsi_enabled" {
|
||||
type = "string"
|
||||
default = "false"
|
||||
}
|
||||
|
||||
variable "kubeconfig_fetch_cmd" {
|
||||
type = "string"
|
||||
description = "(optional) The command that fetches `/etc/kubernetes/kubeconfig`."
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "bootstrap_upgrade_cl" {
|
||||
type = "string"
|
||||
description = "(optional) Whether to trigger a ContainerLinux OS upgrade during the bootstrap process."
|
||||
default = "true"
|
||||
}
|
||||
|
||||
variable "torcx_store_url" {
|
||||
type = "string"
|
||||
description = "(optional) URL template for torcx store. Leave empty to use the default CoreOS endpoint."
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "kubelet_node_taints" {
|
||||
type = "string"
|
||||
description = "(optional) Taints that Kubelet will apply on the node"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "kube_dns_service_ip" {
|
||||
type = "string"
|
||||
description = "Service IP used to reach kube-dns"
|
||||
}
|
||||
|
||||
variable "kubelet_debug_config" {
|
||||
type = "string"
|
||||
default = ""
|
||||
description = "internal debug flags for the kubelet (used in CI only)"
|
||||
}
|
||||
|
||||
variable "kubelet_master_node_label" {
|
||||
type = "string"
|
||||
description = "Label that Kubelet will apply on the master node"
|
||||
}
|
||||
|
||||
variable "kubelet_worker_node_label" {
|
||||
type = "string"
|
||||
description = "Label that Kubelet will apply on the worker node"
|
||||
}
|
||||
|
||||
variable "image_re" {
|
||||
description = <<EOF
|
||||
(internal) Regular expression used to extract repo and tag components from image strings
|
||||
EOF
|
||||
|
||||
type = "string"
|
||||
}
|
||||
@@ -18,6 +18,7 @@ resource "template_dir" "bootkube" {
|
||||
|
||||
vars {
|
||||
tectonic_network_operator_image = "${var.container_images["tectonic_network_operator"]}"
|
||||
tnc_bootstrap_image = "${var.container_images["tnc_bootstrap"]}"
|
||||
|
||||
kco_config = "${indent(4, chomp(data.template_file.kco-config_yaml.rendered))}"
|
||||
|
||||
@@ -40,10 +41,13 @@ resource "template_dir" "bootkube" {
|
||||
pull_secret = "${base64encode(file(var.pull_secret_path))}"
|
||||
serviceaccount_pub = "${base64encode(tls_private_key.service_account.public_key_pem)}"
|
||||
serviceaccount_key = "${base64encode(tls_private_key.service_account.private_key_pem)}"
|
||||
kube_dns_service_ip = "${cidrhost(var.service_cidr, 10)}"
|
||||
|
||||
etcd_ca_cert = "${base64encode(var.etcd_ca_cert_pem)}"
|
||||
etcd_client_cert = "${base64encode(var.etcd_client_cert_pem)}"
|
||||
etcd_client_key = "${base64encode(var.etcd_client_key_pem)}"
|
||||
|
||||
tnc_config = "${indent(4, chomp(data.template_file.tnc_config.rendered))}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,3 +152,37 @@ data "ignition_systemd_unit" "bootkube_path_unit" {
|
||||
enabled = true
|
||||
content = "${data.template_file.bootkube_path_unit.rendered}"
|
||||
}
|
||||
|
||||
# TNC
|
||||
resource "local_file" "tnc_pod_config" {
|
||||
content = "${data.template_file.tnc_config.rendered}"
|
||||
filename = "./generated/tnc-config"
|
||||
}
|
||||
|
||||
data "template_file" "tnc_config" {
|
||||
template = "${file("${path.module}/resources/tnc-config")}"
|
||||
|
||||
vars {
|
||||
cloud_provider_config = "${var.cloud_provider_config}"
|
||||
|
||||
http_proxy = "${var.http_proxy}"
|
||||
https_proxy = "${var.https_proxy}"
|
||||
no_proxy = "${join(",", var.no_proxy)}"
|
||||
kubelet_image_url = "${replace(var.container_images["hyperkube"],var.image_re,"$1")}"
|
||||
kubelet_image_tag = "${replace(var.container_images["hyperkube"],var.image_re,"$2")}"
|
||||
iscsi_enabled = "${var.iscsi_enabled}"
|
||||
kubeconfig_fetch_cmd = "${var.kubeconfig_fetch_cmd != "" ? "ExecStartPre=${var.kubeconfig_fetch_cmd}" : ""}"
|
||||
tectonic_torcx_image_url = "${replace(var.container_images["tectonic_torcx"],var.image_re,"$1")}"
|
||||
tectonic_torcx_image_tag = "${replace(var.container_images["tectonic_torcx"],var.image_re,"$2")}"
|
||||
torcx_skip_setup = "false"
|
||||
torcx_store_url = "${var.torcx_store_url}"
|
||||
bootstrap_upgrade_cl = "${var.bootstrap_upgrade_cl}"
|
||||
master_node_label = "${var.kubelet_master_node_label}"
|
||||
worker_node_label = "${var.kubelet_worker_node_label}"
|
||||
node_taints_param = "${var.kubelet_node_taints != "" ? "--register-with-taints=${var.kubelet_node_taints}" : ""}"
|
||||
cluster_dns_ip = "${var.kube_dns_service_ip}"
|
||||
cloud_provider = "${var.cloud_provider}"
|
||||
debug_config = "${var.kubelet_debug_config}"
|
||||
cluster_name = "${var.cluster_name}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ set -e
|
||||
--output=/assets
|
||||
|
||||
mkdir -p /etc/kubernetes/manifests/
|
||||
mv /opt/tectonic/manifests/tectonic-node-controller-pod.yaml /etc/kubernetes/manifests/
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
/usr/bin/docker run \
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cluster-config-v1
|
||||
namespace: kube-system
|
||||
data:
|
||||
kco-config: |
|
||||
${kco_config}
|
||||
network-config: |
|
||||
apiVersion: v1
|
||||
kind: NetworkConfig
|
||||
podCIDR: ${cluster_cidr}
|
||||
networkProfile: ${tectonic_networking}
|
||||
calicoConfig:
|
||||
mtu: ${calico_mtu}
|
||||
@@ -182,3 +182,76 @@ variable "tectonic_networking" {
|
||||
description = "configures the network to be used in the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "http_proxy" {
|
||||
type = "string"
|
||||
description = "HTTP proxy address."
|
||||
}
|
||||
|
||||
variable "https_proxy" {
|
||||
type = "string"
|
||||
description = "HTTPS proxy address."
|
||||
}
|
||||
|
||||
variable "no_proxy" {
|
||||
type = "list"
|
||||
description = "List of local endpoints that will not use HTTP proxy."
|
||||
}
|
||||
|
||||
variable "iscsi_enabled" {
|
||||
type = "string"
|
||||
default = "false"
|
||||
}
|
||||
|
||||
variable "kubeconfig_fetch_cmd" {
|
||||
type = "string"
|
||||
description = "(optional) The command that fetches `/etc/kubernetes/kubeconfig`."
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "bootstrap_upgrade_cl" {
|
||||
type = "string"
|
||||
description = "(optional) Whether to trigger a ContainerLinux OS upgrade during the bootstrap process."
|
||||
default = "true"
|
||||
}
|
||||
|
||||
variable "torcx_store_url" {
|
||||
type = "string"
|
||||
description = "(optional) URL template for torcx store. Leave empty to use the default CoreOS endpoint."
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "kubelet_node_taints" {
|
||||
type = "string"
|
||||
description = "(optional) Taints that Kubelet will apply on the node"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "kube_dns_service_ip" {
|
||||
type = "string"
|
||||
description = "Service IP used to reach kube-dns"
|
||||
}
|
||||
|
||||
variable "kubelet_debug_config" {
|
||||
type = "string"
|
||||
default = ""
|
||||
description = "internal debug flags for the kubelet (used in CI only)"
|
||||
}
|
||||
|
||||
variable "kubelet_master_node_label" {
|
||||
type = "string"
|
||||
description = "Label that Kubelet will apply on the master node"
|
||||
}
|
||||
|
||||
variable "kubelet_worker_node_label" {
|
||||
type = "string"
|
||||
description = "Label that Kubelet will apply on the worker node"
|
||||
}
|
||||
|
||||
variable "image_re" {
|
||||
description = <<EOF
|
||||
(internal) Regular expression used to extract repo and tag components from image strings
|
||||
EOF
|
||||
|
||||
type = "string"
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
resource "null_resource" "bootstrapper" {
|
||||
triggers {
|
||||
endpoint = "${var.bootstrapping_host}"
|
||||
dependencies = "${join("", concat(flatten(var._dependencies)))}"
|
||||
}
|
||||
|
||||
connection {
|
||||
host = "${var.bootstrapping_host}"
|
||||
user = "core"
|
||||
agent = true
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
when = "create"
|
||||
source = "./generated"
|
||||
destination = "$HOME/tectonic"
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
when = "create"
|
||||
|
||||
inline = [
|
||||
"sudo mkdir -p /opt",
|
||||
"sudo rm -rf /opt/tectonic",
|
||||
"sudo mv /home/core/tectonic /opt/",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
variable "bootstrapping_host" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "_dependencies" {
|
||||
type = "list"
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
resource "azurerm_dns_a_record" "tectonic_api" {
|
||||
count = "${var.base_domain != "" ? 1 : 0}"
|
||||
|
||||
resource_group_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$1")}"
|
||||
zone_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$2")}"
|
||||
|
||||
name = "${var.cluster_name}-api"
|
||||
ttl = "60"
|
||||
records = ["${var.api_ip_addresses}"]
|
||||
|
||||
tags = "${merge(map(
|
||||
"Name", "${var.cluster_name}",
|
||||
"tectonicClusterID", "${var.cluster_id}"),
|
||||
var.extra_tags)}"
|
||||
}
|
||||
|
||||
resource "azurerm_dns_a_record" "tectonic_console" {
|
||||
count = "${var.base_domain != "" ? 1 : 0}"
|
||||
|
||||
resource_group_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$1")}"
|
||||
zone_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$2")}"
|
||||
|
||||
name = "${var.cluster_name}"
|
||||
ttl = "60"
|
||||
records = ["${var.console_ip_addresses}"]
|
||||
|
||||
tags = "${merge(map(
|
||||
"Name", "${var.cluster_name}",
|
||||
"tectonicClusterID", "${var.cluster_id}"),
|
||||
var.extra_tags)}"
|
||||
}
|
||||
|
||||
resource "azurerm_dns_a_record" "tectonic_etcd" {
|
||||
count = "${var.base_domain != "" ? var.etcd_count : 0}"
|
||||
|
||||
resource_group_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$1")}"
|
||||
zone_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$2")}"
|
||||
|
||||
name = "${var.cluster_name}-etcd-${count.index}"
|
||||
ttl = "60"
|
||||
records = ["${var.etcd_ip_addresses[count.index]}"]
|
||||
|
||||
tags = "${merge(map(
|
||||
"Name", "${var.cluster_name}",
|
||||
"tectonicClusterID", "${var.cluster_id}"),
|
||||
var.extra_tags)}"
|
||||
}
|
||||
|
||||
resource "azurerm_dns_a_record" "tectonic_master" {
|
||||
count = "${var.base_domain != "" ? var.master_count : 0}"
|
||||
|
||||
resource_group_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$1")}"
|
||||
zone_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$2")}"
|
||||
|
||||
name = "${var.cluster_name}-master-${count.index}"
|
||||
ttl = "60"
|
||||
records = ["${var.master_ip_addresses[count.index]}"]
|
||||
|
||||
tags = "${merge(map(
|
||||
"Name", "${var.cluster_name}",
|
||||
"tectonicClusterID", "${var.cluster_id}"),
|
||||
var.extra_tags)}"
|
||||
}
|
||||
|
||||
resource "azurerm_dns_a_record" "tectonic_worker" {
|
||||
count = "${var.base_domain != "" ? var.worker_count : 0}"
|
||||
|
||||
resource_group_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$1")}"
|
||||
zone_name = "${replace(var.external_dns_zone_id, "${var.const_id_to_group_name_regex}", "$2")}"
|
||||
|
||||
name = "${var.cluster_name}-worker-${count.index}"
|
||||
ttl = "60"
|
||||
records = ["${var.worker_ip_addresses[count.index]}"]
|
||||
|
||||
tags = "${merge(map(
|
||||
"Name", "${var.cluster_name}",
|
||||
"tectonicClusterID", "${var.cluster_id}"),
|
||||
var.extra_tags)}"
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
// This var is for internal use only.
|
||||
// It is to be considered a constant, because Terraform can't acutally define constants.
|
||||
variable "const_id_to_group_name_regex" {
|
||||
default = "/^/subscriptions/[-\\w]+/resourceGroups/([-\\w]+)/providers/[.\\w]+/[.\\w]+/([.\\w-]+)$/"
|
||||
type = "string"
|
||||
description = "(internal) A regular expression that parses Azure resource IDs into component identifiers."
|
||||
}
|
||||
|
||||
// Location is the Azure Location (East US, West US, etc)
|
||||
variable "location" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
// The base DNS domain of the cluster.
|
||||
// Example: `azure.dev.coreos.systems`
|
||||
variable "base_domain" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
// The name of the cluster.
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "master_ip_addresses" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "worker_ip_addresses" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "console_ip_addresses" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "etcd_ip_addresses" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "api_ip_addresses" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "external_dns_zone_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_count" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "master_count" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "worker_count" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "extra_tags" {
|
||||
type = "map"
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
resource "openstack_dns_recordset_v2" "etcd_a_nodes" {
|
||||
count = "${var.etcd_count}"
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}-etcd-${count.index}.${var.base_domain}."
|
||||
records = ["${var.etcd_ip_addresses[count.index]}"]
|
||||
}
|
||||
|
||||
resource "openstack_dns_recordset_v2" "etcd_srv_discover" {
|
||||
name = "_etcd-server-ssl._tcp.${var.base_domain}."
|
||||
type = "SRV"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
records = ["${formatlist("0 0 2380 %s", openstack_dns_recordset_v2.etcd_a_nodes.*.name)}"]
|
||||
ttl = "300"
|
||||
}
|
||||
|
||||
resource "openstack_dns_recordset_v2" "etcd_srv_client" {
|
||||
name = "_etcd-client-ssl._tcp.${var.base_domain}."
|
||||
type = "SRV"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
records = ["${formatlist("0 0 2379 %s", openstack_dns_recordset_v2.etcd_a_nodes.*.name)}"]
|
||||
ttl = "60"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
resource "openstack_dns_recordset_v2" "master_nodes" {
|
||||
count = "${var.master_count}"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}-master-${count.index}.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = ["${var.master_ip_addresses[count.index]}"]
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
output "etcd_a_nodes" {
|
||||
value = "${flatten(openstack_dns_recordset_v2.etcd_a_nodes.*.records)}"
|
||||
}
|
||||
|
||||
output "master_nodes" {
|
||||
value = "${flatten(openstack_dns_recordset_v2.master_nodes.*.records)}"
|
||||
}
|
||||
|
||||
output "worker_nodes" {
|
||||
value = "${flatten(openstack_dns_recordset_v2.worker_nodes.*.records)}"
|
||||
}
|
||||
|
||||
output "worker_nodes_public" {
|
||||
value = "${flatten(openstack_dns_recordset_v2.worker_nodes_public.*.records)}"
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
data "openstack_dns_zone_v2" "tectonic" {
|
||||
name = "${var.base_domain}."
|
||||
}
|
||||
|
||||
resource "openstack_dns_recordset_v2" "tectonic-api" {
|
||||
count = "1"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}-k8s.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = ["${var.api_ip_addresses}"]
|
||||
}
|
||||
|
||||
resource "openstack_dns_recordset_v2" "tectonic-console" {
|
||||
count = "1"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = ["${var.worker_ip_addresses}"]
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
variable "cluster_name" {
|
||||
description = "The name of the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "base_domain" {
|
||||
description = "The base domain used in records"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "master_count" {
|
||||
description = "The number of masters"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "worker_count" {
|
||||
description = "The number of workers"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_count" {
|
||||
description = "The number of etcd nodes"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_ip_addresses" {
|
||||
description = "List of string IPs for etcd nodes"
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "master_ip_addresses" {
|
||||
description = "List of string IPs for masters"
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "worker_ip_addresses" {
|
||||
description = "List of string IPs for workers"
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "worker_public_ips" {
|
||||
description = "(optional) List of string public IPs for workers"
|
||||
type = "list"
|
||||
default = []
|
||||
}
|
||||
|
||||
// hack: worker_public_ips_enabled is a workaround for https://github.com/hashicorp/terraform/issues/10857
|
||||
variable "worker_public_ips_enabled" {
|
||||
description = "Worker nodes have public IPs assigned. worker_public_ips must be provided if true."
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "api_ip_addresses" {
|
||||
description = "List of string IPs for k8s API"
|
||||
type = "list"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
resource "openstack_dns_recordset_v2" "worker_nodes" {
|
||||
count = "${var.worker_count}"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}-worker-${count.index}.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = ["${var.worker_ip_addresses[count.index]}"]
|
||||
}
|
||||
|
||||
resource "openstack_dns_recordset_v2" "worker_nodes_public" {
|
||||
// hack: worker_public_ips_enabled is a workaround for https://github.com/hashicorp/terraform/issues/10857
|
||||
count = "${var.worker_public_ips_enabled ? var.worker_count : 0}"
|
||||
zone_id = "${data.openstack_dns_zone_v2.tectonic.id}"
|
||||
name = "${var.cluster_name}-worker-${count.index}-public.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = ["${var.worker_public_ips[count.index]}"]
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
output "etcd_ip_fqdn_list" {
|
||||
value = ["${split(",", length(var.external_endpoints) == 0 ? join(",", google_dns_record_set.etc_a_node.*.name) : join(",", var.external_endpoints))}"]
|
||||
}
|
||||
|
||||
output "kube_apiserver_fqdn" {
|
||||
# Remove trailing dot from the name
|
||||
value = "${join(".", compact(split(".", google_dns_record_set.api-external.name)))}"
|
||||
}
|
||||
|
||||
output "kube_ingress_fqdn" {
|
||||
# Remove trailing dot from the name
|
||||
value = "${join(".", compact(split(".", google_dns_record_set.ingress-external.name)))}"
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
resource "google_dns_record_set" "api-external" {
|
||||
name = "${var.cluster_name}-api.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = 300
|
||||
managed_zone = "${var.managed_zone_name}"
|
||||
rrdatas = ["${var.tectonic_masters_ip}"]
|
||||
}
|
||||
|
||||
resource "google_dns_record_set" "ingress-external" {
|
||||
name = "${var.cluster_name}.${var.base_domain}."
|
||||
type = "A"
|
||||
ttl = 300
|
||||
managed_zone = "${var.managed_zone_name}"
|
||||
rrdatas = ["${var.tectonic_ingress_ip}"]
|
||||
}
|
||||
|
||||
# Etcd
|
||||
resource "google_dns_record_set" "etc_a_node" {
|
||||
count = "${var.etcd_dns_enabled ? var.etcd_instance_count : 0}"
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
managed_zone = "${var.managed_zone_name}"
|
||||
name = "${var.cluster_name}-etcd-${count.index}.${var.base_domain}."
|
||||
rrdatas = ["${var.etcd_ip_addresses[count.index]}"]
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
variable "cluster_name" {
|
||||
description = "The name of the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_dns_enabled" {
|
||||
description = "The name of the cluster"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_instance_count" {
|
||||
description = "The number of etcd nods"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "managed_zone_name" {
|
||||
description = "The name of the managed zone"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "etcd_ip_addresses" {
|
||||
description = "The list of etcd nodes addresses"
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "base_domain" {
|
||||
description = "The base domain used in records"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "external_endpoints" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "tectonic_masters_ip" {
|
||||
description = "The master load balancer ip"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "tectonic_ingress_ip" {
|
||||
description = "The ingress load balancer ip"
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
data "ignition_config" "etcd" {
|
||||
count = "${var.instance_count}"
|
||||
|
||||
users = [
|
||||
"${data.ignition_user.core.id}",
|
||||
]
|
||||
|
||||
files = ["${compact(list(
|
||||
data.ignition_file.resolv_conf.id,
|
||||
var.ign_profile_env_id,
|
||||
var.ign_systemd_default_env_id,
|
||||
))}",
|
||||
"${var.ign_etcd_crt_id_list}",
|
||||
]
|
||||
|
||||
systemd = [
|
||||
"${data.ignition_systemd_unit.locksmithd.*.id[count.index]}",
|
||||
"${var.ign_etcd_dropin_id_list[count.index]}",
|
||||
"${var.ign_coreos_metadata_dropin_id}",
|
||||
]
|
||||
}
|
||||
|
||||
data "ignition_file" "resolv_conf" {
|
||||
path = "/etc/resolv.conf"
|
||||
mode = 0644
|
||||
uid = 0
|
||||
filesystem = "root"
|
||||
|
||||
content {
|
||||
content = "${var.resolv_conf_content}"
|
||||
}
|
||||
}
|
||||
|
||||
data "ignition_systemd_unit" "locksmithd" {
|
||||
count = "${var.instance_count}"
|
||||
|
||||
name = "locksmithd.service"
|
||||
enabled = true
|
||||
|
||||
dropin = [
|
||||
{
|
||||
name = "40-etcd-lock.conf"
|
||||
|
||||
content = <<EOF
|
||||
[Service]
|
||||
Environment=REBOOT_STRATEGY=etcd-lock
|
||||
Environment="LOCKSMITHD_ETCD_CAFILE=/etc/ssl/etcd/ca.crt"
|
||||
Environment="LOCKSMITHD_ETCD_KEYFILE=/etc/ssl/etcd/client.key"
|
||||
Environment="LOCKSMITHD_ETCD_CERTFILE=/etc/ssl/etcd/client.crt"
|
||||
Environment="LOCKSMITHD_ENDPOINT=https://${var.cluster_name}-etcd-${count.index}.${var.base_domain}:2379"
|
||||
EOF
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
data "ignition_user" "core" {
|
||||
name = "core"
|
||||
ssh_authorized_keys = ["${var.core_public_keys}"]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
output "user_data" {
|
||||
value = "${data.ignition_config.etcd.*.rendered}"
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// The content of the /etc/resolv.conf file.
|
||||
variable resolv_conf_content {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "base_domain" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "container_image" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "core_public_keys" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "instance_count" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_etcd_dropin_id_list" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "ign_coreos_metadata_dropin_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "ign_etcd_crt_id_list" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "ign_profile_env_id" {
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_systemd_default_env_id" {
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
data "ignition_config" "node" {
|
||||
count = "${var.instance_count}"
|
||||
|
||||
users = [
|
||||
"${data.ignition_user.core.id}",
|
||||
]
|
||||
|
||||
files = ["${compact(list(
|
||||
data.ignition_file.kubeconfig.id,
|
||||
var.ign_installer_kubelet_env_id,
|
||||
var.ign_installer_runtime_mappings_id,
|
||||
var.ign_max_user_watches_id,
|
||||
data.ignition_file.resolv_conf.id,
|
||||
data.ignition_file.hostname.*.id[count.index],
|
||||
data.ignition_file.sshd.id,
|
||||
))}",
|
||||
"${var.ign_ca_cert_id_list}",
|
||||
]
|
||||
|
||||
systemd = ["${compact(list(
|
||||
var.ign_docker_dropin_id,
|
||||
var.ign_k8s_node_bootstrap_service_id,
|
||||
var.ign_locksmithd_service_id,
|
||||
var.ign_kubelet_service_id,
|
||||
var.ign_bootkube_service_id,
|
||||
var.ign_tectonic_service_id,
|
||||
var.ign_bootkube_path_unit_id,
|
||||
var.ign_tectonic_path_unit_id,
|
||||
var.ign_update_ca_certificates_dropin_id,
|
||||
var.ign_iscsi_service_id,
|
||||
))}"]
|
||||
}
|
||||
|
||||
data "ignition_file" "resolv_conf" {
|
||||
path = "/etc/resolv.conf"
|
||||
mode = 0644
|
||||
uid = 0
|
||||
filesystem = "root"
|
||||
|
||||
content {
|
||||
content = "${var.resolv_conf_content}"
|
||||
}
|
||||
}
|
||||
|
||||
data "ignition_user" "core" {
|
||||
name = "core"
|
||||
ssh_authorized_keys = ["${var.core_public_keys}"]
|
||||
}
|
||||
|
||||
data "ignition_file" "hostname" {
|
||||
count = "${var.instance_count}"
|
||||
path = "/etc/hostname"
|
||||
mode = 0644
|
||||
uid = 0
|
||||
filesystem = "root"
|
||||
|
||||
content {
|
||||
content = "${var.cluster_name}-${var.hostname_infix}-${count.index}"
|
||||
}
|
||||
}
|
||||
|
||||
data "ignition_file" "kubeconfig" {
|
||||
filesystem = "root"
|
||||
path = "/etc/kubernetes/kubeconfig"
|
||||
mode = 0644
|
||||
|
||||
content {
|
||||
content = "${var.kubeconfig_content}"
|
||||
}
|
||||
}
|
||||
|
||||
data "ignition_file" "sshd" {
|
||||
filesystem = "root"
|
||||
path = "/etc/ssh/sshd_config"
|
||||
mode = 0600
|
||||
|
||||
content {
|
||||
content = <<EOF
|
||||
Subsystem sftp internal-sftp
|
||||
|
||||
PermitRootLogin no
|
||||
AuthenticationMethods publickey
|
||||
EOF
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
output "user_data" {
|
||||
value = "${data.ignition_config.node.*.rendered}"
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
[Service]
|
||||
Environment="ETCD_IMAGE_TAG=${version}"
|
||||
ExecStart=
|
||||
ExecStart=/usr/lib/coreos/etcd-wrapper gateway start \
|
||||
--listen-addr=127.0.0.1:2379 \
|
||||
--endpoints=${endpoints}
|
||||
@@ -1 +0,0 @@
|
||||
../../ignition/outputs.import
|
||||
@@ -1,53 +0,0 @@
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
description = "The name of the cluster. The master hostnames will be prefixed with this."
|
||||
}
|
||||
|
||||
variable "core_public_keys" {
|
||||
type = "list"
|
||||
}
|
||||
|
||||
variable "hostname_infix" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "instance_count" {
|
||||
type = "string"
|
||||
description = "The amount of nodes to be created. Example: `3`"
|
||||
}
|
||||
|
||||
variable "kubeconfig_content" {
|
||||
type = "string"
|
||||
description = "The content of the kubeconfig file."
|
||||
}
|
||||
|
||||
variable "resolv_conf_content" {
|
||||
type = "string"
|
||||
description = "The content of the /etc/resolv.conf file."
|
||||
}
|
||||
|
||||
variable "ign_bootkube_service_id" {
|
||||
type = "string"
|
||||
description = "The ID of the bootkube systemd service unit"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_bootkube_path_unit_id" {
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_tectonic_service_id" {
|
||||
type = "string"
|
||||
description = "The ID of the tectonic installer systemd service unit"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_tectonic_path_unit_id" {
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ign_iscsi_service_id" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
output "secgroup_master_names" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.name}",
|
||||
"${openstack_networking_secgroup_v2.k8s.name}",
|
||||
"${openstack_networking_secgroup_v2.etcd.name}",
|
||||
]
|
||||
}
|
||||
|
||||
output "secgroup_master_ids" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.id}",
|
||||
"${openstack_networking_secgroup_v2.k8s.id}",
|
||||
"${openstack_networking_secgroup_v2.etcd.id}",
|
||||
]
|
||||
}
|
||||
|
||||
output "secgroup_node_names" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.name}",
|
||||
"${openstack_networking_secgroup_v2.k8s.name}",
|
||||
]
|
||||
}
|
||||
|
||||
output "secgroup_node_ids" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.id}",
|
||||
"${openstack_networking_secgroup_v2.k8s.id}",
|
||||
"${openstack_networking_secgroup_v2.k8s_nodes.id}",
|
||||
]
|
||||
}
|
||||
|
||||
output "secgroup_etcd_names" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.name}",
|
||||
"${openstack_networking_secgroup_v2.etcd.name}",
|
||||
]
|
||||
}
|
||||
|
||||
output "secgroup_etcd_ids" {
|
||||
value = [
|
||||
"${openstack_networking_secgroup_v2.base.id}",
|
||||
"${openstack_networking_secgroup_v2.etcd.id}",
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
resource "openstack_networking_secgroup_rule_v2" "ssh" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 22
|
||||
port_range_max = 22
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "icmp" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
protocol = "icmp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
variable "secgroup_id" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
resource "openstack_networking_secgroup_rule_v2" "etcd" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 2379
|
||||
port_range_max = 2380
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "${var.cluster_cidr}"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
variable "secgroup_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_cidr" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
resource "openstack_networking_secgroup_rule_v2" "api" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 6443
|
||||
port_range_max = 6443
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "https" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 443
|
||||
port_range_max = 443
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "cAdvisor" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 4194
|
||||
port_range_max = 4194
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "${var.cluster_cidr}"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "flannel" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 4789
|
||||
port_range_max = 4789
|
||||
protocol = "udp"
|
||||
remote_ip_prefix = "${var.cluster_cidr}"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "kubelet" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 10250
|
||||
port_range_max = 10250
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "node_ports" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 30000
|
||||
port_range_max = 32767
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
variable "secgroup_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_cidr" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
resource "openstack_networking_secgroup_rule_v2" "http" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
port_range_min = 80
|
||||
port_range_max = 80
|
||||
protocol = "tcp"
|
||||
remote_ip_prefix = "${var.cluster_cidr}"
|
||||
security_group_id = "${var.secgroup_id}"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
variable "secgroup_id" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_cidr" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
resource "openstack_networking_secgroup_v2" "base" {
|
||||
name = "${var.cluster_name}_base"
|
||||
description = "SSH and ICMP"
|
||||
}
|
||||
|
||||
module "default" {
|
||||
source = "./rules/default"
|
||||
secgroup_id = "${openstack_networking_secgroup_v2.base.id}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_v2" "k8s" {
|
||||
name = "${var.cluster_name}_k8s"
|
||||
description = "Ports needed by Kubernetes"
|
||||
delete_default_rules = true
|
||||
}
|
||||
|
||||
module "k8s" {
|
||||
source = "./rules/k8s"
|
||||
secgroup_id = "${openstack_networking_secgroup_v2.k8s.id}"
|
||||
cluster_cidr = "${var.cluster_cidr}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_v2" "k8s_nodes" {
|
||||
name = "${var.cluster_name}_k8s_nodes"
|
||||
description = "Ports needed by Kubernetes nodes"
|
||||
delete_default_rules = true
|
||||
}
|
||||
|
||||
module "k8s_nodes" {
|
||||
source = "./rules/k8s_nodes"
|
||||
secgroup_id = "${openstack_networking_secgroup_v2.k8s_nodes.id}"
|
||||
cluster_cidr = "${var.cluster_cidr}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_v2" "etcd" {
|
||||
name = "${var.cluster_name}_etcd"
|
||||
description = "Ports needed by etcd"
|
||||
delete_default_rules = true
|
||||
}
|
||||
|
||||
module "etcd" {
|
||||
source = "./rules/etcd"
|
||||
secgroup_id = "${openstack_networking_secgroup_v2.etcd.id}"
|
||||
cluster_cidr = "${var.cluster_cidr}"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "cluster_cidr" {
|
||||
type = "string"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
resource "tls_private_key" "core" {
|
||||
algorithm = "RSA"
|
||||
}
|
||||
|
||||
resource "openstack_compute_keypair_v2" "k8s_keypair" {
|
||||
name = "${var.cluster_name}_keypair"
|
||||
public_key = "${tls_private_key.core.public_key_openssh}"
|
||||
}
|
||||
|
||||
resource "null_resource" "export" {
|
||||
provisioner "local-exec" {
|
||||
command = "echo '${tls_private_key.core.private_key_pem}' >id_rsa_core && chmod 0600 id_rsa_core"
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "echo '${tls_private_key.core.public_key_openssh}' >id_rsa_core.pub"
|
||||
}
|
||||
}
|
||||
|
||||
data "ignition_user" "core" {
|
||||
name = "core"
|
||||
|
||||
ssh_authorized_keys = [
|
||||
"${tls_private_key.core.public_key_openssh}",
|
||||
]
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// The name of the cluster.
|
||||
// The openstack keypairs will be prefixed with this.
|
||||
variable "cluster_name" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
output "core_private_key_pem" {
|
||||
value = "${tls_private_key.core.private_key_pem}"
|
||||
}
|
||||
|
||||
output "core_public_key_openssh" {
|
||||
value = "${tls_private_key.core.public_key_openssh}"
|
||||
}
|
||||
@@ -24,7 +24,7 @@ data "template_file" "etcd_hostname_list" {
|
||||
}
|
||||
|
||||
module "bootkube" {
|
||||
source = "../../modules/bootkube-ut2"
|
||||
source = "../../modules/bootkube"
|
||||
cloud_provider = "aws"
|
||||
|
||||
cluster_name = "${var.tectonic_cluster_name}"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# PLATFORMS is a dict matching {"name": "src", ...}.
|
||||
PLATFORMS = {}
|
||||
PLATFORMS["aws"] = "//:steps"
|
||||
Reference in New Issue
Block a user