<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Depado</title>
    <description>The latest articles on DEV Community by Depado (@depado).</description>
    <link>https://dev.to/depado</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F30146%2F1ce550e6-3127-42b3-8f98-089b63f34ef9.jpeg</url>
      <title>DEV Community: Depado</title>
      <link>https://dev.to/depado</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/depado"/>
    <language>en</language>
    <item>
      <title>CI/CD with Drone, Kubernetes and Helm - Part 1</title>
      <dc:creator>Depado</dc:creator>
      <pubDate>Wed, 06 Jun 2018 09:30:18 +0000</pubDate>
      <link>https://dev.to/depado/cicd-with-drone-kubernetes-and-helm---part-1-4mdp</link>
      <guid>https://dev.to/depado/cicd-with-drone-kubernetes-and-helm---part-1-4mdp</guid>
      <description>&lt;p&gt;This article is a repost from my blog. &lt;a href="https://blog.depado.eu/post/ci-cd-with-drone-kubernetes-and-helm-1"&gt;Find the original post here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Continuous integration and delivery is hard. This is a fact everyone can agree on. But now we have all this wonderful technology and the problems are mainly "How do I plug this with that?" or "How do I make these two products work together?"&lt;/p&gt;

&lt;p&gt;Well, there's &lt;strong&gt;never&lt;/strong&gt; a simple and universal answer to these questions. In this article series we'll progressively build a complete pipeline for continuous integration and delivery using three popular products, namely Kubernetes, Helm and Drone.&lt;/p&gt;

&lt;p&gt;This first article acts as an introduction to the various technology used throughout the series. It is intended for beginners that have some knowledge of Docker, how a container works and the basics of Kubernetes. You can entirely skip it if you have a running k8s cluster and a running Drone instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a Kubernetes cluster with GKE&lt;/li&gt;
&lt;li&gt;Create a service account for Tiller&lt;/li&gt;
&lt;li&gt;Initialize Helm&lt;/li&gt;
&lt;li&gt;Add a repo to Helm&lt;/li&gt;
&lt;li&gt;Deploy Drone on the new k8s cluster&lt;/li&gt;
&lt;li&gt;Enable HTTPS on our new Drone instance&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technology involved
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Drone
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://drone.io/"&gt;Drone&lt;/a&gt; is a Continuous Delivery platform built on Docker and written in Go. Drone uses a simple YAML configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers.&lt;/p&gt;

&lt;p&gt;It has the same approach as &lt;a href="https://travis-ci.org/"&gt;Travis&lt;/a&gt;, where you define your pipeline as code in your repository. The cool feature is that every step in your pipeline is executed in a Docker container. This may seem counter-intuitive at first but it enables a great plugin system: Every plugin for Drone you might&lt;br&gt;
use is a Docker image, which Drone will pull when needed. You have nothing to install directly in Drone as you would do with Jenkins for example.&lt;/p&gt;

&lt;p&gt;Another benefit of running inside Docker is that the &lt;a href="http://docs.drone.io/installation/"&gt;installation procedure&lt;/a&gt; for Drone is really simple. But we're not going to install Drone on a bare-metal server or inside a&lt;br&gt;
VM. More on that later in the tutorial.&lt;/p&gt;
&lt;h3&gt;
  
  
  Kubernetes
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Kubernetes (commonly stylized as K8s) is an open-source container-orchestration system for automating deployment, scaling and management of containerized applications that was originally designed by Google and now maintained by the Cloud Native Computing Foundation. It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts". It works with a range of container tools, including Docker. &lt;cite&gt;&lt;a href="https://en.wikipedia.org/wiki/Kubernetes"&gt;Wikipedia&lt;/a&gt; &lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Wikipedia summarizes k8s pretty well. Basically k8s abstracts the underlying machines on which it runs and offers a platform where we can deploy our applications. It is in charge of distributing our containers correctly on&lt;br&gt;
different nodes so if one node shuts down or is disconnected from the network, the application is still accessible while k8s works to repair the node or provisions a new one for us.&lt;/p&gt;

&lt;p&gt;I recommend at least reading &lt;a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/"&gt;Kubernetes Basics&lt;/a&gt; for this tutorial.&lt;/p&gt;
&lt;h3&gt;
  
  
  Helm
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://helm.sh/"&gt;Helm&lt;/a&gt; is the package manager for Kubernetes. It allows us to create, maintain and deploy applications in a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;Basically if you want to install something in your Kubernetes cluster you can check if there's a Chart for it. For example we're going to use the Chart for Drone to deploy it.&lt;/p&gt;

&lt;p&gt;Helm allows you to deploy your application to different namespaces, change the tag of your image and basically override every parameter you can put in your Kubernetes deployment files when running it. This means you can use the same chart to deploy your application in your staging environment and in production simply by overriding some values on the command line or in a values file.&lt;/p&gt;

&lt;p&gt;In this article we'll see how to use a preexisting chart. In the next one we'll see how to create one from scratch.&lt;/p&gt;
&lt;h2&gt;
  
  
  Disclaimers
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we'll use &lt;a href="https://cloud.google.com"&gt;Google Cloud Platform&lt;/a&gt; because it allows to create Kubernetes clusters easily and has a private container registry which we'll use later.&lt;/p&gt;
&lt;h1&gt;
  
  
  Kubernetes Cluster
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;You can skip this step if you already own a k8s cluster with a Kubernetes version above 1.8.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this step we'll need the &lt;code&gt;gcloud&lt;/code&gt; and &lt;code&gt;kubectl&lt;/code&gt; CLI. Check out how to &lt;a href="https://cloud.google.com/sdk/downloads"&gt;install the Google Cloud SDK&lt;/a&gt; for your operating system.&lt;/p&gt;

&lt;p&gt;As said earlier, this tutorial isn't about creating and maintaining a Kubernetes cluster. As such we're going to use &lt;a href="https://cloud.google.com/kubernetes-engine/"&gt;Google Kubernetes Engine&lt;/a&gt; to create our playground cluster. There are two options to create it: either in the web interface offered by GCP, or directly using the &lt;code&gt;gcloud&lt;/code&gt; command. At the time of writing, the default version of k8s offered by Google is &lt;code&gt;1.8.8&lt;/code&gt;, but as long as you're above &lt;code&gt;1.8&lt;/code&gt; you can pick whichever version you want.&lt;em&gt;Even though there's no reason not to pick the highest stable version...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;1.8&lt;/code&gt; choice is because in this version &lt;a href="https://en.wikipedia.org/wiki/Role-based_access_control"&gt;RBAC&lt;/a&gt; is activated by default and is the default authentication system.&lt;/p&gt;

&lt;p&gt;To reduce the cost of your cluster you can modify the machine type, but try to keep at least 3 nodes; this will allow zero-downtime migrations to different machine types and upgrade k8s version if you ever want to keep this cluster active and running.&lt;/p&gt;

&lt;p&gt;To verify if your cluster is running, you can check the output of the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ gcloud container clusters list
NAME       LOCATION        MASTER_VERSION  MASTER_IP    MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
mycluster  europe-west1-b  1.10.2-gke.1    &amp;lt;master ip&amp;gt;  custom-1-2048  1.10.2-gke.1  3          RUNNING
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should also get the &lt;code&gt;MASTER_IP&lt;/code&gt;, &lt;code&gt;PROJECT&lt;/code&gt;, and the &lt;code&gt;LOCATION&lt;/code&gt; which I removed from this snippet. From now on in the code snippets and command line examples, &lt;code&gt;$LOCATION&lt;/code&gt; will refer to your cluster's location, &lt;code&gt;$NAME&lt;/code&gt; will refer to your cluster's name, and &lt;code&gt;$PROJECT&lt;/code&gt; will refer to your GCP project.&lt;/p&gt;

&lt;p&gt;Once your cluster is running, you can then issue the following command to retrieve the credentials to connect to your cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ gcloud container clusters get-credentials $NAME --zone $LOCATION --project $PROJECT
Fetching cluster endpoint and auth data.
kubeconfig entry generated for mycluster.
$ kubectl cluster-info
Kubernetes master is running at https://&amp;lt;master ip&amp;gt;
GLBCDefaultBackend is running at https://&amp;lt;master ip&amp;gt;/api/v1/namespaces/kube-system/services/default-http-backend/proxy
Heapster is running at https://&amp;lt;master ip&amp;gt;/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://&amp;lt;master ip&amp;gt;/api/v1/namespaces/kube-system/services/kube-dns/proxy
kubernetes-dashboard is running at https://&amp;lt;master ip&amp;gt;/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy
Metrics-server is running at https://&amp;lt;master ip&amp;gt;/api/v1/namespaces/kube-system/services/metrics-server/proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;kubectl&lt;/code&gt; is configured to operate on your cluster. The last command will print out all the information you need to know about where your cluster is located.&lt;/p&gt;

&lt;h1&gt;
  
  
  Helm and Tiller
&lt;/h1&gt;

&lt;p&gt;First of all we'll need the &lt;code&gt;helm&lt;/code&gt; command. &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/install.md"&gt;See this page for installation instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Helm is actually composed of two parts. Helm itself is the client, and Tiller is the server. Tiller needs to be installed in our k8s cluster so Helm can work with it, but first we're going to need a &lt;strong&gt;service account&lt;/strong&gt; for Tiller. Tiller must be able to interact with our k8s cluster, so it needs to be able to create deployments, configmaps, secrets, and so on. Welcome to &lt;strong&gt;RBAC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So let's create a file named &lt;code&gt;tiller-rbac-config.yaml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;--------&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ServiceAccount&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tiller&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;

&lt;span class="s"&gt;--------&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io/v1beta1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterRoleBinding&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tiller&lt;/span&gt;
&lt;span class="na"&gt;roleRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;apiGroup&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io&lt;/span&gt;
  &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterRole&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cluster-admin&lt;/span&gt;
&lt;span class="na"&gt;subjects&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ServiceAccount&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tiller&lt;/span&gt;
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this yaml file we're declaring a &lt;a href="https://kubernetes.io/docs/admin/authorization/rbac/#service-account-permissions"&gt;ServiceAccount&lt;/a&gt; named tiller, and then we're declaring a &lt;a href="https://kubernetes.io/docs/admin/authorization/rbac/#rolebinding-and-clusterrolebinding"&gt;ClusterRoleBinding&lt;/a&gt; which associates the tiller service account to the cluster-admin authorization.&lt;/p&gt;

&lt;p&gt;Now we can deploy tiller using the service account we just created like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ helm init --service-account tiller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M9uRscKq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.depado.eu/assets/kube-drone-helm/tiller-service.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M9uRscKq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.depado.eu/assets/kube-drone-helm/tiller-service.png" alt="tiller-service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that it's not necessarily good practice to deploy tiller this way. Using RBAC, we can limit the actions Tiller can execute in our cluster and the namespaces it can act on. &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/rbac.md"&gt;See this documentation&lt;/a&gt; to see how to use RBAC to restrict or modify the behavior of Tiller in your k8s cluster.&lt;/p&gt;

&lt;p&gt;This step is really important for the following parts of this series, as we'll later use this service account to interact with k8s from Drone.&lt;/p&gt;

&lt;h1&gt;
  
  
  Deploying Drone
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Static IP
&lt;/h2&gt;

&lt;p&gt;If you have a domain name and wish to associate a subdomain to your Drone instance, you will have to create an external IP address in your Google Cloud console. Give it a name and remember that name, we'll use it right after when configuring the Drone chart. &lt;/p&gt;

&lt;p&gt;Associate this static IP with your domain (and keep in mind DNS propagation can take some time).&lt;/p&gt;

&lt;p&gt;For the sake of this article, the external IP address name will be &lt;code&gt;drone-kube&lt;/code&gt; and the domain will be &lt;code&gt;drone.myhost.io&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration
&lt;/h2&gt;

&lt;p&gt;First we need to setup Github integration for our Drone instance. Have a look at &lt;a href="http://docs.drone.io/install-for-github/"&gt;this documentation&lt;/a&gt; or if you're using another version control system, check in the Drone documentation how to create the proper integration. Currently, Drone supports the following VCS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-github/"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-gitlab/"&gt;GitLab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-gitea/"&gt;Gitea&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-gogs/"&gt;Gogs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-bitbucket-cloud/"&gt;Bitbucket Cloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-bitbucket-server/"&gt;Bitbucket Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.drone.io/install-for-coding/"&gt;Coding&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep in mind that if you're not using the Github integration, the changes in the environment variables in the next section need to match.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chart and configuration
&lt;/h2&gt;

&lt;p&gt;After a quick Google search, we can see there's a &lt;a href="https://github.com/kubernetes/charts/tree/master/incubator/drone"&gt;Chart for Drone&lt;/a&gt;. And it's in the &lt;code&gt;incubator&lt;/code&gt; of Helm charts, so first we need to add the repo to Helm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
$ helm repo update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that it's done, we can have a look at the &lt;a href="https://github.com/kubernetes/charts/tree/master/incubator/drone#configuration"&gt;configuration&lt;/a&gt; part for this Chart. We'll create a &lt;code&gt;values.yaml&lt;/code&gt; file that will contain the required information for our Drone instance to work properly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;httpPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
  &lt;span class="na"&gt;nodePort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32015&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodePort&lt;/span&gt;
&lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gce"&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.global-static-ip-name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drone-kube"&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.allow-http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
  &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt;
&lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://drone.myhost.io"&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_PROVIDER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;github"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_OPEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;false"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_ADMIN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;me"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB_CLIENT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;the&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;github&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;client&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secret&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;you&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;created&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;earlier"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB_SECRET&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;same&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;thing&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;the&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secret"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alright! We have our static IP associated with our domain. We have to put the name of this reserved IP in the Ingress' annotations so it knows to which IP it should bind. We're going to use a GCE load balancer, and since we don't have a TLS certificate, we're going to tell Ingress that it's OK to accept HTTP connections. (Please don't hit me, I promise we'll see how to enable TLS later.)&lt;/p&gt;

&lt;p&gt;We also declare all the variables used by Drone itself to communicate with our VCS, in this case Github.&lt;/p&gt;

&lt;p&gt;That's it. We're ready. Let's fire up Helm!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ helm install --name mydrone -f values.yaml incubator/drone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Given that your DNS record is now propagated, you should be able to access your Drone instance using the &lt;code&gt;drone.myhost.io&lt;/code&gt; URL!&lt;/p&gt;

&lt;h1&gt;
  
  
  TLS
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Deploying cert-manager
&lt;/h2&gt;

&lt;p&gt;In the past, we had &lt;a href="https://github.com/jetstack/kube-lego"&gt;kube-lego&lt;/a&gt; which is now deprecated in favor of &lt;a href="https://github.com/jetstack/cert-manager/"&gt;cert-manager&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cert-manager.readthedocs.io/en/latest/getting-started/2-installing.html"&gt;The documentation&lt;/a&gt; states that installing cert-manager is as easy as running this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ helm install --name cert-manager --namespace kube-system stable/cert-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating an ACME Issuer
&lt;/h2&gt;

&lt;p&gt;Cert-manager is composed of several components. It uses what's called &lt;a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/"&gt;Custom Resource Definitions&lt;/a&gt; and allows to use &lt;code&gt;kubectl&lt;/code&gt; to control the certificates, issuers and so on.&lt;/p&gt;

&lt;p&gt;An &lt;a href="https://cert-manager.readthedocs.io/en/latest/reference/issuers.html"&gt;Issuer&lt;/a&gt; or &lt;a href="https://cert-manager.readthedocs.io/en/latest/reference/clusterissuers.html"&gt;ClusterIssuer&lt;/a&gt; represents a certificate authority from which x509 certificates can be obtained.&lt;/p&gt;

&lt;p&gt;The difference between an Issuer and a ClusterIssuer is that the Issuer can only manage certificates in its own namespace and be called from within that namespace. The ClusterIssuer doesn't depend on a specific namespace.&lt;/p&gt;

&lt;p&gt;We're going to create a Let'sEncrypt ClusterIssuer so we can issue a certificate for our Drone instance and for our future deployments. Let's create a file named &lt;code&gt;acme-issuer.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;certmanager.k8s.io/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIssuer&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;letsencrypt&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;acme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://acme-v01.api.letsencrypt.org/directory&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;your.email.address@gmail.com&lt;/span&gt;
    &lt;span class="na"&gt;privateKeySecretRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;letsencrypt-production&lt;/span&gt;
    &lt;span class="na"&gt;http01&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we're creating the ClusterIssuer with the HTTP challenge enabled. We're only going to see this challenge in this article, refer to the &lt;a href="https://cert-manager.readthedocs.io/en/latest/"&gt;documentation&lt;/a&gt; for more information about challenges. &lt;strong&gt;Remember to change the associated email address in your issuer !&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl apply -f acme-issuer.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also create a ClusterIssuer using Let'sEncrypt staging environment which is more permissive with errors on requests. If you want to test out without issuing true certificates, use this one instead. Create a new file &lt;code&gt;acme-staging-issuer.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;certmanager.k8s.io/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIssuer&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;letsencrypt-staging&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;acme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://acme-staging.api.letsencrypt.org/directory&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;your.email.address@gmail.com&lt;/span&gt;
    &lt;span class="na"&gt;privateKeySecretRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;letsencrypt-staging&lt;/span&gt;
    &lt;span class="na"&gt;http01&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl apply -f acme-staging-issuer.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Certificate
&lt;/h2&gt;

&lt;p&gt;Now that we have our ClusterIssuer that is using the production of Let'sEncrypt, we can create a manifest that will solve the ACME challenge for us. First we're going to need the name of the ingress created by the Drone chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl get ingress
NAME            HOSTS             ADDRESS       PORTS     AGE
mydrone-drone   drone.myhost.io   xx.xx.xx.xx   80        1h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have this information, let's create the &lt;code&gt;drone-cert.yaml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;certmanager.k8s.io/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Certificate&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mydrone-drone&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;secretName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mydrone-drone-tls&lt;/span&gt;
  &lt;span class="na"&gt;issuerRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;letsencrypt&lt;/span&gt; &lt;span class="c1"&gt;# This is where you put the name of your issuer&lt;/span&gt;
    &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIssuer&lt;/span&gt;
  &lt;span class="na"&gt;commonName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt; &lt;span class="c1"&gt;# Used for SAN&lt;/span&gt;
  &lt;span class="na"&gt;dnsNames&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt;
  &lt;span class="na"&gt;acme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http01&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mydrone-drone&lt;/span&gt; &lt;span class="c1"&gt;# The name of your ingress&lt;/span&gt;
      &lt;span class="na"&gt;domains&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are many fields to explain here. Most of them are pretty explicit and can be found &lt;a href="http://cert-manager.readthedocs.io/en/latest/tutorials/acme/http-validation.html"&gt;in the documentation&lt;/a&gt; about HTTP validation.&lt;/p&gt;

&lt;p&gt;The important things here are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;spec.secretName&lt;/code&gt;: The secret in which the certificate will be stored. Usually
this will be prefixed with &lt;code&gt;-tls&lt;/code&gt; so it doesn't get mixed up with other 
secrets.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;spec.issuerRef.name&lt;/code&gt;: The named we defined earlier for our ClusterIssuer&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;spec.issuerRef.kind&lt;/code&gt;: Specify that the issuer is a ClusterIssuer&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;spec.acme.config.http01.ingress&lt;/code&gt;: The name of the ingress deployed with Drone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's apply this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl apply -f drone-cert.yaml
$ kubectl get certificate
NAME            AGE
mydrone-drone   7m
$ kubectl describe certificate mydrone-drone
...
Events:
  Type     Reason                 Age              From                     Message
  ----     ------                 ----             ----                     -------
  Warning  ErrorCheckCertificate  33s              cert-manager-controller  Error checking existing TLS certificate: secret "mydrone-drone-tls" not found
  Normal   PrepareCertificate     33s              cert-manager-controller  Preparing certificate with issuer
  Normal   PresentChallenge       33s              cert-manager-controller  Presenting http-01 challenge for domain drone.myhost.io
  Normal   SelfCheck              32s              cert-manager-controller  Performing self-check for domain drone.myhost.io
  Normal   ObtainAuthorization    6s               cert-manager-controller  Obtained authorization for domain drone.myhost.io
  Normal   IssueCertificate       6s               cert-manager-controller  Issuing certificate...
  Normal   CertificateIssued      5s               cert-manager-controller  Certificate issued successfully
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to wait for this last line to appear, the &lt;code&gt;CertificateIssued&lt;/code&gt; event before we can update our Ingress' values. This can take some time, be patient as Google Cloud Load Balancers can take several minutes to update.&lt;/p&gt;

&lt;h2&gt;
  
  
  Upgrade Drone's Values
&lt;/h2&gt;

&lt;p&gt;Now that we have our secret containing the proper TLS certificate, we can go back to our &lt;code&gt;values.yaml&lt;/code&gt; file we used earlier to deploy Drone with its Chart and add the TLS secret to the ingress section ! We're also going to disable HTTP on our ingress (only HTTPS will be served), and modify our &lt;code&gt;server.host&lt;/code&gt; value to reflect this HTTPS change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;httpPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
  &lt;span class="na"&gt;nodePort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32015&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodePort&lt;/span&gt;
&lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gce"&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.global-static-ip-name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drone-kube"&lt;/span&gt;
    &lt;span class="s"&gt;kubernetes.io/ingress.allow-http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;false"&lt;/span&gt; &lt;span class="c1"&gt;# ← Let's disable HTTP and allow only HTTPS&lt;/span&gt;
  &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt;
  &lt;span class="c1"&gt;# Add this ↓&lt;/span&gt;
  &lt;span class="na"&gt;tls&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;drone.myhost.io&lt;/span&gt;
      &lt;span class="na"&gt;secretName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mydrone-drone-tls&lt;/span&gt;
  &lt;span class="c1"&gt;# End&lt;/span&gt;
&lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://drone.myhost.io"&lt;/span&gt; &lt;span class="c1"&gt;# ← Modify this too &lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_PROVIDER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;github"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_OPEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;false"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_ADMIN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;me"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB_CLIENT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;the&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;github&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;client&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secret&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;you&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;created&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;earlier"&lt;/span&gt;
    &lt;span class="na"&gt;DRONE_GITHUB_SECRET&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;same&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;thing&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;the&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secret"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we just have to upgrade our deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ helm upgrade mydrone -f values.yaml incubator/drone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're going to have to modify your Github application too. &lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article we saw how to deploy a Kubernetes cluster on GKE, how to create a service account with the proper cluster role binding to deploy Tiller, how to use helm and how to deploy a chart with the example of drone.&lt;/p&gt;

&lt;p&gt;In the next article we'll see how to write a quality pipeline for a Go project as well as how to push to Google Cloud Registry.&lt;/p&gt;

&lt;h1&gt;
  
  
  Thanks
&lt;/h1&gt;

&lt;p&gt;Thanks to &lt;a href="https://twitter.com/shirley_leu"&gt;@shirley_leu&lt;/a&gt; for proofreading this article and correcting my english mistakes !&lt;/p&gt;

&lt;p&gt;This article is a repost from my blog. &lt;a href="https://blog.depado.eu/post/ci-cd-with-drone-kubernetes-and-helm-1"&gt;Find the original post here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>drone</category>
      <category>helm</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
