<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bagas Ari Wibowo on Medium]]></title>
        <description><![CDATA[Stories by Bagas Ari Wibowo on Medium]]></description>
        <link>https://medium.com/@bagas-awibowo?source=rss-63730db10619------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gHO5vycGJbnmj0KUhznxIQ.png</url>
            <title>Stories by Bagas Ari Wibowo on Medium</title>
            <link>https://medium.com/@bagas-awibowo?source=rss-63730db10619------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:52:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bagas-awibowo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes Logs Observability with ClickStack — ClickHouse & HyperDX]]></title>
            <link>https://bagas-awibowo.medium.com/kubernetes-logs-observability-with-clickstack-clickhouse-hyperdx-37ddcbcc58f2?source=rss-63730db10619------2</link>
            <guid isPermaLink="false">https://medium.com/p/37ddcbcc58f2</guid>
            <dc:creator><![CDATA[Bagas Ari Wibowo]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 14:55:53 GMT</pubDate>
            <atom:updated>2026-01-05T14:55:53.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Logs Observability with ClickStack — ClickHouse &amp; HyperDX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFzsc7tUEFQURF88xbaS6Q.jpeg" /></figure><p>Managing an observability stack often feels like a constant battle between performance and cost.</p><p>The example case is we are looking for reliable, powerfull, and fast log query performance. The top of mind stack is <strong>Elasticsearch (ELK Stack)</strong>. But as log volumes grow, the reality of managing it sets in: the compute costs for RAM and CPU become massive, and SSDs become a requirement just to keep the indexing from lagging under pressure.</p><p>Alternative way to cut the cost, many shift toward <strong>Grafana Loki</strong>. It feels like a major win at first because logs can be offloaded to shared external object storage like S3 or MinIO, significantly cutting storage overhead. Plus, it integrates perfectly with the Grafana ecosystem — Prometheus, Alloy, and OpenTelemetry.</p><p>However, a new wall eventually appears: <strong>query performance</strong>. When dealing with unstructured data or high-cardinality logs with many unique labels. Complex filtering that should take seconds often takes minutes, which is exactly what is not needed during a critical incident.</p><p>I was intrigued by ClickHouse’s claim of being a <strong>columnar database</strong>. In theory, this allows for lightning-fast filtering on high-cardinality logs while still keeping the storage benefits of Loki, as ClickHouse natively supports S3 backends. To make it even better, I found <a href="https://clickhouse.com/docs/use-cases/observability/clickstack/getting-started?loc=use-case-observability">ClickStack</a>, which bundles <a href="https://www.hyperdx.io/docs">HyperDX </a>— a UI that gives you that familiar Kibana.</p><blockquote>Note: This is a setup guide based on my curiosity. I’m not presenting a final benchmark yet, but rather a walkthrough of how I got this stack running to see if it lives up to the hype.</blockquote><p>Moving forward, let’s dive into the topology and thes setup steps. This design is built to ensure each component scales independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MppcPbd_HNc0Bk8vZBT_wg.png" /></figure><p><strong>Prerequisite and Setup</strong></p><ol><li>MinIO as external storage for ClickHouse. You can use other S3 object storage, like AWS S3 or GCS. In this post I won’t explain how to setup the MinIO, you can follow <a href="https://github.com/minio/minio/blob/master/helm/minio/README.md">this guide</a> to setup using Helm.</li><li>Altinity ClickHouse operator, to deploy ClickHouse with High Availability setup.</li><li>OpenTelemetry collector, to collect Kubernetes logs and forward to clickhouse.</li><li>ClickStack, to deploy HyperDX UI with Helm chart.</li></ol><h3>Step 1: Deploy ClickHouse Operator</h3><p>The first step is to install the <strong>Altinity ClickHouse Operator</strong>. This operator simplifies defining complex ClickHouse clusters — including shards, replicas, and keepers.</p><p>Optionally, prepare the Helm values for Altinity ClickHouse Operator. In this case, I will add specific namespace to watch the CRD, because I will deploy it on logging namespace.</p><pre>configs:<br>  files:<br>    config.yaml: <br>      watch:<br>        namespaces:<br>          - logging</pre><pre>helm repo add altinity https://helm.altinity.com<br>helm install clickhouse-operator altinity/altinity-clickhouse-operator -n clickhouse --create-namespace -f altinity-values.yaml</pre><p>Verify that the operator is running:</p><pre>ubuntu@ubuntu-1:~$ kubectl get po -n clickhouse<br>NAME                                                              READY   STATUS    RESTARTS   AGE<br>clickhouse-operator-altinity-clickhouse-operator-f86457cb6bz7xj   2/2     Running   0          3m27s</pre><h3>Step 2: Provisioning ClickHouse Cluster with S3 Backend</h3><p>Before continuing to deploy the ClickHouse, you need to prepare the bucket and access credential to the bucket, which<strong> access_key_id</strong> &amp; <strong>secret_access_key</strong>.</p><p>Once the operator is ready and the bucket has been created, we can deploy the ClickHouse cluster. In this setup, I am using a High Availability configuration (2 shards, 2 replicas) integrated with MinIO object storage.</p><pre>---<br>apiVersion: &quot;clickhouse-keeper.altinity.com/v1&quot;<br>kind: &quot;ClickHouseKeeperInstallation&quot;<br>metadata:<br>  name: ch-logging-keeper<br>  namespace: logging<br>spec:<br>  configuration:<br>    clusters:<br>      - name: &quot;ch-cluster&quot;<br>        layout:<br>          replicasCount: 3<br>---<br>apiVersion: &quot;clickhouse.altinity.com/v1&quot;<br>kind: &quot;ClickHouseInstallation&quot;<br>metadata:<br>  name: ch-logging<br>  namespace: logging<br>spec:<br>  configuration:<br>    zookeeper:<br>      nodes:<br>        - host: &quot;keeper-ch-logging-keeper.logging.svc.cluster.local&quot;<br>          port: 2181<br>    clusters:<br>      - name: &quot;ch-cluster&quot;<br>        layout:<br>          shardsCount: 2<br>          replicasCount: 2<br>    settings:<br>      storage_configuration/disks/logging/type: &quot;s3&quot;<br>      storage_configuration/disks/logging/endpoint: &quot;http://minio.minio.svc.cluster.local:9000/logging/clickhouse/{installation}/{replica}/&quot;<br>      storage_configuration/disks/logging/access_key_id: &quot;YourS3AccessKeyID&quot;<br>      storage_configuration/disks/logging/secret_access_key: &quot;YourS3SecretAccessKey&quot;<br>      storage_configuration/policies/s3_main/volumes/main/disk: &quot;logging&quot;<br>    users:<br>      admin_user/password:<br>        valueFrom:<br>          secretKeyRef:<br>            name: ch-logging-creds<br>            key: admin_password<br>      admin_user/networks/ip: &quot;0.0.0.0/0&quot;<br>      admin_user/profile: default<br>---<br>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: ch-logging-creds<br>  namespace: logging<br>type: Opaque<br>stringData:<br>  admin_password: &quot;YourClickHouseAdminPassword&quot;</pre><p>After applying the configuration, verify the cluster status. Ensure all hosts show Completed, indicating successful installation of ClickHouse cluster.</p><pre>ubuntu@ubuntu-1:~$ kubectl get chi -n logging<br>NAME          CLUSTERS   HOSTS   STATUS      HOSTS-COMPLETED   AGE<br>ch-logging    1          4       Completed   4                 2m7s<br>ubuntu@ubuntu-1:~$ kubectl get chk -n logging<br>NAME                CLUSTERS   HOSTS   STATUS      HOSTS-COMPLETED   AGE   SUSPEND<br>ch-logging-keeper   1          3       Completed                     2m9s</pre><h3>Step 3: Prepare Database Schema &amp; OpenTelemetry</h3><p>Create the otel_logs table using the s3_main policy. With the <strong>storage_policy = ‘s3_main’</strong> setting, ClickHouse automatically writes data to MinIO.</p><p>Go inside to ClickHouse pod to execute the DDL to setup the table.</p><pre>ubuntu@ubuntu-1:~$ kubectl exec -ti chi-ch-logging-ch-cluster-0-0-0 -n logging -- bash<br>root@chi-ch-logging-ch-cluster-0-0-0:/# clickhouse-client<br>chi-ch-logging-ch-cluster-0-0-0.chi-ch-logging-ch-cluster-0-0.logging.svc.cluster.local :) USE default;<br><br>USE default<br><br>Query id: f2181ccb-a3e3-42d6-83ae-ca75f6591633<br><br>Ok.<br><br>0 rows in set. Elapsed: 0.002 sec. <br><br>chi-ch-logging-ch-cluster-0-0-0.chi-ch-logging-ch-cluster-0-0.logging.svc.cluster.local :) </pre><pre>CREATE TABLE otel_logs ON CLUSTER &#39;ch-cluster&#39;  <br>(  <br>   `Timestamp` DateTime64(9) CODEC(Delta(8), ZSTD(1)),  <br>   `TimestampTime` DateTime DEFAULT toDateTime(Timestamp),  <br>   `TraceId` String CODEC(ZSTD(1)),  <br>   `SpanId` String CODEC(ZSTD(1)),  <br>   `TraceFlags` UInt8,  <br>   `SeverityText` LowCardinality(String) CODEC(ZSTD(1)),  <br>   `SeverityNumber` UInt8,  <br>   `ServiceName` LowCardinality(String) CODEC(ZSTD(1)),  <br>   `Body` String CODEC(ZSTD(1)),  <br>   `ResourceSchemaUrl` LowCardinality(String) CODEC(ZSTD(1)),  <br>   `ResourceAttributes` Map(LowCardinality(String), String) CODEC(ZSTD(1)),  <br>   `ScopeSchemaUrl` LowCardinality(String) CODEC(ZSTD(1)),  <br>   `ScopeName` String CODEC(ZSTD(1)),  <br>   `ScopeVersion` LowCardinality(String) CODEC(ZSTD(1)),  <br>   `ScopeAttributes` Map(LowCardinality(String), String) CODEC(ZSTD(1)),  <br>   `LogAttributes` Map(LowCardinality(String), String) CODEC(ZSTD(1)),  <br>   INDEX idx_trace_id TraceId TYPE bloom_filter(0.001) GRANULARITY 1,  <br>   INDEX idx_res_attr_key mapKeys(ResourceAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_res_attr_value mapValues(ResourceAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_scope_attr_key mapKeys(ScopeAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_scope_attr_value mapValues(ScopeAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_log_attr_key mapKeys(LogAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_log_attr_value mapValues(LogAttributes) TYPE bloom_filter(0.01) GRANULARITY 1,  <br>   INDEX idx_body Body TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 8  <br>)  <br>-- Use ReplicatedMergeTree for Open Source HA  <br>ENGINE = ReplicatedMergeTree(&#39;/clickhouse/tables/{shard}/otel_logs&#39;, &#39;{replica}&#39;)  <br>PARTITION BY toDate(TimestampTime)  <br>PRIMARY KEY (ServiceName, TimestampTime)  <br>ORDER BY (ServiceName, TimestampTime, Timestamp)  <br>-- This points it to your S3 bucket  <br>SETTINGS storage_policy = &#39;s3_main&#39;; </pre><p>In this schema, I used the <strong>ReplicatedMergeTree</strong> engine. Since we are running a multi-node cluster with shards and replicas, this engine is essential for ensuring high availability. It works by communicating with <strong>ClickHouseKeeper</strong> to coordinate data replication across the cluster.</p><p>Whenever the OpenTelemetry Collector sends logs to one host through Kubernetes service, the engine automatically handles the background task of replicating that data to other replicas within the same shard. This ensures that if one node goes down, the data remains consistent and available on another node.</p><p>The OTel Collector needs a specific configuration to parse Kubernetes metadata and export data to ClickHouse.</p><pre>mode: daemonset<br>presets:<br>  logsCollection:<br>    enabled: true<br>  kubernetesAttributes:<br>    enabled: true<br><br>config:<br>  exporters:<br>    clickhouse:<br>      endpoint: http://clickhouse-ch-logging.logging.svc.cluster.local:8123<br>      database: default<br>      username: admin_user<br>      password: &quot;YourClickHouseAdminPassword&quot;<br>      logs_table_name: otel_logs<br>      # We created the schema manually in Step 3<br>      create_schema: false<br>  service:<br>    pipelines:<br>      logs:<br>        receivers: [filelog]<br>        processors: [k8sattributes, batch]<br>        exporters: [clickhouse]</pre><ul><li><strong>k8sattributes</strong>: This processor enriches logs with pod names, namespaces, and labels.</li><li><strong>batch</strong>: Essential for performance; it groups logs together before sending them to ClickHouse.</li></ul><pre>helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts<br>helm install -n opentelemetry --create-namespace otel-collector opentelemetry/opentelemetry-collector -f otel-collector-values.yaml</pre><p>Check the logs to ensure the collector is watching the pod log files:</p><pre>2026-01-04T15:20:29.550Z info fileconsumer/file.go:261 Started watching file {&quot;path&quot;: &quot;/var/log/pods/...&quot;}</pre><h3>Step 4: Setting Up HyperDX with ClickStack</h3><p>For the visualization, we use HyperDX via the ClickStack chart. HyperDX provides a modern, Kibana-like interface specifically optimized for ClickHouse.</p><p>Because we have already manually set up the ClickHouse cluster and OTel Collector, we must disable ClickStack’s internal versions of these components.</p><pre>hyperdx:<br>  defaultConnections: |<br>    [<br>      {<br>        &quot;name&quot;: &quot;ClickHouse Logging&quot;,<br>        &quot;host&quot;: &quot;http://clickhouse-ch-logging.logging.svc.cluster.local:8123&quot;,<br>        &quot;port&quot;: 8123,<br>        &quot;username&quot;: &quot;admin_user&quot;,<br>        &quot;password&quot;: &quot;YourClickHouseAdminPassword&quot;<br>      }<br>    ]<br># Disable internal components<br>otel: { enabled: false }<br>clickhouse: { enabled: false }</pre><p>Next, install the HyperDX using Helm</p><pre>helm repo add clickstack https://hyperdxio.github.io/helm-charts<br>helm install clickstack clickstack/clickstack -n logging -f clickstack-values.yaml</pre><p>Once deployed, you can access the HyperDX setup page by creating a port-forward:</p><pre>kubectl port-forward svc/clickstack-app 3000:3000 -n logging</pre><p>Navigate to <a href="http://localhost:3000/">http://localhost:3000</a> to create your admin account and explore the observability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*Ybq2NixAaas61FFnhn_sSg.png" /></figure><p>Now setup the source of Logging to start exploring the logs on HyperDX.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*yKgGkAJZhp-t7WLifb_nrA.png" /></figure><h3>Putting it to the Test: Real-World Observability</h3><p>After getting everything deployed, the million-dollar question remains: Is it actually better? I spun up a log-generator to simulate some real traffic and started poking around the HyperDX dashboard. Honestly, the results were pretty satisfying. Here’s a breakdown of what the experience feels like:</p><h4>1. Blaze Filtering</h4><p>One of the coolest things is how ClickHouse handles high-cardinality filters. I tried searching for specific strings — like a particular URL or error message — directly in the Body column using Lucene syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56TFocpT9KDYVwvnrk7juA.png" /></figure><h4>2. Dynamic Aggregation on Unstructured Logs</h4><p>The outstanding of this columnar setup is that you don’t have to predict exactly how you’ll want to filter your data months in advance. In many systems, if you didn’t tag a field as a “label” during ingestion.</p><p>Instead of being limited by what was defined at ingestion time, I can use the JSONExtractString function to pull fields out of the raw JSON body whenever I need them.</p><p>For example, I wanted to see the log count distribution between my backend, worker, and frontend components. I just wrote a quick query, and HyperDX rendered a clean stacked bar chart immediately. The best part? I didn&#39;t have to re-index anything or define new labels beforehand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrVif62SHAoHa4CZWFoa3Q.png" /></figure><h4>3. Granularity Shifts</h4><p>While troubleshooting, being able to shift your perspective is key. I played around with the <strong>Time Granularity</strong> settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vD-JbvjyABDso6JUT1VOQ.png" /></figure><ul><li><strong>Trend Analysis</strong>: Switch to <strong>5 Minutes Granularity</strong> to see patterns over the last few hours.</li><li><strong>Incident Deep-Dive</strong>: Instant zoom-in to <strong>30 Seconds Granularity</strong> to see exactly when an error spike started.</li></ul><p>The switch is smooth because ClickHouse only scans the columns it needs, making the visualization feel very snappy even when the time range is wide.</p><h4>4. Structured Visibility</h4><p>When you find an interesting log entry, you can just click into it. The <strong>Column Values</strong> tab in HyperDX automatically parses the JSON Body into structured key-value pairs. It makes the data much easier to digest, mapping out TraceId, ServiceName, and Kubernetes metadata in a clean, organized view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gwz1wExCj9PNPyjs0sh_yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Nwd01_UnCOkjtZQTq52-g.png" /></figure><h3>Final Thoughts</h3><p>This experiment was all about finding that “sweet spot”: keeping the storage efficiency of S3 while gaining the analytical speed of a columnar engine. Every tool has its place in the ecosystem. <strong>Elasticsearch</strong> remains the powerhouse for full-text search and maturity, while <strong>Loki</strong> is fantastic for its simplicity and minimal overhead in many standard scenarios.</p><p>However, once your use case shifts toward heavy filtering, instant aggregations, or dealing with high cardinality data without the massive of SSD-heavy clusters usages, this <strong>ClickHouse + OTel + HyperDX</strong> combo starts to look like a very serious alternative.</p><p>Thank you so much for taking the time to read through this exploration. I’ll be diving even deeper into this stack soon, so stay tuned for more updates.</p><p>What do you think? If you have any tips or want to share your own experience, drop a comment below. I’d love to get your thoughts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37ddcbcc58f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortless Kubernetes Delivery with Zuul CI]]></title>
            <link>https://bagas-awibowo.medium.com/effortless-kubernetes-delivery-with-zuul-ci-38b9b1d592fe?source=rss-63730db10619------2</link>
            <guid isPermaLink="false">https://medium.com/p/38b9b1d592fe</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Bagas Ari Wibowo]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 10:44:54 GMT</pubDate>
            <atom:updated>2024-07-14T10:44:54.205Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_ipFoYu1biRZlXpyefGvw.jpeg" /></figure><p>There are lots of open source CI/CD tools out there. Most of CI tools that I know is possibly triggering build by manual trigger, event trigger, or scheduled trigger. But I haven’t found a CI tool that can ensure that code that is pushed will always be tested, if it doesn’t pass it never will.</p><p>And I found this concept <a href="https://gating.dev/">https://gating.dev/</a></p><blockquote>Every change is built and tested or it doesn’t merge</blockquote><p>Project gating have some advantage rather than manually trigger build. And the implementation is suitable to ensure that every change is thoroughly tested before it is merged into our main repository code. Based on that curiosity, then found this CI tool that has standout features for its project gating capability.</p><p>But it also has its drawbacks, like its a bit tricky if you want to rebuild the existing one.</p><p>Zuul CI is part of OpenInfra project <a href="https://openinfra.dev/projects/">https://openinfra.dev/projects/</a>. One of the opensource foundation that focusing on development of open infrastructure.</p><h3><strong>Key Features</strong></h3><p>One of the standout features of Zuul CI is its <strong>project gating</strong> capability. This ensures that only changes that pass all tests are merged. To put it simply — stop merging broken code!</p><p>Zuul CI runs the CI/CD using <strong>Ansible</strong>. With Ansible makes Zuul CI highly customizable and flexible in defining and running jobs. And you can use the same Ansible playbooks to deploy your system and run your tests.</p><p>It is also have shared defined Ansible for Zuul on this, then you not require to start it from zero <a href="https://opendev.org/zuul/zuul-jobs/src/branch/master">https://opendev.org/zuul/zuul-jobs/src/branch/master</a>.</p><p>Then it support cross-repository dependencies, which allows us testing changes across multiple repositories. Multi-system gating (infrastructure<br>to apps, multi-project, multi-cloud).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmKKu1ZBIQcALsEhGvSRuA.png" /><figcaption><a href="https://zuul-ci.org/">https://zuul-ci.org/</a></figcaption></figure><h3>Integrating Zuul with Kubernetes</h3><p>Nodepool is a system for managing test node resources. It supports launching single-use test nodes from cloud providers as well as managing access to pre-defined pre-existing nodes. In this case I want to use Kubernetes as the nodepool providers.</p><pre>providers:<br>  - name: k3s<br>    driver: kubernetes<br>    context: default<br>    pools:<br>      - name: main<br>        labels:<br>          - name: pod-python<br>            type: pod<br>            image: docker.io/python<br>          - name: pod-k8s-util<br>            type: pod<br>            image: docker.io/bagas25/k8s-util:latest<br>          - name: pod-dind<br>            type: pod<br>            spec:<br>              containers:<br>                - name: pod-dind<br>                  securityContext:<br>                    privileged: true<br>                  image: docker.io/bagas25/dind:latest</pre><p>So to use kubernetes as the nodepool, you need to configure it through providers configuration section.</p><p>Simply you can create labels for your pool and put your Pod specification inside the labels. Then your builds can run on those node.</p><p>The important things to integrate with Zuul is you need to provide cluster access to Zuul. It is require to add cluster config on Zuul machine.</p><p>Or optionally you can deploy the Zuul inside your K8s cluster. Some option available is using Zuul <a href="https://opendev.org/zuul/zuul-helm/src/branch/master">helm-chart</a> or <a href="https://opendev.org/zuul/zuul-operator/src/branch/master">Zuul Kubernetes Operator.</a></p><h3>Connecting to Repository</h3><p>Zuul support integration to common repositories, like GitHub, GitLab, Gerrit. For GitHub, you need to add the connection first by creating GitHub app integration and configure it on Zuul configuration</p><pre>zuul.conf<br><br>[connection &quot;zuullab&quot;]<br>driver=github<br>webhook_token=&lt;token&gt;<br>app_id=&lt;app_id&gt;<br>app_key=/etc/zuul/github.pem</pre><p>After successfully integrate to GitHub, make sure it can connect to GitHub. You can check it out on your <strong>App Integration</strong> settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LsEp-Sxp0rx4qcRB0hXoZw.png" /></figure><p>Then, last you need to add the source on your Zuul tenant configuration. This sections, you can select which repository that will set as the project on Zuul.</p><pre>main.yaml<br><br>- tenant:<br>    name: zuul-lab<br>    source:<br>      zuullab:<br>        config-projects:<br>          - bagaswibowo25/zuul-config:<br>              load-branch: main<br>        untrusted-projects:<br>          - bagaswibowo25/sample-flask-app<br>          - bagaswibowo25/flask-charts</pre><h3>Setup the Projects</h3><p>After connecting to the repository, you need to define the workflow of your projects.</p><pre>- project:<br>    name: ^.*$<br>    check:<br>      jobs: []<br>    gate:<br>      jobs: []<br><br>- project:<br>    name: zuul-config<br>    check:<br>      jobs:<br>        - noop<br>    gate:<br>      jobs:<br>        - noop</pre><p>On this project settings, allows you to define the workflow. In this case I’m using two pipeline which <strong>check</strong> and <strong>gate.</strong></p><p>Other <a href="https://zuul-ci.org/docs/zuul/latest/config/pipeline.html">pipeline option</a> also available, like post, deploy, and promote.</p><p>The <strong>check</strong> pipeline is the first line of defense. So when a developer submits a change, Zuul CI immediately runs a series of preliminary tests on it.</p><p>The primary goal here is to quickly identify any obvious issues and provide immediate feedback to the developer. This helps in catching errors early in the development process.</p><p>Once a change passes the <strong>check</strong> pipeline, it enters the <strong>gate</strong> pipeline. Only changes that pass all tests in the <strong>gate</strong> pipeline are merged into the main branch. This ensures that the main branch remains stable and reliable.</p><h3>Setup Application Project on Zuul</h3><p>In this example case, I created simple Python flask application, that serve web server. This objective integration to Zuul is to do testing when the pull-request is made, and then build the container image for that application, so it can run as a container.</p><p>So what we need to do to create the CI pipeline to this project? We required to create project pipeline, it contain the list of job to run the builds. Then we also require create a job on Zuul config file. It defines the CI workflow for the project.</p><p>Here is the sample configuration of the project:</p><pre>- job:<br>    name: test-flask-app<br>    run: playbooks/test-flask-app.yaml<br>    provides: test<br><br>- job:<br>    name: create-docker-container<br>    run: playbooks/create-container.yaml<br>    requires: test<br>    group-vars:<br>      dind:<br>        image:<br>          repository: bagas25/flask-app<br>          tag: v2<br>    secrets:<br>      - name: docker_auth<br>        secret: docker-auth<br>    nodeset:<br>      nodes:<br>        - name: pod-dind<br>          label: pod-dind<br>      groups:<br>        - name: dind<br>          nodes:<br>            - pod-dind<br><br>- project:<br>    check:<br>      jobs:<br>        - test-flask-app<br>    gate:<br>      jobs:<br>        - create-docker-container</pre><p>The project section is defining the pipeline, what we want to do on the check and gate process. And on job section we define the build process which will run the Ansible playbook during the build.</p><p>To pass the variable on Ansible task, we can define the variable through the group-vars.</p><p>And we can provide specific node to run the build, if not defined it will use default node on the base configuration settings.</p><p>So the directory structure is more or less like this:</p><pre>├── .zuul.yaml<br>├── app.py<br>├── Dockerfile<br>├── requirements.txt<br>├── playbooks/<br>│   ├── create-container.yaml<br>│   ├── test-flask-app.yaml<br>│   ├── roles/<br>│       ├── push-image/<br>│       ├── setup-container/<br>│       └── test-flask/</pre><p>Zuul will automatically read the config file from .zuul.yaml or zuul.d/ directory.</p><p>One of interesting in this case is during building the container image, it will push the image to container registry. To connect to container registry we need to authenticate to the registry.</p><p>Zuul support encryption, it very useful when you need to pass the credential on the Ansible tasks. So we can safely store the sensitive variable to the repository. For more details you can read on Zuul <a href="https://zuul-ci.org/docs/zuul/latest/project-config.html#encryption">documentation</a>.</p><p>To apply the secret, you need to create a section on Zuul project setting.</p><pre>- secret:<br>    name: docker-auth<br>    data:<br>      password: !encrypted/pkcs1-oaep<br>        - er1UXNOD3OqtsRJaP0Wvaqiqx0ZY2zzRt6V9vqIsRaz1R5C4/AEtIad/DERZHwk3Nk+KV<br></pre><p>And to pass the secret as the variable, you need to add the secret on job configuration section.</p><h3><strong>Setup Deployment Project on Zuul</strong></h3><p>After the application is packaged as container image, next we need to create deployment to deploy the application to Kubernetes cluster. In this case I created helm-chart.</p><p>By using helm-chart it will make easier to deploy your apps to Kubernetes. It package your application that comply to Kubernetes component in one chart.</p><pre>├── .zuul.yaml<br>├── Chart.yaml<br>├── values.yaml<br>├── playbooks/<br>│   ├── deploy-chart.yaml<br>│   ├── helm-validation.yaml<br>│   ├── roles/<br>│       ├── helm-check/<br>│       ├── helm-install/<br>│       └── helm-upgrade/<br>├── templates/</pre><p>The project setting on this deployment project, it also run check and gate. The check pipeline will validate the helm-chart and for gate pipeline is a job to install or upgrade our application on Kubernetes.</p><pre>- job:<br>    name: helm-validation<br>    run: playbooks/helm-validation.yaml<br>    nodeset:<br>      nodes:<br>        - name: pod-k8s-util<br>          label: pod-k8s-util<br><br>- job:<br>    name: deploy-helm-chart<br>    run: playbooks/deploy-chart.yaml<br>    group-vars:<br>      k8s:<br>        namespace: myapp<br>        chart_name: flask-web<br>        values:<br>          image:<br>            repository: bagas25/flask-app<br>            tag: v2<br>    nodeset:<br>      nodes:<br>        - name: pod-k8s-util<br>          label: pod-k8s-util<br>      groups:<br>        - name: k8s<br>          nodes:<br>            - pod-k8s-util<br><br>- project:<br>    check:<br>      jobs:<br>        - helm-validation<br>    gate:<br>      jobs:<br>        - deploy-helm-chart</pre><h3>Trigger Builds</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*0eMf4pwfPG9Fm71gQUOYow.png" /></figure><p>So after you made a change on branch, we can monitor on Zuul web status. On that web, we can monitor list of build on each pipeline.</p><p>When pull-request is made, it automatically trigger the build. If the build success/fails it also inform on the GitHub pull request check and show the summary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIJdQhiN9tRJ6ZpzWkdlyQ.png" /></figure><p>During the build, as we defined it use Kubernetes provider to run the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MQx3-Xh40sY28kgX6pipA.png" /></figure><p>Here we can see, Zuul will launch the node to run the task inside the Kubernetes cluster. Why I’m using the Kubernetes provider? It way more faster to spawn the worker if we compare using VM.</p><p>To get more details, Zuul provide build status to inform the detail information during the build process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OhF-II2ce8yKWmR50rYjTg.png" /></figure><p>We can see the console output for each process, it will make easier to check the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhbin9u0ba2-1snjsJJ-Vg.png" /></figure><p>Next, after the check pipeline succeeded, to continue to gate process. Need to give approval. It can be done through giving comment or approval on the pull-request page.</p><p>It is configurable to customize how the build trigger or approval process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*E-ZmGCQjlznLacIt9rDO_g.png" /></figure><p>It automatically trigger the gate pipeline, in this case the gate pipeline will deploy the helm-chart that has been defined before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*s5keviR6blFPPGVX4a2mGQ.png" /></figure><p>And the process is done, your application is has been deployed on Kubernetes cluster if the build succeeded.</p><h3>Key Takeaways</h3><p>Based on this case, Zuul can help you to manage your CI/CD and it has powerful capabilities to integrate with your repositories and infrastructure.</p><p>And it very suitable if you looking for project gating system, so it will ensures that only changes that pass all tests are merged, and maintaining the integrity of the project.</p><p>But if you require to manually trigger job, like triggering specific branch or commit, it will be quite tricky. Zuul was good on event based trigger job.</p><p>Zuul have simple and clean UI, no complex settings. It will helps you to monitor each pipeline and build more clear. For example, when I have failure build, Zuul record every Ansible task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*7wyRlQ47UqhOa4RUaEW1rA.png" /></figure><p>So it make more easier to point out the issues by looking the task summary. No need to scroll the long unnecessary information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMLg51sxYDqvUacY4PlutA.png" /></figure><p>If you need more detail, you can look at the Console status, it describe every task that run on your playbook.</p><p>At also possible to you to get the raw log, if you need to export that like to be processed back into the logging component that you have.</p><p>So thats all the things that I can share about my exploration on Zuul CI. Thanks for reading, hope it will help you to take advantage on this post.</p><p>If there any question or feedbacks drop in comment below.</p><p>Happy Learning! 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38b9b1d592fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm — Templating Network Policy using Helm]]></title>
            <link>https://bagas-awibowo.medium.com/helm-templating-network-policy-using-helm-783b2f7e401a?source=rss-63730db10619------2</link>
            <guid isPermaLink="false">https://medium.com/p/783b2f7e401a</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bagas Ari Wibowo]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 16:22:35 GMT</pubDate>
            <atom:updated>2024-02-04T16:25:44.844Z</atom:updated>
            <content:encoded><![CDATA[<h3>Helm — Templating Network Policy using Helm</h3><p>Helm is very useful to package your application. It have capability to templating your Kubernetes resources. So you can reuse the same resource for different purpose. Besides it will help you or developer to maintain the resource with simpler structure kind of resource based on Helm best practices or with your own way.</p><p>In this part I will try to templating the Network Policy resources by Helm. The first problem is Network Policy can be a complex resource to manage and hard to understand.</p><p>To ensure security for your application the Network Policy was very important, you will control the incoming and outgoing traffic from nor to your application. First you need to understand the flow of Network Policy to identify what need to do to ensure your application is secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Slhn3JLULiGAtjlp0QA-0w.png" /><figcaption>Network Policy Editor by Cilium</figcaption></figure><p>The tool that very helpful for me is <a href="https://editor.networkpolicy.io/">https://editor.networkpolicy.io/</a>. It will help you to generate the Network Policy with your own needs. So why we still need the Helm to templating the Network Policy?</p><p>After we applying the Network Policy we still need to maintain the rule that we apply to the cluster. If we apply the complex rule and manage multiple application will hard to maintain. So we can simplify it by using Helm.</p><p>Below the manifest of Network Policy that templated using Helm.</p><p>networkpolicy.yaml</p><pre>{{- range .Values.networkPolicies }}<br>apiVersion: networking.k8s.io/v1<br>kind: NetworkPolicy<br>metadata:<br>  name: {{ .name }}<br>spec:<br>{{- include &quot;netpol.podSelector&quot; . | indent 2 }}<br>{{- if .ingress }}<br>{{- include &quot;netpol.ingress&quot; . | indent 2 }}<br>{{- end }}<br>{{- if .egress }}<br>{{- include &quot;netpol.egress&quot; . | indent 2 }}<br>{{- end }}<br>---<br>{{- end }}</pre><p>Looks simpler than original resource right? By that template Helm can generate multiple Network Policy file by just passing the value that we required to apply the policy. The main key of the Network Policy is Ingress and Egress and the components to control the traffic is:</p><ol><li>Outside cluster, later we can define it by name <strong><em>cidrs. </em></strong>This part will control the traffic coming from nor to outside cluster by IP block subnets.</li><li>In Namespace, later we can define it by name <strong><em>podSelectors</em></strong>. This part will control the traffic inside the namespace where the application is deployed. It will control the access between the application within the namespace.</li><li>In Cluster, later we can define it by name <strong><em>namespaceSelectors</em></strong>. This part will control the traffic within the cluster, thats why I defined as namespaceSelectors. Because the traffic will be scoped within cluster and can be filtered per-namespace. With namespaceSelectors also we still need to define the specific Pod labels to apply the rule.</li></ol><p>All the components of Network Policy will be created through the named template, is simply a template defined inside the file. By default defined inside <strong><em>_helpers.tpl</em></strong> on the <strong><em>templates</em></strong> directory. You can read more detail to understand the Helm flow control here <a href="https://helm.sh/docs/chart_template_guide/control_structures/">https://helm.sh/docs/chart_template_guide/control_structures/</a></p><p>Let’s look into the inside <strong><em>_helpers.tpl</em></strong>:</p><ol><li>Create a function to handle the podSelector</li></ol><pre>{{- define &quot;netpol.podSelector&quot; }}<br>{{- if .podSelector }}<br>podSelector:<br>  {{- range $key, $value := .podSelector }}<br>  matchLabels:<br>    {{ $key }}: {{ $value }}<br>  {{- end }}<br>{{- else }}<br>podSelector: {}<br>{{- end }}<br>{{- end }}</pre><p>On those part, the template will handle to define which resource that will be applied by the policy. If not defined will set the <strong>podSelector: {}</strong>, it mean the policy applied to all Pod inside the namespace.</p><p>2. Create a function to generate the Ingress and Egress section</p><pre>{{/*<br>Ingress block<br>*/}}<br>{{- define &quot;netpol.ingress&quot; }}<br>ingress:<br>- from:<br>  {{- if .ingress.cidrs }}<br>    {{- with .ingress }}<br>    {{- include &quot;netpol.scoped.cidr&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .ingress.podSelectors }}<br>    {{- with .ingress }}<br>    {{- include &quot;netpol.scoped.podSelector&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .ingress.namespaceSelectors }}<br>    {{- with .ingress }}<br>    {{- include &quot;netpol.scoped.namespaceSelector&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .ingress.ports }}<br>    {{- with .ingress }}<br>    {{- include &quot;netpol.scoped.port&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br>{{- end }}<br><br>{{/*<br>Egress block<br>*/}}<br>{{- define &quot;netpol.egress&quot; }}<br>egress:<br>- to:<br>  {{- if .egress.cidrs }}<br>    {{- with .egress }}<br>    {{- include &quot;netpol.scoped.cidr&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .egress.podSelectors }}<br>    {{- with .egress }}<br>    {{- include &quot;netpol.scoped.podSelector&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .egress.namespaceSelectors }}<br>    {{- with .egress }}<br>    {{- include &quot;netpol.scoped.namespaceSelector&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br><br>  {{- if .egress.ports }}<br>    {{- with .egress }}<br>    {{- include &quot;netpol.scoped.port&quot; (dict &quot;scope&quot; .) | indent 2 }}<br>    {{- end }}<br>  {{- end }}<br>{{- end }}</pre><p>As I mentioned before, the Network Policy will manage the traffic from (Ingress) nor to (Egress). With the Helm template we can reuse the same function if have same behaviour. For example, we just define single template to handle the filter by CIDR, and we can call inside the Ingress or Egress template.</p><p>3. Create a function to handle filter based on IP Block CIDR</p><pre>{{/*<br>Generate netpol by IP Block CIDR<br>*/}}<br>{{- define &quot;netpol.scoped.cidr&quot; }}<br>{{- range .scope.cidrs }}<br>- ipBlock:<br>    cidr: {{ .ip }}<br>    {{- if .excepts }}<br>    except: {{ toYaml .excepts | nindent 6 }}<br>    {{- end }}<br>{{- end }}<br>{{- end }}</pre><p>The example structure to add filter by IP is below:</p><pre>    cidrs:<br>      - ip: 172.17.0.0/16<br>        excepts:<br>        - 172.17.1.0/24<br>      - ip: 10.0.0.1/24</pre><p>And the expected output is:</p><pre>      - ipBlock:<br>          cidr: 172.17.0.0/16<br>          except:<br>          - 172.17.1.0/24<br>      - ipBlock:<br>          cidr: 10.0.0.1/24</pre><p>4. Create a function to handle filter based on podSelector</p><pre>{{/*<br>Generate netpol by Pod selector<br>*/}}<br><br>{{- define &quot;netpol.scoped.podSelector&quot; }}<br>{{- range .scope.podSelectors }}<br>{{- $labelYaml := toYaml .label }}<br>{{- if contains &quot;:&quot; $labelYaml }}<br>- podSelector:<br>    matchLabels: {{ toYaml .label | nindent 6 }}<br>    {{- if .matches }}<br>    {{- include &quot;netpol.matcher&quot; . | indent 4 }}<br>    {{- end }}<br>{{- else }}<br>- podSelector: {}<br>{{- end }}<br>{{- end }}<br>{{- end }}</pre><p><strong><em>podSelector</em></strong> also capable to filter using expressions (<strong>In, NotIn, Exists, NotExist</strong>). Then we also create the function to handle the expressions and call it inside the template.</p><pre>{{/*<br>Generate matcher expression label<br>*/}}<br><br>{{- define &quot;netpol.matcher&quot; }}<br>matchExpressions:<br>{{- range .matches }}<br>{{- if hasKey . &quot;matchIn&quot; }}<br>- operator: In<br>  {{- range $key, $val := .matchIn }}<br>  key: {{ $key }}<br>  values: {{ toYaml $val | nindent 2 }}<br>  {{- end }}<br>{{- end }}<br><br>{{- if hasKey . &quot;matchNotIn&quot; }}<br>- operator: NotIn<br>  {{- range $key, $val := .matchNotIn }}<br>  key: {{ $key }}<br>  values: {{ toYaml $val | nindent 2 }}<br>  {{- end }}<br>{{- end }}<br><br>{{- if hasKey . &quot;matchExists&quot; }}<br>- operator: Exists<br>  key: {{ .matchExists }}<br>{{- end }}<br><br>{{- if hasKey . &quot;matchNotExist&quot; }}<br>- operator: DoesNotExist<br>  key: {{ .matchNotExist }}<br>{{- end }}<br><br>{{- end }}<br>{{- end }}</pre><p>The example structure to add filter by Pod label is below:</p><pre>  ingress:<br>    podSelectors:<br>      - label:<br>          foo: bar<br>        matches:<br>          - matchIn:<br>              env:<br>              - foo<br>              - baz</pre><p>And the expected output is:</p><pre>  ingress:<br>  - from:<br>    - podSelector:<br>        matchLabels:<br>          foo: bar<br>        matchExpressions:<br>        - operator: In<br>          key: env<br>          values:<br>          - foo<br>          - baz</pre><p>5. The next filter is <strong>namespaceSelector</strong>, this will handle filter rule within the cluster. Have a larger scope than the <strong>podSelector</strong>.</p><pre>{{/*<br>Generate netpol by Namespace selector<br>*/}}<br><br>{{- define &quot;netpol.scoped.namespaceSelector&quot; }}<br>{{- range .scope.namespaceSelectors }}<br>{{- $labelYaml := toYaml .label }}<br>{{- if contains &quot;:&quot; $labelYaml }}<br>- namespaceSelector:<br>    matchLabels: {{ toYaml .label | nindent 6 }}<br>    {{- if .matches }}<br>    {{- include &quot;netpol.matcher&quot; . | indent 4 }}<br>    {{- end }}<br>  {{- range .podSelectors }}<br>  podSelector:<br>    matchLabels: {{ toYaml .label | nindent 6 }}<br>    {{- if .matches }}<br>    {{- include &quot;netpol.matcher&quot; . | indent 4 }}<br>    {{- end }}<br>  {{- end }}<br>{{- else }}<br>- namespaceSelector: {}<br>  {{- range .podSelectors }}<br>  podSelector:<br>    matchLabels: {{ toYaml .label | nindent 6 }}<br>    {{- if .matches }}<br>    {{- include &quot;netpol.matcher&quot; . | indent 4 }}<br>    {{- end }}<br>  {{- end }}<br>{{- end }}<br>{{- end }}<br>{{- end }}</pre><p>The example structure to add filter by Namespace label is below:</p><pre>    namespaceSelectors:<br>      - label: any<br>        podSelectors:<br>          - label:<br>              foo: bar</pre><p>And the expected output is:</p><pre>    - namespaceSelector: {}<br>      podSelector:<br>        matchLabels:<br>          foo: bar</pre><p>For the policy filtered by <strong>podSelector</strong> and <strong>namespaceSelector</strong> is available option to set “any”. It mean any Pods or Namespaces are allowed to access.</p><p>Last, we define a function to assign port into the rule.</p><pre>{{/*<br>Generate ports list<br>*/}}<br><br>{{- define &quot;netpol.scoped.port&quot; }}<br>ports:<br>{{- with .scope.ports }}<br>{{- if .tcp  }}<br>{{- range .tcp }}<br>- protocol: TCP<br>  port: {{ . }}<br>{{- end }}<br>{{- end }}<br><br>{{- if .udp }}<br>{{- range .udp }}<br>- protocol: UDP<br>  port: {{ . }}<br>{{- end }}<br>{{- end }}</pre><p>All set, let’s we try. Helm provide command to test our templating is working well or not. We can run command helm template -s &lt;template file&gt; . --debug . In this case our Network Policy template is located in templates/networkpolicy.yaml .</p><p>To try this, we need to define the values on values.yaml file. This will be a default values to fill our chart.</p><pre>networkPolicies:<br>- name: &quot;mysite-policy&quot;<br>  podSelector:<br>    foo: bar<br>  ingress:<br>    cidrs:<br>      - ip: 10.0.0.1/16<br>        excepts:<br>        - 10.0.0.254/32<br>    podSelectors:<br>      - label:<br>          foo: bar<br>    ports:<br>      tcp:<br>      - 8080</pre><p>On those example, let assume we want to allow access to our application that run on TCP port 8080 . We will give an access to Pod that have a label foo: bar and have a range of IP 10.0.0.1/16 , except 10.0.0.254 .</p><p>Then to render the template we can run command:</p><pre>helm template -s templates/networkpolicy.yaml . --debug</pre><pre>---<br># Source: netpol/templates/networkpolicy.yaml<br>apiVersion: networking.k8s.io/v1<br>kind: NetworkPolicy<br>metadata:<br>  name: mysite-policy<br>spec:<br>  podSelector:<br>    matchLabels:<br>      foo: bar<br>  ingress:<br>  - from:<br>    - ipBlock:<br>        cidr: 10.0.0.1/16<br>        except:<br>          - 10.0.0.254/32<br>    - podSelector:<br>        matchLabels:<br>          foo: bar<br>    ports:<br>    - protocol: TCP<br>      port: 8080</pre><p>Source: <a href="https://github.com/bagaswibowo25/netpol">https://github.com/bagaswibowo25/netpol</a></p><p>This my first article written on Medium. Hope I can consistently to share anything that I learned. Thanks for reading, hope it will help you to take advantage of Helm templates. If there any question or feedbacks drop in comment below.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=783b2f7e401a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>