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

error: can't use Helm Release with unreachable cluster. Reason: "unable to load schema information from the API server: Get \"https://10.0.1.20:6443/openapi/v2?timeout=32s\": dial tcp 10.0.1.20:6443: connect: no route to host" #1794

Closed
mitchellmaler opened this issue Nov 11, 2021 · 1 comment · Fixed by #1886
Assignees
Labels
area/helm helm-release-ga-blockers Items blocking Helm Release GA kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/S Estimated effort to complete (1-2 days).
Milestone

Comments

@mitchellmaler
Copy link

Issue details

I am using the new Release resource but I am unable to use it in the same up prior to the kubernetes control-plane and provider being created. It tries to connect to a cluster that hasn't been built yet and errors on the preview.

     Type                                                               Name                                                                 Plan       Info
     pulumi:pulumi:Stack                                                homelab-iac-main
 +   ├─ pkg:index:k3sNode                                               k3s-cp-01                                                            create
 +   │  ├─ pulumi-python:dynamic:Resource                               k3s-cp-01-ignition                                                   create
 +   │  ├─ pulumi-python:dynamic:Resource                               k3s-cp-01-before-node                                                create
 +   │  ├─ vsphere:index:VirtualMachine                                 k3s-cp-01                                                            create
 +   │  └─ pulumi-python:dynamic:Resource                               k3s-cp-01-after-node                                                 create
 +   ├─ pulumi:providers:kubernetes                                     k8s-cluster-provider                                                 create
     └─ kubernetes:helm.sh/v3:Release                                   truenas-iscsi-csi                                                               1 error

Diagnostics:
  kubernetes:helm.sh/v3:Release (truenas-iscsi-csi):
    error: can't use Helm Release with unreachable cluster. Reason: "unable to load schema information from the API server: Get \"https://10.0.1.20:6443/openapi/v2?timeout=32s\": dial tcp 10.0.1.20:6443: connect: no route to host"

I have my provider and the release setup to depend on the node resources but that doesn't seem to make a difference

k3s_cp_01 = K3sNode(
    name="k3s-cp-01",
    args=K3sNodeArgs(
        token=k3s_cluster_token,
        cluster_api_ip=k3s_cluster_ip,
        cluster_api_fqdn=k3s_cluster_fqdn,
        node_folder=k3s_cluster_folder,
        admin_kube_config=admin_kube_config,
        node_ip=k3s_cluster_ip,
        server=True,
        initial_server=True,
        server_ca_cert=k3s_cluster_server_ca,
        server_ca_key=k3s_cluster_server_ca_key,
        client_ca_cert=k3s_cluster_client_ca,
        client_ca_key=k3s_cluster_client_ca_key,
    ),
)


kubernetes_provider = pulumi_kubernetes.Provider(
    resource_name="k8s-cluster-provider",
    args=pulumi_kubernetes.ProviderArgs(
        kubeconfig=admin_kube_config.kube_config, enable_dry_run=True
    ),
    opts=ResourceOptions(depends_on=[k3s_cp_01.vm, k3s_cp_01.node_manager_after_node]),
)

truenas_iscsi_csi = Release(
    resource_name="truenas-iscsi-csi",
    args=ReleaseArgs(
        repository_opts=RepositoryOptsArgs(
            repo="https://democratic-csi.github.io/charts/",
        ),
        values=truenas_iscsi_csi_values,
        chart="democratic-csi",
        name="democratic-csi",
        namespace="kube-system",
    ),
    opts=ResourceOptions(
        delete_before_replace=True,
        provider=kubernetes_provider,
        depends_on=snapshotter_resources + [k3s_cp_01.node_manager_after_node],
    ),
)

Steps to reproduce

  1. Setup code to create a control-plane, provider, and deploy a release
  2. run up

Expected: The Release preview to ignore that the cluster doesn't exist yet since the control-plane node and provider is being created in the same run
Actual: tries to connect to a none existing control-plane api

@mitchellmaler mitchellmaler added the kind/bug Some behavior is incorrect or out of spec label Nov 11, 2021
@mikhailshilkov mikhailshilkov added this to the 0.65 milestone Nov 15, 2021
@mikhailshilkov mikhailshilkov added helm-release-ga-blockers Items blocking Helm Release GA size/S Estimated effort to complete (1-2 days). labels Nov 15, 2021
@mikhailshilkov mikhailshilkov modified the milestones: 0.65, 0.66 Dec 7, 2021
@leezen leezen modified the milestones: 0.66, 0.67 Jan 5, 2022
@viveklak viveklak self-assigned this Jan 8, 2022
@leezen leezen modified the milestones: 0.67, 0.68 Jan 24, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jan 26, 2022
@emirozmen07
Copy link

I'm still having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm helm-release-ga-blockers Items blocking Helm Release GA kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/S Estimated effort to complete (1-2 days).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants