https://pulumi.com logo
#general
Title
# general
v

victorious-vase-44805

05/28/2020, 9:35 PM
I am having an issue installing Rancher on a freshly created cluster (that was spun up using jaxxstorm/pulumi-rke). I get the following: kubernetes:certmanager.k8s.io:Issuer (rancher/rancher): error: creation of resource rancher/rancher failed because the Kubernetes API server reported that the apiVersion for this resource does not exist. Verify that any required CRDs have been created: no matches for kind “Issuer” in version “certmanager.k8s.io/v1alpha1
Copy code
export function setUpK8sProvider(rkeCluster: rke.Cluster): k8s.Provider {
  return new k8s.Provider("rancherCluster", {
    cluster: rkeCluster.clusterName,
    kubeconfig: rkeCluster.kubeConfigYaml
  }, { dependsOn: rkeCluster })
}

export function createNamespace(clusterProvider: k8s.Provider): k8s.core.v1.Namespace {
  return new k8s.core.v1.Namespace("cert-manager", {
    metadata: {
      name: "cert-manager",
      labels: {"<http://certmanager.k8s.io/disable-validation|certmanager.k8s.io/disable-validation>": "true" }
    }
  }, { provider: clusterProvider, dependsOn: [clusterProvider] })
}

export function createCertManager(certManagerNamespace: k8s.core.v1.Namespace, clusterProvider: k8s.Provider): k8s.helm.v3.Chart {
  return new k8s.helm.v2.Chart(
    'cert-manager',
    {
      chart: 'cert-manager',
      version: 'v0.15.1',
      namespace: certManagerNamespace.metadata.name,
      values: {
        installCRDs: true,
      },
      fetchOpts: {
        repo: '<https://charts.jetstack.io>',
      },
    },
    {
      dependsOn: certManagerNamespace,
      provider: clusterProvider
    },
  );
}

export function createRancherServer(serverName: string, clusterProvider: k8s.Provider, certManager: k8s.helm.v3.Chart): k8s.helm.v3.Chart {
  let namespace = new k8s.core.v1.Namespace("rancher", {
    metadata: {
      name: "rancher",
    }
  }, { provider: clusterProvider, dependsOn: [certManager] })

  return new k8s.helm.v2.Chart(serverName, {
    chart: "rancher",
    namespace: namespace.metadata.name,
    fetchOpts: {
      repo: "<https://releases.rancher.com/server-charts/stable>"
    },
    values: {
      "hostname": "<http://rancher.mydomain.com|rancher.mydomain.com>",
      "ingress.tls.source": "letsEncrypt",
      "letsEncrypt.email": "<mailto:myemail@mydomain.com|myemail@mydomain.com>"
    }
  }, { provider: clusterProvider, dependsOn: [namespace] })
}
Any idea where I’m going wrong perhaps?
c

creamy-potato-29402

05/28/2020, 9:38 PM
the answer says what went wrong, you don’t have the
Issuer
CRD installed.
it might be an option in the helm chart’s values or it might be a precondition.
b

billowy-army-68599

05/28/2020, 9:48 PM
which version of helm are you using? the latest kubernetes provider should install the CRDs for you if you're using
helm v3.1+
c

creamy-potato-29402

05/28/2020, 9:50 PM
the helm hooks “worked” in 2 also because of retries, fwiw
v

victorious-vase-44805

05/29/2020, 7:16 AM
Thanks for the responses @billowy-army-68599 @creamy-potato-29402 I am using version: version.BuildInfo{Version:“v3.2.1”, GitCommit:“fe51cd1e31e6a202cba7dead9552a6d418ded79a”, GitTreeState:“clean”, GoVersion:“go1.13.10"} I figured it would install the CRD for me because I set installCRDs to true
3 Views