Skip to content

Commit fedc681

Browse files
committed
add kube config and other certificate path parameters
1 parent 8d42aa1 commit fedc681

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 1.2.0 (Unreleased)
1+
## 1.3.0 (Unreleased)
2+
## 1.2.0 (December 3, 2019)
3+
4+
IMPROVEMENTS:
5+
6+
- add kube config and other certificate path parameters [GH-6](https://github.com/terraform-alicloud-modules/terraform-alicloud-managed-kubernetes/pull/6)
7+
28
## 1.1.0 (December 3, 2019)
39

410
BUG FIXES:

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,24 @@ This moudle can set [sls project](https://www.terraform.io/docs/providers/aliclo
7070
```
7171
7272
1. Using existing sls project with `sls_project_name`:
73-
```hcl
73+
```hcl-terraform
7474
sls_project_name = "Your-sls-project-name"
7575
```
7676
77+
If you want to store kube config and other certificates after the cluster created, you can set the following parameters:
78+
79+
1. Store kube config with `kube_config_path`:
80+
```hcl-terraform
81+
kube_config_path = "/home/xxx/.kube/config"
82+
```
83+
84+
1. Store more certificates`:
85+
```hcl-terraform
86+
client_cert_path = "/home/xxx/.kube/client-cert.pem"
87+
client_key_path = "/home/xxx/.kube/client-key.pem"
88+
cluster_ca_cert_path = "/home/xxx/.kube/cluster-ca-cert.pem"
89+
```
90+
7791
## Inputs
7892
7993
| Name | Description | Type | Default | Required |
@@ -102,6 +116,10 @@ This moudle can set [sls project](https://www.terraform.io/docs/providers/aliclo
102116
| cluster_network_type | Network type, valid options are `flannel` and `terway` | string | "flannel" | no |
103117
| new_sls_project | Create a new sls project for this module | bool | false | no |
104118
| sls_project_name | Specify a existing sls project for this module | string | "" | no |
119+
| kube_config_path | The path of kube config, like ~/.kube/config | string | "" | no |
120+
| client_cert_path | The path of client certificate, like ~/.kube/client-cert.pem | string | "" | no |
121+
| client_key_path | The path of client key, like ~/.kube/client-key.pem | string | "" | no |
122+
| cluster_ca_cert_path | The path of cluster ca certificate, like ~/.kube/cluster-ca-cert.pem | string | "" | no |
105123
106124
## Outputs
107125

main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@ resource "alicloud_cs_managed_kubernetes" "this" {
3333
type = "SLS"
3434
project = local.sls_project == "" ? null : local.sls_project
3535
}
36+
kube_config = var.kube_config_path
37+
client_cert = var.client_cert_path
38+
client_key = var.client_key_path
39+
cluster_ca_cert = var.cluster_ca_cert_path
40+
3641
depends_on = [alicloud_snat_entry.new]
3742
}

variables.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ variable "worker_disk_size" {
8686
}
8787

8888
variable "ecs_password" {
89-
description = "The password of work nodes."
89+
description = "The password of worker nodes."
9090
default = "Abc12345"
9191
}
9292

@@ -123,4 +123,21 @@ variable "new_sls_project" {
123123
variable "sls_project_name" {
124124
description = "Specify a existing sls project for this module."
125125
default = ""
126+
}
127+
128+
variable "kube_config_path" {
129+
description = "The path of kube config, like ~/.kube/config"
130+
default = ""
131+
}
132+
variable "client_cert_path" {
133+
description = "The path of client certificate, like ~/.kube/client-cert.pem"
134+
default = ""
135+
}
136+
variable "client_key_path" {
137+
description = "The path of client key, like ~/.kube/client-key.pem"
138+
default = ""
139+
}
140+
variable "cluster_ca_cert_path" {
141+
description = "The path of cluster ca certificate, like ~/.kube/cluster-ca-cert.pem"
142+
default = ""
126143
}

0 commit comments

Comments
 (0)