<?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/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Helm · Shehu Awwal</title>
    <link>https://shehuawwal.com/tags/helm/</link>
    <description>Helm posts on Shehu Awwal</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>© 2026 Shehu Awwal</copyright>
    <lastBuildDate>Sun, 05 Oct 2025 12:54:35 +0000</lastBuildDate>
    <image>
      <url>https://cdn.shehuawwal.com/images/avatar.png</url>
      <title>Shehu Awwal</title>
      <link>https://shehuawwal.com/</link>
    </image>
    <atom:link href="https://shehuawwal.com/tags/helm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Install Longhorn In Kubernetes With Helm Chart</title>
      <link>https://shehuawwal.com/2025/10/install-longhorn-in-kubernetes-with-helm-chart.html/</link>
      <guid isPermaLink="true">https://shehuawwal.com/2025/10/install-longhorn-in-kubernetes-with-helm-chart.html/</guid>
      <pubDate>Sun, 05 Oct 2025 12:54:35 +0000</pubDate>
      <dc:creator>Shehu Awwal</dc:creator>
      <category>Kubernetes</category>
      <category>Helm</category>
      <category>Longhorn</category>
      <category>Storage</category>
      <description>Learn how to install Longhorn in Kubernetes with Helm, check the node prerequisites, open the UI and create a replicated persistent volume for your pods.</description>
      <media:content url="https://cdn.shehuawwal.com/images/longhorn-hero.jpg" medium="image" type="image/jpeg" />
      <content:encoded>&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/longhorn-hero.jpg&#34; alt=&#34;&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;My homelab runs k3s on a few small nodes. k3s comes with the &lt;code&gt;local-path&lt;/code&gt; storage class, which is fine until a node goes down. A &lt;code&gt;local-path&lt;/code&gt; volume is just a folder on one node, so the pod that uses it can only run on that node. When the node is off, the pod is stuck in &lt;code&gt;Pending&lt;/code&gt; and the data is not reachable.&lt;/p&gt;&#xA;&lt;p&gt;I wanted persistent volumes that survive a node failure without running a separate NAS or Ceph cluster. Longhorn does that with the disks the nodes already have, and it installs with a single Helm chart. In this guide I&amp;rsquo;ll show you how I install it, check that it works and give a pod a replicated volume.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-longhorn&#34;&gt;What Is Longhorn&lt;/h2&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;Longhorn is a distributed block storage system for Kubernetes.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;It started at Rancher (now SUSE) and is a CNCF project. Longhorn takes the local disks on your nodes and turns them into replicated volumes. Every volume has one engine and several replicas, and each replica is stored on a different node. If a node dies, the volume keeps working from the replicas on the other nodes, and Longhorn rebuilds the missing replica when it can.&lt;/p&gt;&#xA;&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/longhorn-replicas.png&#34; alt=&#34;Longhorn replicates each volume across nodes: a pod on node 1 uses a volume whose replicas live on the disks of nodes 1, 2 and 3&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;It also gives you:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Snapshots of a volume.&lt;/li&gt;&#xA;&lt;li&gt;Backups to S3 compatible storage or NFS.&lt;/li&gt;&#xA;&lt;li&gt;ReadWriteMany (RWX) volumes over NFSv4.&lt;/li&gt;&#xA;&lt;li&gt;A web UI to see volumes, nodes, replicas and backups.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This guide is based on Longhorn &lt;strong&gt;v1.13.0&lt;/strong&gt;, which is the latest chart at the time of writing.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&lt;p&gt;Longhorn runs on every node, so every node needs a few things. From the &lt;a href=&#34;https://longhorn.io/docs/1.13.0/deploy/install/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Longhorn installation requirements&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Requirement&lt;/th&gt;&#xA;          &lt;th&gt;Notes&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Kubernetes&lt;/td&gt;&#xA;          &lt;td&gt;v1.34 or later for Longhorn v1.13&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Container runtime&lt;/td&gt;&#xA;          &lt;td&gt;Any runtime Kubernetes supports, e.g. containerd (k3s uses containerd)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;open-iscsi&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;iscsid&lt;/code&gt; must be running and the &lt;code&gt;iscsi_tcp&lt;/code&gt; module loaded&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;NFSv4 client&lt;/td&gt;&#xA;          &lt;td&gt;Needed for RWX volumes and NFS backups&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Tools&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;bash&lt;/code&gt;, &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;findmnt&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;awk&lt;/code&gt;, &lt;code&gt;blkid&lt;/code&gt;, &lt;code&gt;lsblk&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Filesystem&lt;/td&gt;&#xA;          &lt;td&gt;The host disk Longhorn uses should be ext4 or XFS&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Helm&lt;/td&gt;&#xA;          &lt;td&gt;v3.0 or later on your machine&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;The chart for v1.13.0 sets &lt;code&gt;kubeVersion: &amp;gt;=1.34.0-0&lt;/code&gt;, so Helm will refuse to install it on an older cluster. If you are on an older Kubernetes version, either upgrade the cluster or install the v1.12 chart with &lt;code&gt;--version 1.12.2&lt;/code&gt;, which supports Kubernetes v1.25 and later.&lt;/p&gt;&#xA;&lt;p&gt;Check your cluster version first:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;install-the-packages-on-each-node&#34;&gt;Install The Packages On Each Node&lt;/h3&gt;&lt;p&gt;On Ubuntu or Debian, run this on every node:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt install -y open-iscsi nfs-common&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo systemctl &lt;span class=&#34;nb&#34;&gt;enable&lt;/span&gt; --now iscsid&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo modprobe iscsi_tcp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure &lt;code&gt;iscsid&lt;/code&gt; is &lt;code&gt;active (running)&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo systemctl status iscsid&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The docs warn that open-iscsi version 2.1.12 causes volume attach failures. Use 2.1.11 or older, or 2.1.13 or newer. You can check the installed version with &lt;code&gt;iscsiadm --version&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you want encrypted volumes later, also install &lt;code&gt;cryptsetup&lt;/code&gt; and &lt;code&gt;dmsetup&lt;/code&gt;. I don&amp;rsquo;t need them in this guide.&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-the-preflight-check&#34;&gt;Run The Preflight Check&lt;/h3&gt;&lt;p&gt;Longhorn has a CLI called &lt;code&gt;longhornctl&lt;/code&gt; that checks every node for you. It uses your kubeconfig, so run it from the machine where &lt;code&gt;kubectl&lt;/code&gt; works. Download it for your CPU (use &lt;code&gt;longhornctl-linux-arm64&lt;/code&gt; on ARM64):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -sSfL -o longhornctl https://github.com/longhorn/cli/releases/download/v1.13.0/longhornctl-linux-amd64&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;chmod +x longhornctl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then run the check:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;./longhornctl check preflight&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Read the result for each node and fix anything it reports as missing, such as a stopped &lt;code&gt;iscsid&lt;/code&gt; or a missing NFS client. &lt;code&gt;longhornctl&lt;/code&gt; can also install the missing packages for you with &lt;code&gt;install preflight&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;./longhornctl --kubeconfig ~/.kube/config --image longhornio/longhorn-cli:v1.13.0 install preflight&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;a-note-for-k3s&#34;&gt;A Note For k3s&lt;/h3&gt;&lt;p&gt;Longhorn works on k3s without extra settings. Since k3s v0.10.0 the kubelet root directory is &lt;code&gt;/var/lib/kubelet&lt;/code&gt;, which is what Longhorn expects. You still need &lt;code&gt;open-iscsi&lt;/code&gt; on each node like any other cluster.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-longhorn-with-helm&#34;&gt;Install Longhorn With Helm&lt;/h2&gt;&lt;p&gt;Add the Longhorn chart repository and update it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo add longhorn https://charts.longhorn.io&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Install the chart:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.13.0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;longhorn&lt;/code&gt;: the release name.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;longhorn/longhorn&lt;/code&gt;: the chart, from the &lt;code&gt;longhorn&lt;/code&gt; repo we just added.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--namespace longhorn-system&lt;/code&gt;: install everything in the &lt;code&gt;longhorn-system&lt;/code&gt; namespace, which is the namespace the Longhorn docs use.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--create-namespace&lt;/code&gt;: create the namespace if it doesn&amp;rsquo;t exist.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--version 1.13.0&lt;/code&gt;: pin the chart version so you get the same install next time. Leave it out to get the latest.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;fewer-than-three-nodes&#34;&gt;Fewer Than Three Nodes&lt;/h3&gt;&lt;p&gt;The default Longhorn storage class keeps &lt;strong&gt;3 replicas&lt;/strong&gt; of every volume, each on a different node. With only one or two nodes, Longhorn can&amp;rsquo;t place all the replicas and the volumes stay degraded. Set the replica count to the number of nodes you have with &lt;code&gt;persistence.defaultClassReplicaCount&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.13.0 &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --set persistence.defaultClassReplicaCount&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you already installed it, use &lt;code&gt;helm upgrade&lt;/code&gt; with the same flags instead of &lt;code&gt;helm install&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;verify-the-installation&#34;&gt;Verify The Installation&lt;/h2&gt;&lt;p&gt;It takes a few minutes for all the pods to start. Watch them with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n longhorn-system get pods&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Wait until every pod is &lt;code&gt;Running&lt;/code&gt; and the &lt;code&gt;READY&lt;/code&gt; column is full (e.g. &lt;code&gt;1/1&lt;/code&gt;, &lt;code&gt;3/3&lt;/code&gt;). You should see pods like &lt;code&gt;longhorn-manager&lt;/code&gt; (one per node), &lt;code&gt;longhorn-ui&lt;/code&gt;, &lt;code&gt;longhorn-driver-deployer&lt;/code&gt;, &lt;code&gt;instance-manager&lt;/code&gt;, &lt;code&gt;engine-image&lt;/code&gt; and the CSI pods (&lt;code&gt;csi-attacher&lt;/code&gt;, &lt;code&gt;csi-provisioner&lt;/code&gt;, &lt;code&gt;csi-resizer&lt;/code&gt;, &lt;code&gt;csi-snapshotter&lt;/code&gt;, &lt;code&gt;longhorn-csi-plugin&lt;/code&gt;). If a pod is stuck in &lt;code&gt;CrashLoopBackOff&lt;/code&gt;, check its logs with &lt;code&gt;kubectl -n longhorn-system logs &amp;lt;pod&amp;gt;&lt;/code&gt;. It&amp;rsquo;s often a missing prerequisite on that node.&lt;/p&gt;&#xA;&lt;p&gt;Then check the storage classes:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get storageclass&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see a storage class called &lt;code&gt;longhorn&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;access-the-longhorn-ui&#34;&gt;Access The Longhorn UI&lt;/h2&gt;&lt;p&gt;The UI runs behind the &lt;code&gt;longhorn-frontend&lt;/code&gt; service, a ClusterIP service on port 80. The quickest way to open it is a port-forward from your machine:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n longhorn-system port-forward svc/longhorn-frontend 8080:80&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Open &lt;code&gt;http://localhost:8080&lt;/code&gt; in your browser. The dashboard shows the nodes, the disk space Longhorn can use and the volumes.&lt;/p&gt;&#xA;&lt;p&gt;The UI has &lt;strong&gt;no authentication&lt;/strong&gt; by default, and anyone who can reach it can delete your volumes. Don&amp;rsquo;t expose &lt;code&gt;longhorn-frontend&lt;/code&gt; with a LoadBalancer or NodePort. If you need it outside the cluster, put it behind an Ingress with basic auth. The docs have guides for &lt;a href=&#34;https://longhorn.io/docs/1.13.0/deploy/accessing-the-ui/longhorn-ingress-traefik/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Traefik&lt;/a&gt; (the default ingress on k3s), &lt;a href=&#34;https://longhorn.io/docs/1.13.0/deploy/accessing-the-ui/longhorn-ingress/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;NGINX&lt;/a&gt; and the &lt;a href=&#34;https://longhorn.io/docs/1.13.0/deploy/accessing-the-ui/longhorn-httproute/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gateway API&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-volume-for-a-pod&#34;&gt;Create A Volume For A Pod&lt;/h2&gt;&lt;p&gt;Now let&amp;rsquo;s use it. Save this as &lt;code&gt;longhorn-test.yaml&lt;/code&gt;. It creates a 1 GiB PersistentVolumeClaim on the &lt;code&gt;longhorn&lt;/code&gt; storage class and a small pod that writes to it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;apiVersion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;v1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;kind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;PersistentVolumeClaim&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;longhorn-test-pvc&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;accessModes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;ReadWriteOnce&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;storageClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;longhorn&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;resources&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;requests&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;storage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;1Gi&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;---&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;apiVersion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;v1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;kind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;Pod&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;longhorn-test&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;containers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;app&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;busybox:1.36&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;command&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;sh&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;-c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;echo hello from longhorn &amp;gt; /data/hello.txt &amp;amp;&amp;amp; sleep 3600&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;volumeMounts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;mountPath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;/data&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;volumes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;persistentVolumeClaim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;claimName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;longhorn-test-pvc&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Apply it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl apply -f longhorn-test.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check the claim:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get pvc longhorn-test-pvc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;STATUS&lt;/code&gt; should be &lt;code&gt;Bound&lt;/code&gt;, with &lt;code&gt;longhorn&lt;/code&gt; in the &lt;code&gt;STORAGECLASS&lt;/code&gt; column. Once the pod is &lt;code&gt;Running&lt;/code&gt;, read the file back:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; longhorn-test -- cat /data/hello.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should print &lt;code&gt;hello from longhorn&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now open the &lt;strong&gt;Volume&lt;/strong&gt; tab in the UI. You&amp;rsquo;ll see a volume with a &lt;code&gt;pvc-...&lt;/code&gt; name. It should be &lt;strong&gt;Attached&lt;/strong&gt; and &lt;strong&gt;Healthy&lt;/strong&gt;. Click on it to see its replicas and which node each replica is on. With three or more nodes, you should see three replicas on three different nodes.&lt;/p&gt;&#xA;&lt;p&gt;When you&amp;rsquo;re done, clean up:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl delete -f longhorn-test.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The storage class uses &lt;code&gt;reclaimPolicy: Delete&lt;/code&gt; by default, so deleting the PVC also deletes the Longhorn volume.&lt;/p&gt;&#xA;&lt;h2 id=&#34;make-longhorn-the-default-storageclass-on-k3s&#34;&gt;Make Longhorn The Default StorageClass On k3s&lt;/h2&gt;&lt;p&gt;The Longhorn chart marks the &lt;code&gt;longhorn&lt;/code&gt; storage class as the default (&lt;code&gt;persistence.defaultClass: true&lt;/code&gt;). k3s also marks &lt;code&gt;local-path&lt;/code&gt; as the default. With two default storage classes, a PVC that doesn&amp;rsquo;t set &lt;code&gt;storageClassName&lt;/code&gt; can end up on either one, so only keep one default.&lt;/p&gt;&#xA;&lt;p&gt;Check which classes have &lt;code&gt;(default)&lt;/code&gt; next to their name:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get storageclass&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To stop &lt;code&gt;local-path&lt;/code&gt; being the default:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl patch storageclass local-path -p &lt;span class=&#34;s1&#34;&gt;&amp;#39;{&amp;#34;metadata&amp;#34;: {&amp;#34;annotations&amp;#34;: {&amp;#34;storageclass.kubernetes.io/is-default-class&amp;#34;: &amp;#34;false&amp;#34;}}}&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;k3s manages &lt;code&gt;local-path&lt;/code&gt; with its own manifest. I haven&amp;rsquo;t confirmed whether a k3s restart or upgrade sets the annotation back. If you don&amp;rsquo;t need &lt;code&gt;local-path&lt;/code&gt; at all, you can start the k3s server with &lt;code&gt;--disable local-storage&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;d rather keep &lt;code&gt;local-path&lt;/code&gt; as the default and only use Longhorn when you ask for it, install the chart with &lt;code&gt;--set persistence.defaultClass=false&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After that, run &lt;code&gt;kubectl get storageclass&lt;/code&gt; again. Only &lt;code&gt;longhorn&lt;/code&gt; should show &lt;code&gt;(default)&lt;/code&gt;. A quick way to be sure it all works is to drain one node with &lt;code&gt;kubectl drain &amp;lt;node&amp;gt; --ignore-daemonsets --delete-emptydir-data&lt;/code&gt; while a Deployment with one replica uses a Longhorn volume (a bare pod like the test above won&amp;rsquo;t be rescheduled), and watch the new pod start on another node with its data still there. Run &lt;code&gt;kubectl uncordon &amp;lt;node&amp;gt;&lt;/code&gt; when you&amp;rsquo;re done.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Harbor: The Ultimate Container Registry Solution</title>
      <link>https://shehuawwal.com/2024/12/harbor-the-ultimate-container-registry-solution.html/</link>
      <guid isPermaLink="true">https://shehuawwal.com/2024/12/harbor-the-ultimate-container-registry-solution.html/</guid>
      <pubDate>Thu, 12 Dec 2024 11:13:46 +0000</pubDate>
      <dc:creator>Shehu Awwal</dc:creator>
      <category>Kubernetes</category>
      <category>Containers</category>
      <category>Docker</category>
      <category>Helm</category>
      <category>Harbor</category>
      <description>Learn how to install Harbor on Kubernetes with Helm, push and scan images with Trivy, use robot accounts for CI and cache Docker Hub images.</description>
      <media:content url="https://cdn.shehuawwal.com/images/harbor-hero.jpg" medium="image" type="image/jpeg" />
      <content:encoded>&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/harbor-hero.jpg&#34; alt=&#34;&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every time I rebuilt a few nodes in my homelab cluster, all of them pulled the same images from Docker Hub at the same time. After a while some pods got stuck in &lt;code&gt;ImagePullBackOff&lt;/code&gt; because I had hit the Docker Hub pull rate limit.&lt;/p&gt;&#xA;&lt;p&gt;I also wanted a private place for my own images, and I wanted to know if those images had known vulnerabilities before I deployed them. Harbor does all of this in one place, so in this guide I&amp;rsquo;ll show you how I install it on Kubernetes with Helm and use it day to day.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-harbor&#34;&gt;What Is Harbor&lt;/h2&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;Harbor is an open source container registry that stores, signs and scans container images, with access control on top.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Harbor is a CNCF graduated project. Beyond a plain registry, it gives you:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Projects:&lt;/strong&gt; a way to group repositories. Each project can be public or private.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;RBAC:&lt;/strong&gt; users and groups get roles per project, so you control who can push and who can only pull.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Vulnerability scanning:&lt;/strong&gt; Trivy is built in and scans images for known CVEs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Replication:&lt;/strong&gt; push or pull images to and from other registries, including another Harbor.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proxy cache:&lt;/strong&gt; pull images through Harbor from Docker Hub and other registries, and keep a local copy.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Robot accounts:&lt;/strong&gt; credentials for CI and other machines that are not tied to a person.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Signing:&lt;/strong&gt; support for signed artifacts, e.g. with Cosign or Notation.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/harbor-architecture.png&#34; alt=&#34;Harbor architecture: developers and CI push images to Harbor, Trivy scans them, Harbor replicates to another registry, and Kubernetes nodes pull from Harbor&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&lt;p&gt;This guide is based on Harbor chart &lt;strong&gt;1.19.4&lt;/strong&gt;, which installs Harbor &lt;strong&gt;2.15.4&lt;/strong&gt;. The chart README lists these minimum versions:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Requirement&lt;/th&gt;&#xA;          &lt;th&gt;Version&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Kubernetes&lt;/td&gt;&#xA;          &lt;td&gt;1.20+&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Helm&lt;/td&gt;&#xA;          &lt;td&gt;v3.2.0+&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;You also need:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;An Ingress controller, e.g. ingress-nginx. Harbor is exposed through an Ingress in this guide.&lt;/li&gt;&#xA;&lt;li&gt;TLS for your domain. I use cert-manager with a &lt;code&gt;ClusterIssuer&lt;/code&gt;, but any Kubernetes TLS secret with &lt;code&gt;tls.crt&lt;/code&gt; and &lt;code&gt;tls.key&lt;/code&gt; works.&lt;/li&gt;&#xA;&lt;li&gt;A default StorageClass. The chart creates PersistentVolumeClaims for the registry, database, Redis, job logs and Trivy.&lt;/li&gt;&#xA;&lt;li&gt;A DNS name that points to your Ingress controller. I&amp;rsquo;ll use &lt;code&gt;harbor.example.com&lt;/code&gt; in this guide.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Check your versions and the default StorageClass:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get storageclass&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;One StorageClass should have &lt;code&gt;(default)&lt;/code&gt; next to its name.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-harbor-with-helm&#34;&gt;Install Harbor With Helm&lt;/h2&gt;&lt;h3 id=&#34;add-the-harbor-helm-repository&#34;&gt;Add The Harbor Helm Repository&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo add harbor https://helm.goharbor.io&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can list the available chart versions with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm search repo harbor/harbor --versions &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; head&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-the-valuesyaml-file&#34;&gt;Create The values.yaml File&lt;/h3&gt;&lt;p&gt;The chart&amp;rsquo;s default &lt;code&gt;values.yaml&lt;/code&gt; is long. You only need to override a few keys. Create a &lt;code&gt;values.yaml&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;expose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;ingress&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;certSource&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;secret&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;secret&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;secretName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;harbor-tls&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ingress&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;hosts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;core&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;harbor.example.com&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;annotations&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;cert-manager.io/cluster-issuer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;letsencrypt-prod&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;externalURL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;https://harbor.example.com&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;# Change this before you install, and change it again in the UI after the first login.&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;harborAdminPassword&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;ChangeMe123!&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;persistence&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;resourcePolicy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;keep&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;persistentVolumeClaim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;registry&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;50Gi&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;trivy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;5Gi&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is what the important values do:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;expose.type: ingress&lt;/code&gt;:&lt;/strong&gt; expose Harbor through an Ingress. The chart also supports &lt;code&gt;clusterIP&lt;/code&gt;, &lt;code&gt;nodePort&lt;/code&gt;, &lt;code&gt;loadBalancer&lt;/code&gt; and a Gateway API &lt;code&gt;route&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;expose.tls.certSource: secret&lt;/code&gt;:&lt;/strong&gt; read the TLS certificate from the secret in &lt;code&gt;expose.tls.secret.secretName&lt;/code&gt;. With the cert-manager annotation, cert-manager creates &lt;code&gt;harbor-tls&lt;/code&gt; for you. If you already have a certificate, create the secret yourself and drop the annotation. The default, &lt;code&gt;auto&lt;/code&gt;, generates a self-signed certificate, which Docker won&amp;rsquo;t trust without extra setup.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;expose.ingress.hosts.core&lt;/code&gt;:&lt;/strong&gt; the hostname of the Harbor UI and registry.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;expose.ingress.className&lt;/code&gt;:&lt;/strong&gt; the IngressClass of your Ingress controller. Run &lt;code&gt;kubectl get ingressclass&lt;/code&gt; if you&amp;rsquo;re not sure.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;expose.ingress.annotations&lt;/code&gt;:&lt;/strong&gt; I add the cert-manager issuer here. Change &lt;code&gt;letsencrypt-prod&lt;/code&gt; to the name of your own &lt;code&gt;ClusterIssuer&lt;/code&gt;. Helm merges this with the chart&amp;rsquo;s default annotations, so the &lt;code&gt;proxy-body-size: &amp;quot;0&amp;quot;&lt;/code&gt; annotations that allow large image layers stay in place.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;externalURL&lt;/code&gt;:&lt;/strong&gt; the URL Harbor shows in the UI and uses for the token service. It must match the hostname above, with &lt;code&gt;https://&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;harborAdminPassword&lt;/code&gt;:&lt;/strong&gt; the initial password of the &lt;code&gt;admin&lt;/code&gt; user. The chart default is &lt;code&gt;Harbor12345&lt;/code&gt;, so always change it. You can also store it in a secret and point &lt;code&gt;existingSecretAdminPassword&lt;/code&gt; at it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;persistence.resourcePolicy: &amp;quot;keep&amp;quot;&lt;/code&gt;:&lt;/strong&gt; Helm keeps the registry PVCs when you uninstall the chart, so you don&amp;rsquo;t lose your images by accident.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;persistence.persistentVolumeClaim.registry.size&lt;/code&gt;:&lt;/strong&gt; the size of the volume that stores the images. The default is 5Gi, which fills up quickly. Leave &lt;code&gt;storageClass&lt;/code&gt; empty to use the default StorageClass.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;install-the-chart&#34;&gt;Install The Chart&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm upgrade --install harbor harbor/harbor &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --version 1.19.4 &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  -n harbor --create-namespace &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  -f values.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;helm upgrade --install&lt;/code&gt; installs the chart the first time and upgrades it when you change &lt;code&gt;values.yaml&lt;/code&gt; later. Drop &lt;code&gt;--version&lt;/code&gt; to get the latest chart.&lt;/p&gt;&#xA;&lt;h2 id=&#34;verify-the-installation&#34;&gt;Verify The Installation&lt;/h2&gt;&lt;p&gt;Watch the pods come up:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get pods -n harbor -w&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see pods for core, database, jobservice, portal, redis, registry and trivy. All pods should be &lt;code&gt;Running&lt;/code&gt; and ready. The first start can take a few minutes while the database is set up, and some pods may restart once while they wait for it.&lt;/p&gt;&#xA;&lt;p&gt;Check the Ingress:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get ingress -n harbor&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;HOSTS&lt;/code&gt; column should show &lt;code&gt;harbor.example.com&lt;/code&gt; and &lt;code&gt;ADDRESS&lt;/code&gt; should show your Ingress controller&amp;rsquo;s address. If you use cert-manager, check that the certificate is ready:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get certificate -n harbor&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;READY&lt;/code&gt; should be &lt;code&gt;True&lt;/code&gt;. Now open &lt;code&gt;https://harbor.example.com&lt;/code&gt; in your browser and log in as &lt;code&gt;admin&lt;/code&gt; with the password from &lt;code&gt;values.yaml&lt;/code&gt;. Change it straight away from the user menu at the top right.&lt;/p&gt;&#xA;&lt;h2 id=&#34;push-your-first-image&#34;&gt;Push Your First Image&lt;/h2&gt;&lt;h3 id=&#34;create-a-project&#34;&gt;Create A Project&lt;/h3&gt;&lt;p&gt;When Harbor starts, it creates a public project called &lt;code&gt;library&lt;/code&gt;. I prefer a separate private project for my own images.&lt;/p&gt;&#xA;&lt;p&gt;Go to &lt;strong&gt;Projects&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Project&lt;/strong&gt;, enter a name like &lt;code&gt;homelab&lt;/code&gt;, leave &lt;strong&gt;Public&lt;/strong&gt; unchecked so the project is private, and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;log-in-with-docker&#34;&gt;Log In With Docker&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker login harbor.example.com&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enter &lt;code&gt;admin&lt;/code&gt; (or your own Harbor user) and the password. Docker should print &lt;code&gt;Login Succeeded&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;tag-and-push-an-image&#34;&gt;Tag And Push An Image&lt;/h3&gt;&lt;p&gt;Pull an image, tag it with your Harbor hostname and project, then push it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker pull nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker tag nginx:latest harbor.example.com/library/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker push harbor.example.com/library/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the private project, the tag looks like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker tag nginx:latest harbor.example.com/homelab/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker push harbor.example.com/homelab/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The format is always &lt;code&gt;&amp;lt;harbor-host&amp;gt;/&amp;lt;project&amp;gt;/&amp;lt;repository&amp;gt;:&amp;lt;tag&amp;gt;&lt;/code&gt;. After the push, the image shows up under &lt;strong&gt;Projects&lt;/strong&gt; &amp;gt; &lt;strong&gt;homelab&lt;/strong&gt; &amp;gt; &lt;strong&gt;Repositories&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;scan-the-image-with-trivy&#34;&gt;Scan The Image With Trivy&lt;/h2&gt;&lt;p&gt;Trivy is enabled by default in the chart. To scan an image:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to &lt;strong&gt;Projects&lt;/strong&gt; and select your project.&lt;/li&gt;&#xA;&lt;li&gt;Open the &lt;strong&gt;Repositories&lt;/strong&gt; tab and select the &lt;code&gt;nginx&lt;/code&gt; repository.&lt;/li&gt;&#xA;&lt;li&gt;Select the artifact and click &lt;strong&gt;Scan Vulnerability&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The &lt;strong&gt;Vulnerabilities&lt;/strong&gt; column shows the status, e.g. &lt;code&gt;Queued&lt;/code&gt;, &lt;code&gt;Scanning&lt;/code&gt; and then &lt;code&gt;Complete&lt;/code&gt;. When it completes, it shows the number of vulnerabilities per severity and how many are fixable. Click the artifact to see the CVE list.&lt;/p&gt;&#xA;&lt;p&gt;You can make this automatic in the project&amp;rsquo;s &lt;strong&gt;Configuration&lt;/strong&gt; tab by checking &lt;strong&gt;Automatically scan images on push&lt;/strong&gt;. In the same tab, &lt;strong&gt;Prevent vulnerable images from running&lt;/strong&gt; blocks pulls of images above a severity you choose.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-robot-account-for-ci&#34;&gt;Create A Robot Account For CI&lt;/h2&gt;&lt;p&gt;I don&amp;rsquo;t want my admin password in a CI pipeline. A robot account is a better fit because you can limit it to one project and set an expiry.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to &lt;strong&gt;Projects&lt;/strong&gt;, select your project and open the &lt;strong&gt;Robot Accounts&lt;/strong&gt; tab.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;strong&gt;New Robot Account&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter a name like &lt;code&gt;ci&lt;/code&gt;, set an expiration time, and pick the permissions. For pushing and pulling images, the repository push and pull permissions are enough.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;strong&gt;Finish&lt;/strong&gt;, then copy the secret or click &lt;strong&gt;Export to File&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Harbor only shows the secret once, so save it in your CI secret store straight away. With the default prefix, the robot account name looks like &lt;code&gt;robot$homelab+ci&lt;/code&gt;. Use that name and the secret with &lt;code&gt;docker login&lt;/code&gt; in CI:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$HARBOR_ROBOT_SECRET&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; docker login harbor.example.com &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  -u &lt;span class=&#34;s1&#34;&gt;&amp;#39;robot$homelab+ci&amp;#39;&lt;/span&gt; --password-stdin&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Use single quotes around the username so your shell doesn&amp;rsquo;t treat &lt;code&gt;$homelab&lt;/code&gt; as a variable.&lt;/p&gt;&#xA;&lt;h2 id=&#34;pull-images-from-kubernetes&#34;&gt;Pull Images From Kubernetes&lt;/h2&gt;&lt;p&gt;Pods can pull from a public project without credentials. For a private project, create an image pull secret in the namespace where the pod runs. I use a robot account with pull permission for this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl create secret docker-registry harbor-pull &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --docker-server&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;harbor.example.com &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --docker-username&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;robot$homelab+k8s&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --docker-password&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;lt;robot-secret&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --docker-email&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;you@example.com &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  -n default&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then reference it in your Deployment with &lt;code&gt;imagePullSecrets&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;apiVersion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;apps/v1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;kind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;Deployment&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;namespace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;replicas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;selector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;matchLabels&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;app&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;template&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;labels&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;app&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;imagePullSecrets&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;harbor-pull&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;containers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;harbor.example.com/homelab/nginx:latest&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ports&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;            &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;containerPort&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;80&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Apply it and check the pod:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl apply -f deployment.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get pods -l &lt;span class=&#34;nv&#34;&gt;app&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;nginx&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl describe pod -l &lt;span class=&#34;nv&#34;&gt;app&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;nginx &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep -A5 Events&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The pod should be &lt;code&gt;Running&lt;/code&gt;, and the events should show the image pulled from &lt;code&gt;harbor.example.com&lt;/code&gt;. If you see &lt;code&gt;ImagePullBackOff&lt;/code&gt;, check the secret name, the robot account permissions and that the secret is in the same namespace as the pod.&lt;/p&gt;&#xA;&lt;h2 id=&#34;optional-use-harbor-as-a-docker-hub-proxy-cache&#34;&gt;Optional: Use Harbor As A Docker Hub Proxy Cache&lt;/h2&gt;&lt;p&gt;This is what fixed my original rate limit problem. A proxy cache project pulls an image from Docker Hub the first time, then serves the cached copy to every node after that. Only a system administrator can set it up.&lt;/p&gt;&#xA;&lt;h3 id=&#34;create-a-registry-endpoint&#34;&gt;Create A Registry Endpoint&lt;/h3&gt;&lt;ol&gt;&#xA;&lt;li&gt;Go to &lt;strong&gt;Administration&lt;/strong&gt; &amp;gt; &lt;strong&gt;Registries&lt;/strong&gt; and click &lt;strong&gt;New Endpoint&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;strong&gt;Provider&lt;/strong&gt; to &lt;strong&gt;Docker Hub&lt;/strong&gt; and give it a name, e.g. &lt;code&gt;dockerhub&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Add your Docker Hub username and an access token. Anonymous access works too, but authenticated pulls get a higher rate limit.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;strong&gt;Test Connection&lt;/strong&gt;, then &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;create-the-proxy-cache-project&#34;&gt;Create The Proxy Cache Project&lt;/h3&gt;&lt;p&gt;Go to &lt;strong&gt;Projects&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Project&lt;/strong&gt;, name it &lt;code&gt;dockerhub-proxy&lt;/code&gt;, turn on the &lt;strong&gt;Proxy Cache&lt;/strong&gt; slider, select the &lt;code&gt;dockerhub&lt;/code&gt; endpoint and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can&amp;rsquo;t push to a proxy cache project, only pull. By default, Harbor adds a 7 day retention policy to each new proxy cache project.&lt;/p&gt;&#xA;&lt;h3 id=&#34;pull-through-the-proxy&#34;&gt;Pull Through The Proxy&lt;/h3&gt;&lt;p&gt;Add &lt;code&gt;&amp;lt;harbor-host&amp;gt;/&amp;lt;proxy-project&amp;gt;/&lt;/code&gt; in front of the Docker Hub image path. Official Docker Hub images live under &lt;code&gt;library/&lt;/code&gt;, so &lt;code&gt;nginx:latest&lt;/code&gt; becomes:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker pull harbor.example.com/dockerhub-proxy/library/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The same path works in a pod spec:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;harbor.example.com/dockerhub-proxy/library/nginx:latest&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the first pull, the image appears under &lt;strong&gt;Projects&lt;/strong&gt; &amp;gt; &lt;strong&gt;dockerhub-proxy&lt;/strong&gt; &amp;gt; &lt;strong&gt;Repositories&lt;/strong&gt;. Harbor still sends a HEAD request to Docker Hub to check if the image changed. According to the Harbor docs, these checks don&amp;rsquo;t count towards the Docker Hub rate limit, but pulling a changed image does.&lt;/p&gt;&#xA;&lt;h2 id=&#34;check-that-everything-works&#34;&gt;Check That Everything Works&lt;/h2&gt;&lt;p&gt;Run one last check from a machine that doesn&amp;rsquo;t have the image yet, using the CI robot account:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker login harbor.example.com -u &lt;span class=&#34;s1&#34;&gt;&amp;#39;robot$homelab+ci&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker pull harbor.example.com/homelab/nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the pull works, the scan shows &lt;code&gt;Complete&lt;/code&gt;, and your Deployment is &lt;code&gt;Running&lt;/code&gt; with an image from &lt;code&gt;harbor.example.com&lt;/code&gt;, Harbor is ready. From here, I point my CI at the robot account and switch my manifests from Docker Hub to the proxy cache project, one namespace at a time.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Setting Up Linkerd Service Mesh With Helm Charts In Kubernetes</title>
      <link>https://shehuawwal.com/2024/11/setting-linkerd-service-mesh-helm-charts-kubernetes.html/</link>
      <guid isPermaLink="true">https://shehuawwal.com/2024/11/setting-linkerd-service-mesh-helm-charts-kubernetes.html/</guid>
      <pubDate>Sat, 09 Nov 2024 13:40:02 +0000</pubDate>
      <dc:creator>Shehu Awwal</dc:creator>
      <category>Kubernetes</category>
      <category>Service Mesh</category>
      <category>Helm</category>
      <description>Learn how to install the Linkerd service mesh in Kubernetes with Helm charts, generate the mTLS certificates, add Linkerd Viz and inject the proxy.</description>
      <media:content url="https://cdn.shehuawwal.com/images/linkerd-visualization.png" medium="image" type="image/png" />
      <content:encoded>&lt;p&gt;I&amp;rsquo;ve been looking more into service meshes, especially Linkerd, and what a service mesh gives you. Its core values are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Observability&lt;/li&gt;&#xA;&lt;li&gt;Security&lt;/li&gt;&#xA;&lt;li&gt;Reliability&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/linkerd-visualization.png&#34; alt=&#34;&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;Linkerd has a control plane and a data plane. The control plane manages the configuration and policy, while the data plane (a small proxy next to each pod) handles the traffic between services.&lt;/p&gt;&#xA;&lt;p&gt;I prefer to install it with Helm charts over the &lt;code&gt;linkerd install&lt;/code&gt; CLI command. Helm is easier to manage and is the recommended way for production environments, so when something goes wrong, it&amp;rsquo;s easier to debug and fix.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;A Kubernetes cluster. The current Linkerd charts need Kubernetes 1.31 or later.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;kubectl&lt;/code&gt; and &lt;code&gt;helm&lt;/code&gt; configured to talk to the cluster.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;install-the-linkerd-cli-and-step-cli-via-brew&#34;&gt;Install The Linkerd CLI And Step CLI Via Brew&lt;/h2&gt;&lt;p&gt;I&amp;rsquo;m on macOS, so I use Homebrew to install the &lt;code&gt;linkerd&lt;/code&gt; CLI:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;brew install linkerd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We also need the &lt;code&gt;step&lt;/code&gt; CLI to generate the certificates. You can read more about it at &lt;a href=&#34;https://github.com/smallstep/cli&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://github.com/smallstep/cli&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;brew install step&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;install-linkerd-via-helm-charts&#34;&gt;Install Linkerd Via Helm Charts&lt;/h2&gt;&lt;p&gt;We will install the Linkerd CRDs, the control plane and the Viz extension with Helm.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-1-create-the-mtls-certificates&#34;&gt;Step 1: Create The mTLS Certificates&lt;/h3&gt;&lt;p&gt;Linkerd uses mutual TLS between meshed pods. Unlike &lt;code&gt;linkerd install&lt;/code&gt;, the Helm charts don&amp;rsquo;t generate the certificates for you, so you need a trust anchor (root certificate) and an issuer (intermediate) certificate and key.&lt;/p&gt;&#xA;&lt;p&gt;Generate the root certificate and key:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;step certificate create root.linkerd.cluster.local ca.crt ca.key &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --profile root-ca --no-password --insecure&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generate the intermediate (issuer) certificate and key, signed by the root, valid for one year:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;step certificate create identity.linkerd.cluster.local issuer.crt issuer.key &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --profile intermediate-ca --not-after 8760h --no-password --insecure &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --ca ca.crt --ca-key ca.key&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;--profile root-ca&lt;/code&gt; / &lt;code&gt;--profile intermediate-ca&lt;/code&gt;: the type of certificate to create.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--not-after 8760h&lt;/code&gt;: how long the certificate is valid (8760 hours is one year). Put a reminder in your calendar to rotate the issuer before then.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--no-password --insecure&lt;/code&gt;: store the key without a passphrase, so Helm can read it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--ca&lt;/code&gt; and &lt;code&gt;--ca-key&lt;/code&gt;: the root certificate and key that sign the issuer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Keep &lt;code&gt;ca.key&lt;/code&gt; somewhere safe and out of Git. You need it to issue new issuer certificates later.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-2-add-the-linkerd-helm-repository&#34;&gt;Step 2: Add The Linkerd Helm Repository&lt;/h3&gt;&lt;p&gt;Since February 2024 the Linkerd project no longer publishes open source stable releases. The old &lt;code&gt;https://helm.linkerd.io/stable&lt;/code&gt; repository stops at 2.14, so use the edge repository (stable builds are now available from Buoyant as Buoyant Enterprise for Linkerd):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo add linkerd-edge https://helm.linkerd.io/edge&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;step-3-install-the-linkerd-crds&#34;&gt;Step 3: Install The Linkerd CRDs&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm install linkerd-crds linkerd-edge/linkerd-crds -n linkerd --create-namespace&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;step-4-install-the-linkerd-control-plane-with-the-mtls-certificates&#34;&gt;Step 4: Install The Linkerd Control Plane With The mTLS Certificates&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm install linkerd-control-plane linkerd-edge/linkerd-control-plane &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  -n linkerd &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --set-file &lt;span class=&#34;nv&#34;&gt;identityTrustAnchorsPEM&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;ca.crt &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --set-file identity.issuer.tls.crtPEM&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;issuer.crt &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --set-file identity.issuer.tls.keyPEM&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;issuer.key&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;identityTrustAnchorsPEM&lt;/code&gt;: the root certificate (trust anchor).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;identity.issuer.tls.crtPEM&lt;/code&gt;: the issuer certificate.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;identity.issuer.tls.keyPEM&lt;/code&gt;: the issuer key.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If you use the Linkerd CNI plugin, add &lt;code&gt;--set cniEnabled=true&lt;/code&gt; to both the CRDs and control plane installs.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-5-install-the-linkerd-viz-extension-for-observability&#34;&gt;Step 5: Install The Linkerd Viz Extension For Observability&lt;/h3&gt;&lt;p&gt;The Viz extension goes into its own &lt;code&gt;linkerd-viz&lt;/code&gt; namespace:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm install linkerd-viz linkerd-edge/linkerd-viz -n linkerd-viz --create-namespace&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;step-6-verify-the-installation&#34;&gt;Step 6: Verify The Installation&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n linkerd get all&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;linkerd check&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;linkerd viz check&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All checks should end with a green &lt;code&gt;Status check results are √&lt;/code&gt;. If a check fails, the output tells you which component is not ready.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-7-verify-mtls-is-working&#34;&gt;Step 7: Verify mTLS Is Working&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;linkerd viz edges pod -n linkerd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;SECURED&lt;/code&gt; column should show &lt;code&gt;√&lt;/code&gt; for the connections between the Linkerd pods.&lt;/p&gt;&#xA;&lt;h2 id=&#34;inject-the-linkerd-proxy-as-a-sidecar&#34;&gt;Inject The Linkerd Proxy As A Sidecar&lt;/h2&gt;&lt;p&gt;Linkerd is now running, but there&amp;rsquo;s one more thing to do: inject the Linkerd proxy into our workloads. Only pods with the proxy are part of the mesh.&lt;/p&gt;&#xA;&lt;p&gt;Note that Linkerd injects the proxy when a pod is created, so existing pods need to be restarted after you add the annotation, e.g. with &lt;code&gt;kubectl rollout restart deploy/my-app -n my-namespace&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at the different ways of doing this.&lt;/p&gt;&#xA;&lt;h3 id=&#34;method-1-inject-using-kubectl-get-and-apply&#34;&gt;Method 1: Inject Using kubectl get And apply&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get deploy my-app -n my-namespace -o yaml &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  linkerd inject - &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  kubectl apply -f -&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;method-2-annotate-the-namespace-for-automatic-injection&#34;&gt;Method 2: Annotate The Namespace For Automatic Injection&lt;/h3&gt;&lt;p&gt;Every new pod in the namespace gets the proxy:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl annotate namespace my-namespace &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  linkerd.io/inject&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;enabled&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;method-3-add-the-annotation-to-specific-deployments&#34;&gt;Method 3: Add The Annotation To Specific Deployments&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;apiVersion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;apps/v1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;kind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;Deployment&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;my-app&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;namespace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;my-namespace&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;annotations&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;linkerd.io/inject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;template&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;annotations&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;linkerd.io/inject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;containers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;my-app&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;my-app:latest&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;method-4-use-a-helm-annotation-during-installation&#34;&gt;Method 4: Use A Helm Annotation During Installation&lt;/h3&gt;&lt;p&gt;This works if your chart passes &lt;code&gt;podAnnotations&lt;/code&gt; to the pod template, as charts created with &lt;code&gt;helm create&lt;/code&gt; do:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm upgrade --install my-app ./my-chart &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;  --set podAnnotations.&lt;span class=&#34;s2&#34;&gt;&amp;#34;linkerd\.io/inject&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;enabled&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;method-5-batch-injection-for-multiple-deployments&#34;&gt;Method 5: Batch Injection For Multiple Deployments&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;my-namespace&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; deploy in &lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;kubectl get deploy -n &lt;span class=&#34;nv&#34;&gt;$NAMESPACE&lt;/span&gt; -o name&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  kubectl get &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$deploy&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; -n &lt;span class=&#34;nv&#34;&gt;$NAMESPACE&lt;/span&gt; -o yaml &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    linkerd inject - &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    kubectl apply -f -&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can check that the proxy is running in your pods with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;linkerd check --proxy -n my-namespace&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;open-the-visualization-dashboard&#34;&gt;Open The Visualization Dashboard&lt;/h2&gt;&lt;p&gt;Now let&amp;rsquo;s open the Viz dashboard in the browser. The &lt;code&gt;web&lt;/code&gt; service lives in the &lt;code&gt;linkerd-viz&lt;/code&gt; namespace:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n linkerd-viz port-forward svc/web 8084:8084&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In your browser, visit &lt;a href=&#34;http://127.0.0.1:8084&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;http://127.0.0.1:8084&lt;/a&gt;. You can also run &lt;code&gt;linkerd viz dashboard&lt;/code&gt;, which sets up the port forward and opens the browser for you. From there you can see the success rate, requests per second and latency of every meshed workload.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Setting Up Metrics Server With Helm Charts In Kubernetes</title>
      <link>https://shehuawwal.com/2024/08/setting-metrics-server-helm-charts-kubernetes.html/</link>
      <guid isPermaLink="true">https://shehuawwal.com/2024/08/setting-metrics-server-helm-charts-kubernetes.html/</guid>
      <pubDate>Tue, 06 Aug 2024 21:53:47 +0000</pubDate>
      <dc:creator>Shehu Awwal</dc:creator>
      <category>Kubernetes</category>
      <category>Helm</category>
      <description>Learn how to install Metrics Server with Helm on a kubeadm cluster, fix the kubelet x509 IP SANs error and check node usage with kubectl top.</description>
      <media:content url="https://cdn.shehuawwal.com/images/metrics-server-hero.jpg" medium="image" type="image/jpeg" />
      <content:encoded>&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/metrics-server-hero.jpg&#34; alt=&#34;&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;On one of my personal clusters, I wanted to set up Metrics Server to see the CPU and memory usage of nodes and pods with &lt;code&gt;kubectl top&lt;/code&gt;. Metrics Server is also what the Horizontal Pod Autoscaler uses to scale on CPU and memory.&lt;/p&gt;&#xA;&lt;p&gt;The cluster is set up with kubeadm, which doesn&amp;rsquo;t install Metrics Server for you. k3s (and so k3d) ships it by default, and on Minikube you can enable it with &lt;code&gt;minikube addons enable metrics-server&lt;/code&gt;. The steps below should work on any Kubernetes distribution.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;A Kubernetes cluster and &lt;code&gt;kubectl&lt;/code&gt; configured to talk to it.&lt;/li&gt;&#xA;&lt;li&gt;Helm 3.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;install-metrics-server-via-helm-charts&#34;&gt;Install Metrics Server Via Helm Charts&lt;/h2&gt;&lt;h3 id=&#34;add-the-helm-repo&#34;&gt;Add The Helm Repo&lt;/h3&gt;&lt;p&gt;Add the Metrics Server Helm charts repo and update it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;fix-the-kubelet-tls-certificate-error&#34;&gt;Fix The Kubelet TLS Certificate Error&lt;/h3&gt;&lt;p&gt;If you install the chart with the default values on a kubeadm cluster, the pod may not become ready, and you might see a TLS certificate error like this in the logs:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;E0806 17:40:24.324644 1 scraper.go:149] &amp;#34;Failed to scrape node&amp;#34; err=&amp;#34;Get \&amp;#34;https://10.10.50.21:10250/metrics/resource\&amp;#34;: tls: failed to verify certificate: x509: cannot validate certificate for 10.10.50.21 because it doesn&amp;#39;t contain any IP SANs&amp;#34; node=&amp;#34;k8s-prod-worker-node-one&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can see the logs with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n monitoring logs deploy/metrics-server&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This happens because Metrics Server connects to each kubelet on its IP address, and by default kubeadm kubelets use a self-signed serving certificate that isn&amp;rsquo;t signed by the cluster CA and doesn&amp;rsquo;t contain the node IP.&lt;/p&gt;&#xA;&lt;p&gt;So, how do we fix this error? We need to add &lt;code&gt;--kubelet-insecure-tls&lt;/code&gt; to the Metrics Server arguments. This flag tells Metrics Server not to verify the kubelet certificates. The &lt;a href=&#34;https://github.com/kubernetes-sigs/metrics-server#configuration&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Metrics Server docs&lt;/a&gt; describe it as &amp;ldquo;for testing purposes only&amp;rdquo;, which is fine for my personal cluster.&lt;/p&gt;&#xA;&lt;p&gt;For production, the better fix is to have the kubelets use serving certificates signed by the cluster CA. On kubeadm you do this with &lt;code&gt;serverTLSBootstrap: true&lt;/code&gt;, as described in &lt;a href=&#34;https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#kubelet-serving-certs&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Enabling signed kubelet serving certificates&lt;/a&gt;. Then you don&amp;rsquo;t need &lt;code&gt;--kubelet-insecure-tls&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;create-the-override-file&#34;&gt;Create The Override File&lt;/h3&gt;&lt;p&gt;Create a values file named &lt;code&gt;metrics-server-override.yaml&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;replicas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- --&lt;span class=&#34;l&#34;&gt;kubelet-insecure-tls&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;metrics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;replicas&lt;/code&gt;: the number of Metrics Server pods. One is enough for me. Set it higher for high availability.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;args&lt;/code&gt;: extra arguments added on top of the chart&amp;rsquo;s &lt;code&gt;defaultArgs&lt;/code&gt;, so you keep the defaults and only add &lt;code&gt;--kubelet-insecure-tls&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;metrics.enabled&lt;/code&gt;: allows unauthenticated access to Metrics Server&amp;rsquo;s own &lt;code&gt;/metrics&lt;/code&gt; endpoint, e.g. for Prometheus. You can leave it out if you don&amp;rsquo;t need it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;When I first set this up, I copied the whole &lt;code&gt;defaultArgs&lt;/code&gt; list into my override file and added &lt;code&gt;--kubelet-insecure-tls&lt;/code&gt; at the end. That works too, but with &lt;code&gt;args&lt;/code&gt; you don&amp;rsquo;t have to keep a copy of the defaults in sync with the chart.&lt;/p&gt;&#xA;&lt;h3 id=&#34;install-the-chart&#34;&gt;Install The Chart&lt;/h3&gt;&lt;p&gt;Install the chart into the namespace you want. I use &lt;code&gt;monitoring&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm upgrade --install metrics-server metrics-server/metrics-server -n monitoring --create-namespace -f metrics-server-override.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;upgrade --install&lt;/code&gt;: installs the release, or upgrades it if it already exists.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-n monitoring --create-namespace&lt;/code&gt;: deploys into the &lt;code&gt;monitoring&lt;/code&gt; namespace and creates it if it doesn&amp;rsquo;t exist. Don&amp;rsquo;t forget the namespace, or it goes into your current default namespace.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-f metrics-server-override.yaml&lt;/code&gt;: applies the override file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;check-the-pod&#34;&gt;Check The Pod&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;kubectl -n monitoring get po&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;NAME                                                READY   STATUS    RESTARTS     AGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;metrics-server-5b6488dddf-9m5cw                     1/1     Running   0            3h56m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, the pod is running. You can also check that the Metrics API is registered. &lt;code&gt;AVAILABLE&lt;/code&gt; should be &lt;code&gt;True&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl get apiservice v1beta1.metrics.k8s.io&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;check-node-and-pod-usage&#34;&gt;Check Node And Pod Usage&lt;/h2&gt;&lt;p&gt;Give Metrics Server a minute or so to collect the cluster metrics. Then check the nodes:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;kubectl top no&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;NAME                           CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;k8s-prod-master-node            238m         1%     2011Mi          12%&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;k8s-prod-worker-node-one        1306m        6%     10210Mi         16%&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;k8s-prod-worker-node-two        215m         1%     11935Mi         19%&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And for pods in all namespaces:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl top pods -A&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If &lt;code&gt;kubectl top&lt;/code&gt; returns &lt;code&gt;error: Metrics API not available&lt;/code&gt; or &lt;code&gt;metrics not available yet&lt;/code&gt;, wait a bit longer and check the Metrics Server logs again.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Setting Up Argo CD With Helm Charts In Kubernetes</title>
      <link>https://shehuawwal.com/2023/12/setting-argo-cd-helm-charts-kubernetes.html/</link>
      <guid isPermaLink="true">https://shehuawwal.com/2023/12/setting-argo-cd-helm-charts-kubernetes.html/</guid>
      <pubDate>Sat, 30 Dec 2023 16:19:50 +0000</pubDate>
      <dc:creator>Shehu Awwal</dc:creator>
      <category>Kubernetes</category>
      <category>Argo</category>
      <category>Helm</category>
      <description>Learn how to install Argo CD with the official Helm chart, expose it with an NGINX Ingress and cert-manager, fix ERR_TOO_MANY_REDIRECTS and log in.</description>
      <media:content url="https://cdn.shehuawwal.com/images/argocd-hero.jpg" medium="image" type="image/jpeg" />
      <content:encoded>&lt;p&gt;&lt;p class=&#34;markdown-image&#34;&gt;&#xA;  &lt;img src=&#34;https://cdn.shehuawwal.com/images/argocd-hero.jpg&#34; alt=&#34;&#34;  /&gt;&#xA;&lt;/p&gt;&lt;/p&gt;&#xA;&lt;p&gt;I was playing around with Argo CD to get a better idea of GitOps. Installing it was easy, but the Ingress kept failing in the browser with &lt;code&gt;ERR_TOO_MANY_REDIRECTS&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I went through the Helm values in the &lt;a href=&#34;https://github.com/argoproj/argo-helm&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;argo-helm repository&lt;/a&gt; and then through this &lt;a href=&#34;https://github.com/argoproj/argo-cd/issues/2953&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GitHub issue&lt;/a&gt;, and that&amp;rsquo;s how I got it working. In this guide I&amp;rsquo;ll show you the setup I ended up with.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;A Kubernetes cluster and &lt;code&gt;kubectl&lt;/code&gt; configured to talk to it.&lt;/li&gt;&#xA;&lt;li&gt;Helm 3.&lt;/li&gt;&#xA;&lt;li&gt;An NGINX Ingress controller and cert-manager with a &lt;code&gt;ClusterIssuer&lt;/code&gt; if you want the Ingress with TLS. Otherwise skip the Ingress and use port forwarding (shown below).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;why-err_too_many_redirects-happens&#34;&gt;Why ERR_TOO_MANY_REDIRECTS Happens&lt;/h2&gt;&lt;p&gt;By default the Argo CD API server serves TLS itself and redirects HTTP to HTTPS. When the Ingress controller terminates TLS, it forwards plain HTTP to the Argo CD server, which redirects it back to HTTPS, and the browser ends up in a loop.&lt;/p&gt;&#xA;&lt;p&gt;The fix from the &lt;a href=&#34;https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Argo CD Ingress docs&lt;/a&gt; is to run the API server with TLS disabled by setting &lt;code&gt;server.insecure: &amp;quot;true&amp;quot;&lt;/code&gt; in the &lt;code&gt;argocd-cmd-params-cm&lt;/code&gt; ConfigMap. The Helm chart sets it for you with &lt;code&gt;configs.params&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-install-argo-cd-with-helm-charts&#34;&gt;How To Install Argo CD With Helm Charts&lt;/h2&gt;&lt;h3 id=&#34;add-the-helm-repo&#34;&gt;Add The Helm Repo&lt;/h3&gt;&lt;p&gt;Add the Argo CD Helm charts repo and update it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo add argo https://argoproj.github.io/argo-helm&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm repo update&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-the-override-file&#34;&gt;Create The Override File&lt;/h3&gt;&lt;p&gt;You can use this override file. Change the domain to yours, and the &lt;code&gt;ingressClassName&lt;/code&gt; and annotations to match your cluster:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;global&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;domain&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd.example.com&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;configs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;params&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;server.insecure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;server&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ingress&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ingressClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;nginx&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;annotations&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;cert-manager.io/cluster-issuer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;letsencrypt&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Save the file as &lt;code&gt;argo-custom-override.yaml&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;global.domain&lt;/code&gt;: the hostname for Argo CD. The Ingress uses it by default.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;configs.params.server.insecure&lt;/code&gt;: disables TLS on the Argo CD server, so the Ingress can send plain HTTP to it. This is what fixes the redirect loop.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;server.ingress.ingressClassName&lt;/code&gt;: the Ingress controller that serves it, &lt;code&gt;nginx&lt;/code&gt; in my case.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cert-manager.io/cluster-issuer&lt;/code&gt;: tells cert-manager which &lt;code&gt;ClusterIssuer&lt;/code&gt; to use for the certificate. My issuer is called &lt;code&gt;letsencrypt&lt;/code&gt; and uses Cloudflare DNS01. The challenge type is configured in the &lt;code&gt;ClusterIssuer&lt;/code&gt;, not on the Ingress.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;server.ingress.tls&lt;/code&gt;: enables TLS for the hostname. The certificate is stored in a secret named &lt;code&gt;argocd-server-tls&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The chart changed its Ingress values in version 6.0.0. When I first wrote this post I used chart 5.x, where the Ingress took a list under &lt;code&gt;hosts&lt;/code&gt;, &lt;code&gt;paths&lt;/code&gt; and &lt;code&gt;tls&lt;/code&gt;. In chart 6 and later these are &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt; and &lt;code&gt;tls: true&lt;/code&gt;. The file above follows the new format. If you are pinned to chart 5.x, check the values with &lt;code&gt;helm show values argo/argo-cd --version &amp;lt;version&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;install-the-chart&#34;&gt;Install The Chart&lt;/h3&gt;&lt;p&gt;Install Argo CD with the override file:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;helm upgrade --install argocd argo/argo-cd --namespace argocd --create-namespace -f argo-custom-override.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;upgrade --install&lt;/code&gt;: installs the release if it doesn&amp;rsquo;t exist, or upgrades it if it does. You can run the same command again after you change the override file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--namespace argocd --create-namespace&lt;/code&gt;: installs into the &lt;code&gt;argocd&lt;/code&gt; namespace and creates it if needed.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-f argo-custom-override.yaml&lt;/code&gt;: applies the override file on top of the chart defaults.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;check-the-pods&#34;&gt;Check The Pods&lt;/h2&gt;&lt;p&gt;Check that all pods are running:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n argocd get pods&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see something like this. As you can see, all pods are running:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;NAME                                                READY   STATUS    RESTARTS   AGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-application-controller-0                     1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-applicationset-controller-7985f946dd-tfbfp   1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-dex-server-5d5846d67d-65p4m                  1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-notifications-controller-847cfdc894-68w9r    1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-redis-6fdc6cc966-rnlcx                       1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-repo-server-6c49c96879-t789t                 1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;argocd-server-77d4b76b69-gx2n8                      1/1     Running   0          153m&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you use cert-manager, also check that the certificate is ready. &lt;code&gt;READY&lt;/code&gt; should be &lt;code&gt;True&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n argocd get certificate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;how-to-view-the-argo-cd-password&#34;&gt;How To View The Argo CD Password&lt;/h2&gt;&lt;p&gt;The initial password for the &lt;code&gt;admin&lt;/code&gt; user is stored in the &lt;code&gt;argocd-initial-admin-secret&lt;/code&gt; secret. To view it, run:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n argocd get secret argocd-initial-admin-secret -o &lt;span class=&#34;nv&#34;&gt;jsonpath&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;{.data.password}&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; base64 -d&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you have the &lt;code&gt;argocd&lt;/code&gt; CLI installed, this does the same:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;argocd admin initial-password -n argocd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;access-the-web-ui&#34;&gt;Access The Web UI&lt;/h2&gt;&lt;p&gt;Open &lt;code&gt;https://argocd.example.com&lt;/code&gt; (your domain) in the browser. The username is &lt;code&gt;admin&lt;/code&gt; and the password is the one from above.&lt;/p&gt;&#xA;&lt;p&gt;If you skipped the Ingress, use port forwarding instead. Because &lt;code&gt;server.insecure&lt;/code&gt; is on, open &lt;code&gt;http://localhost:8080&lt;/code&gt; (without &lt;code&gt;server.insecure&lt;/code&gt;, use &lt;code&gt;https://&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl port-forward svc/argocd-server -n argocd 8080:443&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After you log in, change the admin password under &lt;strong&gt;User Info&lt;/strong&gt; &amp;gt; &lt;strong&gt;Update Password&lt;/strong&gt;, or with &lt;code&gt;argocd account update-password&lt;/code&gt; from the CLI. Then delete the initial secret, as the &lt;a href=&#34;https://argo-cd.readthedocs.io/en/stable/getting_started/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Argo CD docs&lt;/a&gt; recommend. It is only used to hold the first password:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;kubectl -n argocd delete secret argocd-initial-admin-secret&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content:encoded>
    </item>
  </channel>
</rss>
