<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oliver Nadj on Medium]]></title>
        <description><![CDATA[Stories by Oliver Nadj on Medium]]></description>
        <link>https://medium.com/@mr.oliver.nadj?source=rss-2763692da961------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_OVLZA2AvNPw1R2c</url>
            <title>Stories by Oliver Nadj on Medium</title>
            <link>https://medium.com/@mr.oliver.nadj?source=rss-2763692da961------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:13:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mr.oliver.nadj/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to unlock Kubernetes REST API and link it to Swagger UI]]></title>
            <link>https://medium.com/@mr.oliver.nadj/how-to-unlock-kubernetes-rest-api-and-link-it-to-swagger-ui-e08b51e23eaf?source=rss-2763692da961------2</link>
            <guid isPermaLink="false">https://medium.com/p/e08b51e23eaf</guid>
            <category><![CDATA[kubernetes-api]]></category>
            <category><![CDATA[swagger]]></category>
            <dc:creator><![CDATA[Oliver Nadj]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 23:49:51 GMT</pubDate>
            <atom:updated>2021-11-18T23:49:51.890Z</atom:updated>
            <content:encoded><![CDATA[<p>WARNING!! Do not apply this changes on publicly available cluster unless, you hold your keys under the mat.</p><p>In case view only is sufficient, I found better guide for you: <a href="https://jonnylangefeld.com/blog/kubernetes-how-to-view-swagger-ui">https://jonnylangefeld.com/blog/kubernetes-how-to-view-swagger-ui</a></p><p>Interacting with the Kubernetes REST API via Swagger UI is not that straight forward and I did not find yet any simple as possible guide to do so.</p><p>This guide crafted on Ubuntu and show how to:</p><ul><li>create a kind cluster with ingress and expose 80 and 443 port to local machine.</li><li>expose Kubernetes REST API, using nginx proxy</li><li>install Swagger UI and point to proxied api.</li></ul><h3>Create a kind cluster</h3><pre>cat &lt;&lt;EOF | kind create cluster --config=-<br>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>name: swaggerman<br>nodes:<br>- role: control-plane<br>  kubeadmConfigPatches:<br>  - |<br>    kind: InitConfiguration<br>    nodeRegistration:<br>      kubeletExtraArgs:<br>        node-labels: &quot;ingress-ready=true&quot;<br>  extraPortMappings:<br>  - containerPort: 80<br>    hostPort: 80<br>    protocol: TCP<br>  - containerPort: 443<br>    hostPort: 443<br>    protocol: TCP<br>EOF</pre><h3>Install ingress-nginx</h3><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml">https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml</a></pre><p>Make sure ingress-nginx-controller is already running, before you proceed further.</p><h3>Expose Kubernetes REST API</h3><p>The yaml manifests will:</p><ol><li>Create api-proxy namespace</li><li>Bind default ServiceAccount to cluster-admin roles.</li><li>Create a proxy pass nginx config with with actual Bearer token and certificates.</li><li>Deploy and expose nginx as a proxy for kube api.</li><li>Create Ingress with kube-api.loc host and CORS enabled.</li></ol><p>Add kube-api.loc to /etc/hosts and make it point to 127.0.0.1.</p><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/olivernadj/Kubernetes-REST-API-feat-Swagger-UI/main/api-proxy.yaml">https://raw.githubusercontent.com/olivernadj/Kubernetes-REST-API-feat-Swagger-UI/main/api-proxy.yaml</a></pre><p>At this point you should be able to access Kube API on <a href="http://kube-api.loc/api">http://kube-api.loc/api</a></p><h3>Install Swagger UI</h3><p>The yaml manifests will:</p><ol><li>Create swagger namespace</li><li>Deploy and expose Swagger UI.</li><li>Create Ingress with swagger.loc host.</li></ol><p>Add swagger.loc to /etc/hosts and make it point to 127.0.0.1.</p><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/olivernadj/Kubernetes-REST-API-feat-Swagger-UI/main/swagger.yaml">https://raw.githubusercontent.com/olivernadj/Kubernetes-REST-API-feat-Swagger-UI/main/swagger.yaml</a></pre><p>At this point you should be able to access Swagger UI on <a href="http://swagger.loc/">http://swagger.loc/</a></p><h3>Yayy!! \o/</h3><p>I hope you succeed and enjoy carefree hand-on experience with Kubernetes REST API</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*coa2_PAA7d-pVTvB.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e08b51e23eaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>