<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>6. Your own complex Helm chart on Helm Basics Training</title><link>/docs/06/</link><description>Recent content in 6. Your own complex Helm chart on Helm Basics Training</description><generator>Hugo</generator><language>en</language><atom:link href="/docs/06/index.xml" rel="self" type="application/rss+xml"/><item><title>6.1 Deploy your awesome application</title><link>/docs/06/01_deploy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/01_deploy/</guid><description>&lt;p>Using the generated and modified Helm chart, we are going to deploy our own awesome application.&lt;/p>
&lt;h2 id="task-611-deploy-the-chart">Task 6.1.1: Deploy the chart&lt;/h2>
&lt;p>Let&amp;rsquo;s deploy our awesome application. Therefore we need to adjust ingress configuriation in the values file.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">ingress&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">enabled&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">true&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">hosts&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">host&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">helm-complex-chart-&amp;lt;namespace&amp;gt;.training.cluster.acend.ch&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">paths&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">path&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">/&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">pathType&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">ImplementationSpecific&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">tls&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">hosts&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#000">helm-complex-chart-&amp;lt;namespace&amp;gt;.training.cluster.acend.ch&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="solution">Solution&lt;/h3>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
&lt;p>Don’t forget to replace &lt;code>training.cluster.acend.ch&lt;/code> with the value provided by the trainer.&lt;/p></description></item><item><title>6.2 Template the database backend</title><link>/docs/06/02_database/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/02_database/</guid><description>&lt;p>In this lab we are going to templates the resources that are necessary to deploy a MariaDB database as a backend to our &lt;code>example-web-python&lt;/code> application. Before we start creating those templates we want to have a look at a couple of best practices.&lt;/p>
&lt;h2 id="resource-names">Resource names&lt;/h2>
&lt;p>When looking at the app templates of our &lt;code>mychart&lt;/code> chart, the name of the resource is always defined by a helper function:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">name&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>{{&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">include &amp;#34;helm-complex-chart.fullname&amp;#34; . }}&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Resources within the same Namespace and of the same resource type must have unique names. Since a Helm chart can be instantiated multiple times in different releases, it&amp;rsquo;s best to include the release name as part of the resource name:&lt;/p></description></item><item><title>6.3 Backend as a Dependency</title><link>/docs/06/03_database-dependency/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/03_database-dependency/</guid><description>&lt;p>In the previous lab we&amp;rsquo;ve manually added a database deployment to our awesome application. Instead of creating your own templates and deployments, we can also integrate other helm charts as dependencies. We have seen this already in lab 3 but are now going to go into more detail in this lab.&lt;/p>
&lt;h2 id="helm-dependencies">Helm Dependencies&lt;/h2>
&lt;p>Helm dependencies allow you to integrate other helm charts within your helm chart. It helps to reduce code duplication and to centralize certain functionality and to simply use well maintained helm charts in your deployments.&lt;/p></description></item><item><title>6.4 Test</title><link>/docs/06/04_tests/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/04_tests/</guid><description>&lt;h2 id="task-641-add-a-test-to-your-chart">Task 6.4.1: Add a test to your chart&lt;/h2>
&lt;p>As we learned in the previous section, Helm gives us the availability to run automated tests during the Helm deployment.
Now it&amp;rsquo;s time to write our first test.
The test should meet the following requirements:&lt;/p>
&lt;ul>
&lt;li>Image: mariadb&lt;/li>
&lt;li>Env Variables:
&lt;ul>
&lt;li>&lt;code>MYSQL_DATABASE_HOST&lt;/code> from secret&lt;/li>
&lt;li>&lt;code>MYSQL_DATABASE_USER&lt;/code> from secret&lt;/li>
&lt;li>&lt;code>MYSQL_DATABASE_PASSWORD&lt;/code> from secret&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Command: &lt;code>mysql --host=$MYSQL_DATABASE_HOST --user=$MYSQL_DATABASE_USER --password=$MYSQL_DATABASE_PASSWORD&lt;/code>&lt;/li>
&lt;li>Annotation: &lt;code>helm.sh/hook: test&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Open the test file &lt;code>templates/tests/test-connection.yaml&lt;/code> and start to modify it.&lt;/p></description></item><item><title>6.5 Helm hooks</title><link>/docs/06/05_hooks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/05_hooks/</guid><description>&lt;p>In the previous lab we learned how to deploy our python example application and connect it to a MariaDB. In this chapter we are going to look at a mechanism of Helm called hooks, which let&amp;rsquo;s chart developers intervene / interact at certain points in a release&amp;rsquo;s life cycle.&lt;/p>
&lt;h2 id="task-651-chart-hooks">Task 6.5.1: Chart Hooks&lt;/h2>
&lt;p>At some point when developing helm charts we would like to interact or alter certain behaviour of our deployed resources. For example in this usecase we would like to have test data available in our database when releasing our chart. With the hook functionality of helm we can alter the life cycle and intervene at certain points. Hooks are regular templates specially annotated that causes Helm to utilize them differently. The tests used in the previous chapter are a special case of helm hooks. The following hooks are available for you to alter the behaviour of the chart:&lt;/p></description></item><item><title>6.6 Deploy your Chart with different environment configurations</title><link>/docs/06/06_environment/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/06_environment/</guid><description>&lt;p>One of the most typical challenges when deploying an application is the handling of different deployment environments.&lt;/p>
&lt;p>A typical use case is to deploy your application into a Development and Production environment. Helm is a great solution for handling this challenge.
In this lab we are going to show you how to prepare your Helm releases for different environments.&lt;/p>
&lt;h2 id="task-661-create-a-devlopment-release">Task 6.6.1 Create a devlopment release&lt;/h2>
&lt;p>Let us start with a new value file for the Development environment. Create a new file called &lt;code>values-dev.yaml&lt;/code> and add following content to the file&lt;/p></description></item><item><title>6.7 Optional: Publish your chart</title><link>/docs/06/07_publish/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/06/07_publish/</guid><description>&lt;p>In this lab we will learn how to publish our Helm chart and make it accessible to the public by using GitHub pages.&lt;/p>


&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

To work through this lab, you need a personal GitHub account. See &lt;a href="https://helm.sh/docs/topics/chart_repository#hosting-chart-repositories" target="_blank" rel="noopener">Hosting chart repositories&lt;/a>
 for a lot of different strategies how to serve a Helm repository.

&lt;/div>

&lt;p>GitHub pages provides an easy way to expose static files over HTTP(S) to the public. Everyone with a GitHub account can use this feature. The files to expose must be located in the &lt;code>docs/&lt;/code> subdirectory or on a separate branch which can be configured in the repository settings.&lt;/p></description></item></channel></rss>