<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-05-15T22:04:34+00:00</updated><id>/feed.xml</id><title type="html">Your awesome title</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">Kubernetes Primer</title><link href="/kubernetes/guide/2026/05/15/kubernetes-post.html" rel="alternate" type="text/html" title="Kubernetes Primer" /><published>2026-05-15T21:49:35+00:00</published><updated>2026-05-15T21:49:35+00:00</updated><id>/kubernetes/guide/2026/05/15/kubernetes-post</id><content type="html" xml:base="/kubernetes/guide/2026/05/15/kubernetes-post.html"><![CDATA[<h1 id="kubernetes-administrative-operations-primer">Kubernetes administrative operations primer</h1>

<p>Kubernetes provides an API abstraction layer over the management of container runtimes and resources. A primary selling point for me, is that this allows us to configure the runtime of clustered hosts using structured text to provide values to the api. This structured text is written in a format called Yet-Another Markup Language or YAML.</p>

<p>In our environment the kubernetes cluser is running the Rancher K3s distribution of the kube-api server and related daemons. Installed within the cluster is a series of operators which interact with the kubernetes API to provide additional functionality that can be used to further tune, secure, and manage the lifecycle of applications running on the platform.</p>

<p>Cluster Operators:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">FluxCD</code> (read “Flux Continuous Deployment”): Configured to read manifests from a Git repository and apply or reconcile them against the kubernetes API based on defined manifests which inform the flux operator of <em>how</em> resources should be deployed.</li>
  <li><code class="language-plaintext highlighter-rouge">Longhorn</code>: a CSI driver that provides block storage abstraction for persisten volumes and claims. My CSI driver of choice, it is lightweight and easy to manage in liue of Tintri’s CSI driver as unfortunately they have not yet added support for kubernetes genericly, only VMWare’s kubernetes distribution.</li>
  <li><code class="language-plaintext highlighter-rouge">Cilium</code>: a Container Network Interface (CNI) that provides custom resource abstractions over networking features, provides a Border Gateway Protocol (BGP) control plane and overlay network within the cluster.</li>
</ul>

<p><a href="https://github.com/hch-napoleon/kubernetes-flux">Cluster Configuration Repository</a>.</p>

<h2 id="administrative-control">Administrative Control</h2>

<p>As should be mentioned in the tools section of this wiki, there are two main tools that I utilize for accessing and controling a kubernetes cluster.</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">kubectl</code>: The official kubernetes API client program, a CLI application.</li>
  <li><code class="language-plaintext highlighter-rouge">OpenLens</code>: A community made graphical interface for the kubernetes API</li>
</ul>

<p>Generally, I use kubectl from within a “devcontainer” on Visual Studio Code.</p>

<h3 id="authentication">Authentication</h3>

<p>To access or control a cluster, these tools will need to authenticate using an authentication mechanism. Both read a <code class="language-plaintext highlighter-rouge">kubeconfig</code> file. Two authentication methods are permitted for our clusters; certificate, and oidc token.</p>

<p>Prioritize using the OIDC authentication flow which I will demonstrate here:</p>

<p><code class="language-plaintext highlighter-rouge">kubeconfig</code></p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">apiVersion</span><span class="pi">:</span> <span class="s">v1</span>
<span class="na">kind</span><span class="pi">:</span> <span class="s">Config</span>

<span class="na">current-context</span><span class="pi">:</span> <span class="s">internal</span>
<span class="na">preferences</span><span class="pi">:</span> <span class="pi">{}</span>

<span class="na">clusters</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">dmz</span>
    <span class="na">cluster</span><span class="pi">:</span>
      <span class="na">certificate-authority-data</span><span class="pi">:</span> <span class="s">REDACTED</span>
      <span class="na">server</span><span class="pi">:</span> <span class="s">https://REDACTED:6443</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">internal</span>
    <span class="na">cluster</span><span class="pi">:</span>
      <span class="na">certificate-authority-data</span><span class="pi">:</span> <span class="s">REDACTED</span>
      <span class="na">server</span><span class="pi">:</span> <span class="s">https://REDACTED:6443</span>

<span class="na">contexts</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">dmz</span>
    <span class="na">context</span><span class="pi">:</span>
      <span class="na">cluster</span><span class="pi">:</span> <span class="s">dmz</span>
      <span class="na">user</span><span class="pi">:</span> <span class="s">azure-broker</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">internal</span>
    <span class="na">context</span><span class="pi">:</span>
      <span class="na">cluster</span><span class="pi">:</span> <span class="s">internal</span>
      <span class="na">user</span><span class="pi">:</span> <span class="s">azure-broker</span>

<span class="na">users</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">azure-broker</span>
    <span class="na">user</span><span class="pi">:</span>
      <span class="na">exec</span><span class="pi">:</span>
        <span class="na">apiVersion</span><span class="pi">:</span> <span class="s">client.authentication.k8s.io/v1beta1</span>
        <span class="na">command</span><span class="pi">:</span> <span class="s">kubectl</span>
        <span class="na">args</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="s">oidc-login</span>
          <span class="pi">-</span> <span class="s">get-token</span>
          <span class="pi">-</span> <span class="s">--skip-open-browser</span>
          <span class="pi">-</span> <span class="s">--oidc-issuer-url=https://login.microsoftonline.com//v2.0</span>
          <span class="pi">-</span> <span class="s">--oidc-client-id=</span>
</code></pre></div></div>

<p>When authenticating using that configuration the kubectl command will prompt you to</p>

<pre><code class="language-none">Please visit the following URL in your browser: http://localhost:8000/
</code></pre>

<p>In visual studio code, this authentication flow forwards the TCP port used by the flow to the local machine over SSH*, the chord <code class="language-plaintext highlighter-rouge">ctrl+lclick</code> on the link will open the browser and run you through the OIDC flow for our EndraID tenant.</p>

<p>* As a convenience Visual Studio Code has a mechanism that automatically detects ports opening within development containers and forwards them to the localhost. In this context the unraveled meaning is that if a development container has a process running in the foreground which opens a listening port, that port is forwarded or redirected to the local machine, in this example the <code class="language-plaintext highlighter-rouge">kubectl</code> command plugin <code class="language-plaintext highlighter-rouge">oidc-login</code> opens a port on the devcontainers network namespace which vscode captures and maps the localhost’s port 8000 to the ssh connection and patches it into the container over secure shell.</p>

<p>In the event that OIDC is not working as an authentication flow, it is acceptable to fall back to using the root account’s credentials which can be downloaded from one of the nodes using ssh. The kubeconfig for the root user is located at <code class="language-plaintext highlighter-rouge">/etc/rancher/k3s/k3s.yaml</code></p>

<h3 id="commands-frequently-used">Commands frequently used</h3>

<p>TODO: Explain common administrative tasks and functions</p>

<h2 id="flux-continuous-deployment">Flux Continuous Deployment</h2>

<p>TODO: Explain what flux is doing and how the repository is structured.</p>]]></content><author><name></name></author><category term="kubernetes" /><category term="guide" /><summary type="html"><![CDATA[Kubernetes administrative operations primer]]></summary></entry></feed>