<p>I am testing Rancher 2 as a Kubernetes interface. Rancher 2 is launched with docker-compose, using image rancher/rancher:latest.</p>

<p>Everything is Ok for clusters, nodes, pods. Then I try to secure some load balancers with certificates. Do do so, I install cert-manager from the catalog/helm.</p>

<p><a href="https://i.stack.imgur.com/PoG4k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PoG4k.png" alt="enter image description here"></a></p>

<p>I have tried to follow this video tutorial (<a href="https://www.youtube.com/watch?v=xc8Jg9ItDVk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=xc8Jg9ItDVk</a>) which explains how to create an issuer and a certificate, and how to link it to a load balancer.</p>

<p>I create a file for the issuer :</p>

<pre><code>apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
  name: letsencrypt
spec:
  acme:
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    email: root@example.com
    privateKeySecretRef:
      name: letsencrypt-private-key
    http01: {}
</code></pre>

<p>It's time to create the issuer.</p>

<pre><code>sudo docker-compose exec rancher bash
</code></pre>

<p>I am connected to the Rancher container. <code>kubectl</code> and <code>helm</code> are installed.</p>

<p>I try to create the issuer :</p>

<pre><code>kubectl create -f etc/cert-manager/cluster-issuer.yaml
error: unable to recognize "etc/cert-manager/cluster-issuer.yaml": no matches for certmanager.k8s.io/, Kind=ClusterIssuer
</code></pre>

<p>Additional informations :</p>

<p>When I do <code>helm list</code>: </p>

<pre><code>Error: could not find a ready tiller pod
</code></pre>

<p>I get the pods to find tiller :</p>

<pre><code>kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
tiller-deploy-6ffc49c5df-zbjg8   0/1       Pending   0          39m
</code></pre>

<p>I describe this pod :</p>

<pre><code>kubectl describe pod tiller-deploy-6ffc49c5df-zbjg8
Name:           tiller-deploy-6ffc49c5df-zbjg8
Namespace:      default
Node:           &lt;none&gt;
Labels:         app=helm
                name=tiller
                pod-template-hash=2997057189
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"tiller-deploy-6ffc49c5df","uid":"46f74523-7f8f-11e8-9d04-0242ac1...
Status:         Pending
IP:
Created By:     ReplicaSet/tiller-deploy-6ffc49c5df
Controlled By:  ReplicaSet/tiller-deploy-6ffc49c5df
Containers:
  tiller:
    Image:      gcr.io/kubernetes-helm/tiller:v2.8.0-rancher3
    Ports:      44134/TCP, 44135/TCP
    Liveness:   http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
    Readiness:  http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
    Environment:
      TILLER_NAMESPACE:    default
      TILLER_HISTORY_MAX:  0
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from tiller-token-hbfgz (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  tiller-token-hbfgz:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  tiller-token-hbfgz
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.alpha.kubernetes.io/notReady:NoExecute for 300s
                 node.alpha.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age                 From               Message
  ----     ------            ----                ----               -------
  Warning  FailedScheduling  4m (x125 over 39m)  default-scheduler  no nodes available to schedule pods
</code></pre>

<p>This problem is a bit specific : rancher/kubernetes/docker-compose ... If anyone has some ideas, you're welcome ;)</p>

<p>Thanks in advance !</p>

<p>I just found an information to unblock the situation.</p>

<p>Thanks to <a href="https://www.idealcoders.com/posts/rancher/2018/06/rancher-2-x-and-lets-encrypt-with-cert-manager-and-nginx-ingress/" rel="nofollow noreferrer">https://www.idealcoders.com/posts/rancher/2018/06/rancher-2-x-and-lets-encrypt-with-cert-manager-and-nginx-ingress/</a></p>

<p>The first step is to load the cluster's configuration. I was working on the default cluster. So, </p>

<ol>
<li>I execute bash into the docker container, </li>
<li>I load the config file <code>/root/.kube/config</code> </li>
<li>Update the configuration</li>
<li>Go on ... The issuer is correctly created.</li>
</ol>

<p>If it can help someone ;)</p>
