Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work - always fails with cannot create Rest Client #130

Closed
markussiebert opened this issue Nov 8, 2022 · 3 comments · Fixed by #134
Closed

Does not work - always fails with cannot create Rest Client #130

markussiebert opened this issue Nov 8, 2022 · 3 comments · Fixed by #134

Comments

@markussiebert
Copy link
Contributor

maybe related to hashicorp/terraform-provider-kubernetes-alpha#217 ?

always fails with ```bash
│ Error: Failed to construct REST client

│ with kubernetes_manifest.Cdk8sApply_Cdk8sApply-metalsiderodev--v1alpha1-ServerClass-proxmox-vm-default_0C20A47B (Cdk8sApply/Cdk8sApply-metal.sidero.dev--v1alpha1-ServerClass-proxmox-vm-default),
│ on cdk.tf.json line 121, in resource.kubernetes_manifest.Cdk8sApply_Cdk8sApply-metalsiderodev--v1alpha1-ServerClass-proxmox-vm-default_0C20A47B (Cdk8sApply/Cdk8sApply-metal.sidero.dev--v1alpha1-ServerClass-proxmox-vm-default):
│ 121: }

│ cannot create REST client: no client config


my config looks like 

```ts
  console.log(kubeconfig.filename)
  new CDK8sProvider(this, 'Cdk8sApply', {
    cdk8sApp: cdk8sApp,
    configPath: path.join(__dirname, '../kubeconfig/sidero-single-node'),
    configContext: 'admin@SideroTalosCluster',
  });
@DanielMSchmidt
Copy link
Contributor

Yeah seems to be this issue: hashicorp/terraform-provider-kubernetes#1775

@markussiebert
Copy link
Contributor Author

markussiebert commented Nov 9, 2022

But in my case, there is no reference or lookup - just plain link to config_file.

Any ideas?

My config looks like:

"provider": {
    "kubernetes": [
      {
        "alias": "cdktf-cdk8s-Cdk8sApply",
        "config_path": "/Users/.../github/lab/kubeconfig/sidero-single-node",
        "insecure": true
      }
    ],
    "sops": [
      {
      }
    ]
  },

if I export the config file via environment variable, it works :-/

@markussiebert
Copy link
Contributor Author

Ok, got it - the created provider was never used, because you set an alias. With this small change it works on my machine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants