Add robot creds

This commit is contained in:
Serge Logvinov
2022-07-14 10:20:28 +03:00
parent 5b559d5d1d
commit cdc8d9c74f
4 changed files with 28 additions and 0 deletions

View File

@@ -88,3 +88,13 @@ spec:
key: network
- name: HCLOUD_INSTANCES_ADDRESS_FAMILY
value: dualstack
- name: ROBOT_USER_NAME
valueFrom:
secretKeyRef:
name: hcloud
key: user
- name: ROBOT_PASSWORD
valueFrom:
secretKeyRef:
name: hcloud
key: password

View File

@@ -25,6 +25,8 @@ resource "hcloud_server" "controlplane" {
lbv6 = local.lbv6
hcloud_network = hcloud_network.main.id
hcloud_token = var.hcloud_token
robot_user = var.robot_user
robot_password = var.robot_password
labels = "topology.kubernetes.io/region=${element(var.regions, count.index)}"
})
)

View File

@@ -132,6 +132,8 @@ cluster:
data:
network: ${base64encode(hcloud_network)}
token: ${base64encode(hcloud_token)}
user: ${base64encode(robot_user)}
password: ${base64encode(robot_password)}
externalCloudProvider:
enabled: true
manifests:

View File

@@ -5,6 +5,20 @@ variable "hcloud_token" {
sensitive = true
}
variable "robot_user" {
description = "The hezner cloud token (export TF_VAR_robot_user=$USER)"
type = string
default = ""
sensitive = true
}
variable "robot_password" {
description = "The hezner cloud token (export TF_VAR_robot_password=$PASSWORD)"
type = string
default = ""
sensitive = true
}
variable "regions" {
description = "The id of the hezner region (oreder is important)"
type = list(string)