<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Optional: 7. Create your own chart on IT-CNE Cloud-Native Core</title>
		<link>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/</link>
		<description>Recent content in Optional: 7. Create your own chart on IT-CNE Cloud-Native Core</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<atom:link href="https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>7.1 Refactor 1</title>
				<link>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/01_refactor_1/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/01_refactor_1/</guid>
				<description>&lt;h2 id=&#34;task-711-make-the-ingress-resource-more-configurable&#34;&gt;Task 7.1.1: Make the Ingress resource more configurable&lt;/h2&gt;&#xA;&lt;p&gt;After cloning the repository and inspecting the templates already created for you, you will notice some potential for improvement. For example the hostname of the applications should not be hard-coded. When deploying to multiple environments you will run into conflicts.&lt;/p&gt;&#xA;&lt;p&gt;Modify the &lt;strong&gt;consumer and producer&lt;/strong&gt; ingress templates and extract following variables to make them configurable:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extract &lt;code&gt;.spec.rules.host&lt;/code&gt; as value&lt;/li&gt;&#xA;&lt;li&gt;Extract &lt;code&gt;.spec.tls.hosts[0]&lt;/code&gt; as value, use the same value as above&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34;&gt;&lt;div class=&#34;h4 alert-heading&#34; role=&#34;heading&#34;&gt;Note&lt;/div&gt;&#xA;&lt;p&gt;If you want to test the chart locally you can execute following command&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;helm template -s templates/consumer-ingress.yaml ./helm-basic-chart --debug | cat -n -&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/div&gt;</description>
			</item>
			<item>
				<title>7.2 Refactor 2</title>
				<link>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/02_refactor_2/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/02_refactor_2/</guid>
				<description>&lt;p&gt;If you take a closer look at your Chart you will still recognize some weak spots. For example the producer and consumer will look like a lot of code duplication. We don&amp;rsquo;t like code duplication at all! The only big difference is the &lt;code&gt;&amp;quot;consumer&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;producer&amp;quot;&lt;/code&gt; pre- or suffixed everywhere.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Just for fun:&lt;/strong&gt; How much lines of code are actually different?&lt;/p&gt;&#xA;&lt;details &gt;&#xA;  &lt;summary&gt;Hint / Solution&lt;/summary&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;bc -l &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;diff -U0 templates/consumer-deployment.yaml templates/producer-deployment.yaml | wc -l&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;/2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/details&gt;&#xA;&lt;p&gt;When considering the differences and how they affect the service, we can easily see the flaw of this Chart. The entire Chart is a duplication. Both services could use the same Chart and just be two instances / releases!&lt;/p&gt;</description>
			</item>
			<item>
				<title>7.3 Composition</title>
				<link>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/03_composition/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://kubernetes.tbz.pstark.ch/en/modul/2_unterrichtsressourcen/02-helm/exercises/07/03_composition/</guid>
				<description>&lt;p&gt;Instead of instantiating the Chart two times manually by hand, we can also define a composition of two Charts in a single Chart. In other 2words we create a new Helm Chart and add the Chart we just wrote twice as a dependency to the chart.&lt;/p&gt;&#xA;&lt;p&gt;In Helm we can make a composition of already existing Charts and own templates and define it as a new Chart. This is a very common use case if we mix self created resources with own templated resources.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
