<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Contexts on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/contexts/</link>
    <description>Recent content in Contexts on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo -- 0.147.8</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #213243b1d6e8932079e09227d3f3ed0c806cd0c9</copyright>
    <lastBuildDate>Tue, 01 Nov 2022 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/contexts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>C4 Modeling with PlantUML and AsciiDoc</title>
      <link>https://www.hascode.com/c4-modeling-with-plantuml-and-asciidoc/</link>
      <pubDate>Tue, 01 Nov 2022 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/c4-modeling-with-plantuml-and-asciidoc/</guid>
      <description>&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;C4 models allow us to visualize software architecture by decomposition in containers and components.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Viewpoints are organized in hierarchical levels:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;ulist&#34;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Context Diagrams (Level 1)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Container Diagrams (Level 2)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Component Diagrams (Level 3)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Code Diagrams (Level 4)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/plantuml-stdlib/C4-PlantUML&#34;&gt;C4-PlantUML&lt;/a&gt; offers a variety of macros and stereotypes that make modeling fun.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;An example in &lt;a href=&#34;https://plantuml.com/&#34;&gt;PlantUML&lt;/a&gt;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;title&#34;&gt;sample.puml&lt;/div&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-plantuml&#34; data-lang=&#34;plantuml&#34;&gt;@startuml
!include &amp;lt;c4/C4_Context.puml&amp;gt;
!include &amp;lt;c4/C4_Container.puml&amp;gt;

left to right direction

Person(user, &amp;#34;User&amp;#34;)

System_Ext(auth, &amp;#34;AuthService&amp;#34;, &amp;#34;Provides authentication and authorization via OIDC&amp;#34;)

System_Boundary(zone1, &amp;#34;Some system boundary&amp;#34;) {


    System(lb, &amp;#34;Load Balancer&amp;#34;)

    System_Boundary(az, &amp;#34;App Cluster&amp;#34;) {
        System(app, &amp;#34;App Servers&amp;#34;) {
            Container(app1, &amp;#34;App1&amp;#34;, &amp;#34;Docker&amp;#34;, &amp;#34;Does stuff&amp;#34;)
            Container(app2, &amp;#34;App1&amp;#34;, &amp;#34;Docker&amp;#34;, &amp;#34;Does stuff&amp;#34;)

            ContainerDb(dbSess, &amp;#34;Session DB&amp;#34;, &amp;#34;Redis&amp;#34;)
            ContainerDb(db1, &amp;#34;RBMS 1&amp;#34;, &amp;#34;AWS RDS Postgres&amp;#34;)
            ContainerDb(db2, &amp;#34;RBMS 2&amp;#34;, &amp;#34;AWS RDS Postgres&amp;#34;)

            &amp;#39; both app servers sync sessions via redis
            Rel(app1, dbSess, &amp;#34;Uses&amp;#34;, &amp;#34;Sync Session&amp;#34;)
            Rel(app2, dbSess, &amp;#34;Uses&amp;#34;, &amp;#34;Sync Session&amp;#34;)

            &amp;#39; both app servers persist data in RDBMS
            Rel(app1, db1, &amp;#34;Uses&amp;#34;, &amp;#34;Persist/query relational data&amp;#34;)
            Rel(app2, db2, &amp;#34;Uses&amp;#34;, &amp;#34;Persist/query relational data&amp;#34;)
        }
    }
}

Rel(user, lb, &amp;#34;call&amp;#34;)
Rel(lb, app1, &amp;#34;delegate&amp;#34;)
Rel(lb, app2, &amp;#34;delegate&amp;#34;)
Rel(app1, auth, &amp;#34;Verify&amp;#34;, &amp;#34;User auth&amp;#34;)
Rel(app2, auth, &amp;#34;Verify&amp;#34;, &amp;#34;User auth&amp;#34;)

SHOW_FLOATING_LEGEND()

@enduml&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Kubernetes Snippets</title>
      <link>https://www.hascode.com/kubernetes-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/kubernetes-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_rerun_existing_completed_job&#34;&gt;Rerun existing completed Job&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;admonitionblock caution&#34;&gt;
&lt;table&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td class=&#34;icon&#34;&gt;
&lt;i class=&#34;fa icon-caution&#34; title=&#34;Caution&#34;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&#34;content&#34;&gt;
kubectl replace deletes the old job, if there is any error, your job definition is lost, don’t forget to save it first!
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;title&#34;&gt;Replace an existing Job with itself&lt;/div&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get job JOBNAME -o yaml | kubectl replace --force -f -&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;admonitionblock tip&#34;&gt;
&lt;table&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td class=&#34;icon&#34;&gt;
&lt;i class=&#34;fa icon-tip&#34; title=&#34;Tip&#34;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&#34;content&#34;&gt;
Sometimes there are errors importing the job template due to auto-generated labels or selectors .. a quick and dirty hack is to filter them out using jq
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
