Hi,
I get some issues with terraform tfstate in kubernetes secrets.
I use terraform
2020/10/12 14:33:03 [INFO] Terraform version: 0.13.3 2020/10/12 14:33:03 [INFO] Go runtime version: go1.14.7
my backend looks like:
terraform {
backend "kubernetes" {
secret_suffix = "rjbfybkm6xqug6p-pxrz10zh4msdkd1-state"
load_config_file = true
config_path = "/home/maathor/.qovery-workspace/2020-10-12T12-04-03-019912115-00-00/databases/mysql-app-db/kubernetes_config_dmubm9agk7sr8a8r"
namespace = "rjbfybkm6xqug6p-pxrz10zh4msdkd1"
exec {
api_version = "client.authentication.k8s.io/v1alpha1"
command = "aws-iam-authenticator"
args = [
"token",
"-i",
"dmubm9agk7sr8a8r"]
env = {
AWS_ACCESS_KEY_ID = "AZERTYUIOP"
AWS_SECRET_ACCESS_KEY = "qsdfghjklm"
}
}
}
}
But i always get this error:
❯ terraform init
2020/10/12 14:35:34 [INFO] Terraform version: 0.13.3
2020/10/12 14:35:34 [INFO] Go runtime version: go1.14.7
2020/10/12 14:35:34 [INFO] CLI args: []string{"/home/maathor/bin/.tfenv/versions/0.13.3/terraform", "init"}
2020/10/12 14:35:34 [DEBUG] Attempting to open CLI config file: /home/maathor/.terraformrc
2020/10/12 14:35:34 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory /home/maathor/.terraform.d/plugins
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory /home/maathor/.local/share/terraform/plugins
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory /usr/share/plasma/terraform/plugins
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2020/10/12 14:35:34 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2020/10/12 14:35:34 [INFO] CLI command args: []string{"init"}
Initializing the backend...
2020/10/12 14:35:34 [TRACE] Meta.Backend: built configuration for "kubernetes" backend with hash value 3405387121
2020/10/12 14:35:34 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/10/12 14:35:34 [DEBUG] New state was assigned lineage "ae70dfdf-dd4f-be32-1c4b-39f56b1f69a1"
2020/10/12 14:35:34 [TRACE] Meta.Backend: moving from default local state only to "kubernetes" backend
[Kubernetes backend] Neither service_account nor load_config_file were set to true,
this could cause issues connecting to your Kubernetes cluster.
2020/10/12 14:35:34 [INFO] Successfully loaded config file (/home/maathor/.qovery-workspace/2020-10-12T12-04-03-019912115-00-00/databases/mysql-app-db/kubernetes_config_dmubm9agk7sr8a8r; default context)
2020/10/12 14:35:34 [DEBUG] checking for provisioner in "."
2020/10/12 14:35:34 [DEBUG] checking for provisioner in "/home/maathor/bin/.tfenv/versions/0.13.3"
2020/10/12 14:35:34 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2020/10/12 14:35:34 [TRACE] backend/local: state manager for workspace "default" will:
- read initial snapshot from terraform.tfstate
- write new snapshots to terraform.tfstate
- create any backup at terraform.tfstate.backup
2020/10/12 14:35:34 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2020/10/12 14:35:34 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2020/10/12 14:35:34 [TRACE] statemgr.Filesystem: read nil snapshot
2020/10/12 14:35:34 [TRACE] Meta.Backend: ignoring local "default" workspace because its state is empty
2020/10/12 14:35:34 [DEBUG] New state was assigned lineage "a1232caa-4672-6a3c-232f-d642256972ff"
2020/10/12 14:35:34 [TRACE] Preserving existing state lineage "a1232caa-4672-6a3c-232f-d642256972ff"
Successfully configured the backend "kubernetes"! Terraform will automatically
use this backend unless the backend configuration changes.
Error: Failed to get existing workspaces: Unauthorized
I can’t manage to make it works !?
My namespace is bran new, It’s my first time attempt.
Keys are good.
What do you think about it ?
Thanks a lot,
marc