Fix: add another output CLUSTER_ID for Alibaba Cloud ack (#2543)

To support sub-path of a git repo which stores HCLs, also update the dependency
of Terraform controller
This commit is contained in:
Zheng Xi Zhou
2021-10-24 10:02:39 +08:00
committed by GitHub
parent 17dbf6de7e
commit e9ac4bb62f
30 changed files with 267 additions and 585 deletions
+3
View File
@@ -115,6 +115,9 @@ type Terraform struct {
// +kubebuilder:validation:Enum:=hcl;json;remote
Type string `json:"type,omitempty"`
// Path is the sub-directory of remote git repository. It's valid when remote is set
Path string `json:"path,omitempty"`
// ProviderReference specifies the reference to Provider
ProviderReference *types.Reference `json:"providerRef,omitempty"`
}
@@ -188,6 +188,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -468,6 +472,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -193,6 +193,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -454,6 +458,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -1248,6 +1248,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1651,6 +1655,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1952,6 +1960,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3392,6 +3404,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3688,6 +3704,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4073,6 +4093,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4337,6 +4361,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4617,6 +4645,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -179,6 +179,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -463,6 +467,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -222,6 +222,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -506,6 +510,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -783,6 +791,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1041,6 +1053,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -151,6 +151,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -188,6 +188,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -468,6 +472,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -148,6 +148,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -193,6 +193,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -454,6 +458,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -23,7 +23,7 @@ data:
chart: terraform-controller
repoType: helm
url: https://charts.kubevela.net/addons
version: 0.2.4
version: 0.2.5
type: helm
- name: alibaba-ack
properties:
@@ -40,199 +40,9 @@ data:
spec:
schematic:
terraform:
configuration: |
module "kubernetes" {
source = "github.com/zzxwill/terraform-alicloud-kubernetes"
new_nat_gateway = true
vpc_name = var.vpc_name
vpc_cidr = var.vpc_cidr
vswitch_name_prefix = var.vswitch_name_prefix
vswitch_cidrs = var.vswitch_cidrs
master_instance_types = var.master_instance_types
worker_instance_types = var.worker_instance_types
k8s_pod_cidr = var.k8s_pod_cidr
k8s_service_cidr = var.k8s_service_cidr
k8s_worker_number = var.k8s_worker_number
cpu_core_count = var.cpu_core_count
memory_size = var.memory_size
zone_id = var.zone_id
k8s_version = var.k8s_version
k8s_name_prefix = var.k8s_name_prefix
}
######################
# Instance types variables
######################
variable "cpu_core_count" {
description = "CPU core count is used to fetch instance types."
type = number
default = 4
}
variable "memory_size" {
description = "Memory size used to fetch instance types."
type = number
default = 8
}
######################
# VPC variables
######################
variable "vpc_name" {
description = "The vpc name used to create a new vpc when 'vpc_id' is not specified. Default to variable `example_name`"
type = string
default = "tf-k8s-vpc"
}
variable "vpc_cidr" {
description = "The cidr block used to launch a new vpc when 'vpc_id' is not specified."
type = string
default = "10.0.0.0/8"
}
######################
# VSwitch variables
######################
variable "vswitch_name_prefix" {
type = string
description = "The vswitch name prefix used to create several new vswitches. Default to variable 'example_name'."
default = "tf-k8s-vsw"
}
variable "number_format" {
description = "The number format used to output."
type = string
default = "%02d"
}
variable "vswitch_ids" {
description = "List of existing vswitch id."
type = list
default = []
}
variable "vswitch_cidrs" {
description = "List of cidr blocks used to create several new vswitches when 'vswitch_ids' is not specified."
type = list
default = [
"10.1.0.0/16",
"10.2.0.0/16",
"10.3.0.0/16"]
}
variable "k8s_name_prefix" {
description = "The name prefix used to create several kubernetes clusters. Default to variable `example_name`"
type = string
default = "poc"
}
variable "new_nat_gateway" {
type = bool
description = "Whether to create a new nat gateway. In this template, a new nat gateway will create a nat gateway, eip and server snat entries."
default = true
}
variable "master_instance_types" {
description = "The ecs instance types used to launch master nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c5.xlarge",
"ecs.n4.xlarge",
# "ecs.n1.large",
# "ecs.sn1.large",
# "ecs.s6-c1m2.xlarge",
# "ecs.c6e.xlarge"
]
}
variable "worker_instance_types" {
description = "The ecs instance types used to launch worker nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c6e.xlarge",
"ecs.n4.xlarge",
// "ecs.n1.large",
// "ecs.sn1.large",
// "ecs.s6-c1m2.xlarge"
]
}
variable "node_cidr_mask" {
type = number
description = "The node cidr block to specific how many pods can run on single node. Valid values: [24-28]."
default = 24
}
variable "enable_ssh" {
description = "Enable login to the node through SSH."
type = bool
default = true
}
variable "install_cloud_monitor" {
description = "Install cloud monitor agent on ECS."
type = bool
default = true
}
variable "cpu_policy" {
type = string
description = "kubelet cpu policy. Valid values: 'none','static'. Default to 'none'."
default = "none"
}
variable "proxy_mode" {
description = "Proxy mode is option of kube-proxy. Valid values: 'ipvs','iptables'. Default to 'iptables'."
type = string
default = "iptables"
}
variable "password" {
description = "The password of ECS instance."
type = string
default = "Just4Test"
}
variable "k8s_worker_number" {
description = "The number of worker nodes in kubernetes cluster."
type = number
default = 2
}
# k8s_pod_cidr is only for flannel network
variable "k8s_pod_cidr" {
description = "The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them."
type = string
default = "172.20.0.0/16"
}
variable "k8s_service_cidr" {
description = "The kubernetes service cidr block. It cannot be equals to vpc's or vswitch's or pod's and cannot be in them."
type = string
default = "192.168.0.0/16"
}
variable "k8s_version" {
description = "The version of the kubernetes version. Valid values: '1.16.6-aliyun.1','1.14.8-aliyun.1'. Default to '1.16.6-aliyun.1'."
type = string
default = "1.20.4-aliyun.1"
}
variable "zone_id" {
description = "Availability Zone ID"
type = string
default = "cn-hongkong-b"
# "cn-beijing-a"
}
output "name" {
value = module.kubernetes.name
}
output "kubeconfig" {
value = module.kubernetes.kubeconfig
}
output "cluster_ca_cert" {
value = module.kubernetes.cluster_ca_cert
}
output "client_cert" {
value = module.kubernetes.client_cert
}
output "client_key" {
value = module.kubernetes.client_key
}
output "api_server_internet" {
value = module.kubernetes.api_server_internet
}
configuration: https://github.com/kubevela-contrib/terraform-modules.git
path: alibaba/cs/dedicated-kubernetes
type: remote
workload:
definition:
apiVersion: terraform.core.oam.dev/v1beta1
@@ -1248,6 +1248,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1651,6 +1655,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1952,6 +1960,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3392,6 +3404,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3688,6 +3704,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4073,6 +4093,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4337,6 +4361,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4617,6 +4645,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -222,6 +222,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -506,6 +510,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -783,6 +791,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1041,6 +1053,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -151,6 +151,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -188,6 +188,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -468,6 +472,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -148,6 +148,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -193,6 +193,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -454,6 +458,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
+1 -1
View File
@@ -35,7 +35,7 @@ require (
github.com/mitchellh/hashstructure/v2 v2.0.1
github.com/oam-dev/cluster-gateway v1.1.2
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28
github.com/oam-dev/terraform-controller v0.2.4
github.com/oam-dev/terraform-controller v0.2.5
github.com/olekukonko/tablewriter v0.0.5
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.16.0
+2 -2
View File
@@ -1207,8 +1207,8 @@ github.com/oam-dev/stern v1.13.0-alpha h1:EVjM8Qvh6LssB6t4RZrjf9DtCq1cz+/cy6OF7f
github.com/oam-dev/stern v1.13.0-alpha/go.mod h1:AOkvfFUv0Arz7GBi0jz7S0Jsu4K/kdvSjNsnRt1+BIg=
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 h1:tD8HiFKnt0jnwdTWjeqUnfnUYLD/+Nsmj8ZGIxqDWiU=
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28/go.mod h1:Mu8i0/DdplvnjwRbAYPsc8+LRR27n/mp8VWdkN10GzE=
github.com/oam-dev/terraform-controller v0.2.4 h1:yGgIzm2EWNghuRutnChrRfhMjdlU/jE/cLfBizCgE24=
github.com/oam-dev/terraform-controller v0.2.4/go.mod h1:wd4rnqnJzz274Sg1/qoeIhBx1rvTZ/ECzXoMff0ucR0=
github.com/oam-dev/terraform-controller v0.2.5 h1:ntSyLUZkjvyHPJEuSYGvsa5+Sb3fDXkqoS+iD3avHQo=
github.com/oam-dev/terraform-controller v0.2.5/go.mod h1:wd4rnqnJzz274Sg1/qoeIhBx1rvTZ/ECzXoMff0ucR0=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
@@ -1248,6 +1248,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1651,6 +1655,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1952,6 +1960,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3392,6 +3404,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -3688,6 +3704,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4073,6 +4093,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4337,6 +4361,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -4617,6 +4645,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote
git repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -179,6 +179,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -463,6 +467,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -222,6 +222,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -506,6 +510,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -783,6 +791,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -1041,6 +1053,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
@@ -151,6 +151,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -188,6 +188,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -468,6 +472,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -148,6 +148,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -193,6 +193,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
@@ -454,6 +458,10 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
+1
View File
@@ -669,6 +669,7 @@ func generateTerraformConfigurationWorkload(wl *Workload, ns string) (*unstructu
configuration.Spec.JSON = wl.FullTemplate.Terraform.Configuration
case "remote":
configuration.Spec.Remote = wl.FullTemplate.Terraform.Configuration
configuration.Spec.Path = wl.FullTemplate.Terraform.Path
}
if wl.FullTemplate.Terraform.ProviderReference != nil {
+4 -194
View File
@@ -20,7 +20,7 @@ spec:
chart: terraform-controller
repoType: helm
url: https://charts.kubevela.net/addons
version: 0.2.4
version: 0.2.5
type: helm
- name: alibaba-ack
properties:
@@ -37,199 +37,9 @@ spec:
spec:
schematic:
terraform:
configuration: |
module "kubernetes" {
source = "github.com/zzxwill/terraform-alicloud-kubernetes"
new_nat_gateway = true
vpc_name = var.vpc_name
vpc_cidr = var.vpc_cidr
vswitch_name_prefix = var.vswitch_name_prefix
vswitch_cidrs = var.vswitch_cidrs
master_instance_types = var.master_instance_types
worker_instance_types = var.worker_instance_types
k8s_pod_cidr = var.k8s_pod_cidr
k8s_service_cidr = var.k8s_service_cidr
k8s_worker_number = var.k8s_worker_number
cpu_core_count = var.cpu_core_count
memory_size = var.memory_size
zone_id = var.zone_id
k8s_version = var.k8s_version
k8s_name_prefix = var.k8s_name_prefix
}
######################
# Instance types variables
######################
variable "cpu_core_count" {
description = "CPU core count is used to fetch instance types."
type = number
default = 4
}
variable "memory_size" {
description = "Memory size used to fetch instance types."
type = number
default = 8
}
######################
# VPC variables
######################
variable "vpc_name" {
description = "The vpc name used to create a new vpc when 'vpc_id' is not specified. Default to variable `example_name`"
type = string
default = "tf-k8s-vpc"
}
variable "vpc_cidr" {
description = "The cidr block used to launch a new vpc when 'vpc_id' is not specified."
type = string
default = "10.0.0.0/8"
}
######################
# VSwitch variables
######################
variable "vswitch_name_prefix" {
type = string
description = "The vswitch name prefix used to create several new vswitches. Default to variable 'example_name'."
default = "tf-k8s-vsw"
}
variable "number_format" {
description = "The number format used to output."
type = string
default = "%02d"
}
variable "vswitch_ids" {
description = "List of existing vswitch id."
type = list
default = []
}
variable "vswitch_cidrs" {
description = "List of cidr blocks used to create several new vswitches when 'vswitch_ids' is not specified."
type = list
default = [
"10.1.0.0/16",
"10.2.0.0/16",
"10.3.0.0/16"]
}
variable "k8s_name_prefix" {
description = "The name prefix used to create several kubernetes clusters. Default to variable `example_name`"
type = string
default = "poc"
}
variable "new_nat_gateway" {
type = bool
description = "Whether to create a new nat gateway. In this template, a new nat gateway will create a nat gateway, eip and server snat entries."
default = true
}
variable "master_instance_types" {
description = "The ecs instance types used to launch master nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c5.xlarge",
"ecs.n4.xlarge",
# "ecs.n1.large",
# "ecs.sn1.large",
# "ecs.s6-c1m2.xlarge",
# "ecs.c6e.xlarge"
]
}
variable "worker_instance_types" {
description = "The ecs instance types used to launch worker nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c6e.xlarge",
"ecs.n4.xlarge",
// "ecs.n1.large",
// "ecs.sn1.large",
// "ecs.s6-c1m2.xlarge"
]
}
variable "node_cidr_mask" {
type = number
description = "The node cidr block to specific how many pods can run on single node. Valid values: [24-28]."
default = 24
}
variable "enable_ssh" {
description = "Enable login to the node through SSH."
type = bool
default = true
}
variable "install_cloud_monitor" {
description = "Install cloud monitor agent on ECS."
type = bool
default = true
}
variable "cpu_policy" {
type = string
description = "kubelet cpu policy. Valid values: 'none','static'. Default to 'none'."
default = "none"
}
variable "proxy_mode" {
description = "Proxy mode is option of kube-proxy. Valid values: 'ipvs','iptables'. Default to 'iptables'."
type = string
default = "iptables"
}
variable "password" {
description = "The password of ECS instance."
type = string
default = "Just4Test"
}
variable "k8s_worker_number" {
description = "The number of worker nodes in kubernetes cluster."
type = number
default = 2
}
# k8s_pod_cidr is only for flannel network
variable "k8s_pod_cidr" {
description = "The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them."
type = string
default = "172.20.0.0/16"
}
variable "k8s_service_cidr" {
description = "The kubernetes service cidr block. It cannot be equals to vpc's or vswitch's or pod's and cannot be in them."
type = string
default = "192.168.0.0/16"
}
variable "k8s_version" {
description = "The version of the kubernetes version. Valid values: '1.16.6-aliyun.1','1.14.8-aliyun.1'. Default to '1.16.6-aliyun.1'."
type = string
default = "1.20.4-aliyun.1"
}
variable "zone_id" {
description = "Availability Zone ID"
type = string
default = "cn-hongkong-b"
# "cn-beijing-a"
}
output "name" {
value = module.kubernetes.name
}
output "kubeconfig" {
value = module.kubernetes.kubeconfig
}
output "cluster_ca_cert" {
value = module.kubernetes.cluster_ca_cert
}
output "client_cert" {
value = module.kubernetes.client_cert
}
output "client_key" {
value = module.kubernetes.client_key
}
output "api_server_internet" {
value = module.kubernetes.api_server_internet
}
configuration: https://github.com/kubevela-contrib/terraform-modules.git
path: alibaba/cs/dedicated-kubernetes
type: remote
workload:
definition:
apiVersion: terraform.core.oam.dev/v1beta1
@@ -14,196 +14,6 @@ spec:
kind: Configuration
schematic:
terraform:
configuration: |
module "kubernetes" {
source = "github.com/zzxwill/terraform-alicloud-kubernetes"
new_nat_gateway = true
vpc_name = var.vpc_name
vpc_cidr = var.vpc_cidr
vswitch_name_prefix = var.vswitch_name_prefix
vswitch_cidrs = var.vswitch_cidrs
master_instance_types = var.master_instance_types
worker_instance_types = var.worker_instance_types
k8s_pod_cidr = var.k8s_pod_cidr
k8s_service_cidr = var.k8s_service_cidr
k8s_worker_number = var.k8s_worker_number
cpu_core_count = var.cpu_core_count
memory_size = var.memory_size
zone_id = var.zone_id
k8s_version = var.k8s_version
k8s_name_prefix = var.k8s_name_prefix
}
######################
# Instance types variables
######################
variable "cpu_core_count" {
description = "CPU core count is used to fetch instance types."
type = number
default = 4
}
variable "memory_size" {
description = "Memory size used to fetch instance types."
type = number
default = 8
}
######################
# VPC variables
######################
variable "vpc_name" {
description = "The vpc name used to create a new vpc when 'vpc_id' is not specified. Default to variable `example_name`"
type = string
default = "tf-k8s-vpc"
}
variable "vpc_cidr" {
description = "The cidr block used to launch a new vpc when 'vpc_id' is not specified."
type = string
default = "10.0.0.0/8"
}
######################
# VSwitch variables
######################
variable "vswitch_name_prefix" {
type = string
description = "The vswitch name prefix used to create several new vswitches. Default to variable 'example_name'."
default = "tf-k8s-vsw"
}
variable "number_format" {
description = "The number format used to output."
type = string
default = "%02d"
}
variable "vswitch_ids" {
description = "List of existing vswitch id."
type = list
default = []
}
variable "vswitch_cidrs" {
description = "List of cidr blocks used to create several new vswitches when 'vswitch_ids' is not specified."
type = list
default = [
"10.1.0.0/16",
"10.2.0.0/16",
"10.3.0.0/16"]
}
variable "k8s_name_prefix" {
description = "The name prefix used to create several kubernetes clusters. Default to variable `example_name`"
type = string
default = "poc"
}
variable "new_nat_gateway" {
type = bool
description = "Whether to create a new nat gateway. In this template, a new nat gateway will create a nat gateway, eip and server snat entries."
default = true
}
variable "master_instance_types" {
description = "The ecs instance types used to launch master nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c5.xlarge",
"ecs.n4.xlarge",
# "ecs.n1.large",
# "ecs.sn1.large",
# "ecs.s6-c1m2.xlarge",
# "ecs.c6e.xlarge"
]
}
variable "worker_instance_types" {
description = "The ecs instance types used to launch worker nodes."
type = list
default = [
# hongkong
"ecs.sn1ne.xlarge",
# hongkong
"ecs.c6.xlarge",
# hongkong
"ecs.c4.xlarge",
# hongkong
"ecs.c6e.xlarge",
"ecs.n4.xlarge",
// "ecs.n1.large",
// "ecs.sn1.large",
// "ecs.s6-c1m2.xlarge"
]
}
variable "node_cidr_mask" {
type = number
description = "The node cidr block to specific how many pods can run on single node. Valid values: [24-28]."
default = 24
}
variable "enable_ssh" {
description = "Enable login to the node through SSH."
type = bool
default = true
}
variable "install_cloud_monitor" {
description = "Install cloud monitor agent on ECS."
type = bool
default = true
}
variable "cpu_policy" {
type = string
description = "kubelet cpu policy. Valid values: 'none','static'. Default to 'none'."
default = "none"
}
variable "proxy_mode" {
description = "Proxy mode is option of kube-proxy. Valid values: 'ipvs','iptables'. Default to 'iptables'."
type = string
default = "iptables"
}
variable "password" {
description = "The password of ECS instance."
type = string
default = "Just4Test"
}
variable "k8s_worker_number" {
description = "The number of worker nodes in kubernetes cluster."
type = number
default = 2
}
# k8s_pod_cidr is only for flannel network
variable "k8s_pod_cidr" {
description = "The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them."
type = string
default = "172.20.0.0/16"
}
variable "k8s_service_cidr" {
description = "The kubernetes service cidr block. It cannot be equals to vpc's or vswitch's or pod's and cannot be in them."
type = string
default = "192.168.0.0/16"
}
variable "k8s_version" {
description = "The version of the kubernetes version. Valid values: '1.16.6-aliyun.1','1.14.8-aliyun.1'. Default to '1.16.6-aliyun.1'."
type = string
default = "1.20.4-aliyun.1"
}
variable "zone_id" {
description = "Availability Zone ID"
type = string
default = "cn-hongkong-b"
# "cn-beijing-a"
}
output "name" {
value = module.kubernetes.name
}
output "kubeconfig" {
value = module.kubernetes.kubeconfig
}
output "cluster_ca_cert" {
value = module.kubernetes.cluster_ca_cert
}
output "client_cert" {
value = module.kubernetes.client_cert
}
output "client_key" {
value = module.kubernetes.client_key
}
output "api_server_internet" {
value = module.kubernetes.api_server_internet
}
configuration: https://github.com/kubevela-contrib/terraform-modules.git
type: remote
path: alibaba/cs/dedicated-kubernetes
@@ -33,7 +33,7 @@ spec:
repoType: helm
url: https://charts.kubevela.net/addons
chart: terraform-controller
version: 0.2.4
version: 0.2.5
{{ range .ResourceFiles }}
- name: {{ .Name }}
type: raw