bare-metal: Add support for Calico networking

* Add variable networking with "flannel" or "calico"
This commit is contained in:
Dalton Hubble 2017-09-01 14:23:25 -07:00
parent 64435adbc3
commit 6ef326a872
3 changed files with 9 additions and 1 deletions

View File

@ -1,11 +1,12 @@
# Self-hosted Kubernetes assets (kubeconfig, manifests) # Self-hosted Kubernetes assets (kubeconfig, manifests)
module "bootkube" { module "bootkube" {
source = "git::https://github.com/poseidon/bootkube-terraform.git?ref=v0.6.1" source = "git::https://github.com/poseidon/bootkube-terraform.git?ref=a52f99e8cc8b395cf2b28f74a9f79c01b63e99ae"
cluster_name = "${var.cluster_name}" cluster_name = "${var.cluster_name}"
api_servers = ["${var.k8s_domain_name}"] api_servers = ["${var.k8s_domain_name}"]
etcd_servers = ["${var.controller_domains}"] etcd_servers = ["${var.controller_domains}"]
asset_dir = "${var.asset_dir}" asset_dir = "${var.asset_dir}"
networking = "${var.networking}"
pod_cidr = "${var.pod_cidr}" pod_cidr = "${var.pod_cidr}"
service_cidr = "${var.service_cidr}" service_cidr = "${var.service_cidr}"
experimental_self_hosted_etcd = "${var.experimental_self_hosted_etcd}" experimental_self_hosted_etcd = "${var.experimental_self_hosted_etcd}"

View File

@ -153,6 +153,7 @@ storage:
# Wrapper for bootkube start # Wrapper for bootkube start
set -e set -e
# Move experimental manifests # Move experimental manifests
[ -d /opt/bootkube/assets/manifests-* ] && mv /opt/bootkube/assets/manifests-*/* /opt/bootkube/assets/manifests && rm -rf /opt/bootkube/assets/manifests-*
[ -d /opt/bootkube/assets/experimental/manifests ] && mv /opt/bootkube/assets/experimental/manifests/* /opt/bootkube/assets/manifests && rm -r /opt/bootkube/assets/experimental/manifests [ -d /opt/bootkube/assets/experimental/manifests ] && mv /opt/bootkube/assets/experimental/manifests/* /opt/bootkube/assets/manifests && rm -r /opt/bootkube/assets/experimental/manifests
[ -d /opt/bootkube/assets/experimental/bootstrap-manifests ] && mv /opt/bootkube/assets/experimental/bootstrap-manifests/* /opt/bootkube/assets/bootstrap-manifests && rm -r /opt/bootkube/assets/experimental/bootstrap-manifests [ -d /opt/bootkube/assets/experimental/bootstrap-manifests ] && mv /opt/bootkube/assets/experimental/bootstrap-manifests/* /opt/bootkube/assets/bootstrap-manifests && rm -r /opt/bootkube/assets/experimental/bootstrap-manifests
BOOTKUBE_ACI="${BOOTKUBE_ACI:-quay.io/coreos/bootkube}" BOOTKUBE_ACI="${BOOTKUBE_ACI:-quay.io/coreos/bootkube}"

View File

@ -62,6 +62,12 @@ variable "asset_dir" {
type = "string" type = "string"
} }
variable "networking" {
description = "Choice of networking provider (flannel or calico)"
type = "string"
default = "flannel"
}
variable "pod_cidr" { variable "pod_cidr" {
description = "CIDR IP range to assign Kubernetes pods" description = "CIDR IP range to assign Kubernetes pods"
type = "string" type = "string"