<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Uncategorized on mikeda.me</title><link>https://mikeda.me/categories/uncategorized/</link><description>Recent content in Uncategorized on mikeda.me</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 12 Sep 2022 22:10:31 +0000</lastBuildDate><atom:link href="https://mikeda.me/categories/uncategorized/index.xml" rel="self" type="application/rss+xml"/><item><title>State Reconciliation is a two-way street</title><link>https://mikeda.me/state-reconciliation-is-a-two-way-street/</link><pubDate>Mon, 12 Sep 2022 22:10:31 +0000</pubDate><guid>https://mikeda.me/state-reconciliation-is-a-two-way-street/</guid><description>&lt;p>&lt;em>If you like this post, you can learn more about operators from my book,&lt;/em> &lt;a href="https://www.amazon.com/Kubernetes-Operator-Framework-Book-management-dp-1803232854/dp/1803232854">The Kubernetes Operator Framework Book.&lt;/a>&lt;/p>
&lt;p>Recently my team and I were working on a feature for our operator when we came across a state-reconciliation bug that was potentially serious. What&amp;rsquo;s worse, we almost didn&amp;rsquo;t catch it. This was especially surprising as a diverse team of developers that were both new and experienced with Kubernetes. The tl;dr was that it is important for an operator to watch both its &lt;em>inputs&lt;/em> and &lt;em>outputs&lt;/em>.&lt;/p></description></item><item><title>The Kubernetes Operator Framework Book is now available!</title><link>https://mikeda.me/the-kubernetes-operator-framework-book-is-now-available/</link><pubDate>Fri, 15 Jul 2022 14:35:23 +0000</pubDate><guid>https://mikeda.me/the-kubernetes-operator-framework-book-is-now-available/</guid><description>&lt;p>As of today, I am officially a published author. My first book, &lt;a href="https://www.amazon.com/Kubernetes-Operator-Framework-Book-management/dp/1803232854">&lt;em>The Kubernetes Operator Framework Book&lt;/em>&lt;/a>, is now available from &lt;a href="https://www.amazon.com/Kubernetes-Operator-Framework-Book-management/dp/1803232854">Amazon&lt;/a> and &lt;a href="https://www.packtpub.com/product/the-kubernetes-operator-framework-book/9781803232850">Packt&lt;/a> (in both print and ebook).&lt;/p>
&lt;p>In this book, I try to offer a casual introduction to Kubernetes Operators and the experience of building and maintaining one. If you or someone on your team is familiar with Kubernetes but curious about Operators, I think &lt;em>The Kubernetes Operator Framework Book&lt;/em> will be a great resource for getting up to speed with the core concepts. It was my goal with this book to provide a friendly, welcoming tutorial with hands-on application of the most important topics, which I think new users will find easy to understand.&lt;/p></description></item><item><title>How to build custom Kubernetes control plane images (and test them with Kind)</title><link>https://mikeda.me/how-to-build-custom-kubernetes-control-plane-images-and-test-them-with-kind/</link><pubDate>Tue, 03 Nov 2020 20:44:52 +0000</pubDate><guid>https://mikeda.me/how-to-build-custom-kubernetes-control-plane-images-and-test-them-with-kind/</guid><description>&lt;p>If you are working on changes to a core Kubernetes component such as
the scheduler, controller-manager, or apiserver, you may be confused
about how to actually build and deploy your changes in a local
environment to test them. This post will go over the method I use to
build and test control plane component changes. There are probably
more efficient ways to do it, but this works for me and gives me some
flexibility over each step which I will explain.&lt;/p></description></item><item><title>Error compiling oc for OpenShift on Mac</title><link>https://mikeda.me/error-compiling-oc-for-openshift-on-mac/</link><pubDate>Fri, 13 Mar 2020 17:36:41 +0000</pubDate><guid>https://mikeda.me/error-compiling-oc-for-openshift-on-mac/</guid><description>&lt;p>When I recently switched to a Mac for my personal/work laptop, I ran
into this problem trying to build
&lt;a href="http://github.com/openshift/oc">oc&lt;/a>:&lt;/p>
&lt;pre tabindex="0">&lt;code># github.com/apcera/gssapi
vendor/github.com/apcera/gssapi/name.go:213:9: could not determine kind of name for C.wrap_gss_canonicalize_name
cgo:
clang errors for preamble:
vendor/github.com/apcera/gssapi/name.go:90:2: error: unknown type name &amp;#39;gss_const_name_t&amp;#39;
 gss_const_name_t input_name,
 ^
1 error generated.
make: *** [build] Error 2
&lt;/code>&lt;/pre>&lt;p>This led me to &lt;a href="https://github.com/openshift/oc/blob/release-4.6/vendor/github.com/apcera/gssapi/name.go#L5-L18">this helpful
comment&lt;/a>
that explains the gssapi headers on Mac are outdated. This was fixed
by installing the &lt;a href="https://formulae.brew.sh/formula/heimdal">heimdal&lt;/a>
HomeBrew package: brew install heimdal&lt;/p></description></item><item><title>"git trash"</title><link>https://mikeda.me/git-trash/</link><pubDate>Tue, 05 Mar 2019 19:18:20 +0000</pubDate><guid>https://mikeda.me/git-trash/</guid><description>&lt;p>I often end up doing test bumps of dependencies that leave my repo
with a ton of trash changes that I just want to be able to undo easily
and reset my repo including any new or deleted files and directories,
so I added this to my .gitconfig :&lt;/p>
&lt;pre tabindex="0">&lt;code>[alias]
 trash = !git stash &amp;amp;&amp;amp; git clean -fd
&lt;/code>&lt;/pre>&lt;p>This lets me run git trash to quickly stash all my unstaged changes
&lt;em>and&lt;/em> delete all my untracked files at once, which I couldn&amp;rsquo;t find any
other solution for.&lt;/p></description></item><item><title>How to Add Collaborators to Your OpenShift Online Pro Account</title><link>https://mikeda.me/add-collaborators-openshift-online-pro-account/</link><pubDate>Wed, 17 Jan 2018 13:56:27 +0000</pubDate><guid>https://mikeda.me/add-collaborators-openshift-online-pro-account/</guid><description>&lt;p>*(**Note: *&lt;em>This post originally appeared on the &lt;a href="https://blog.openshift.com/add-collaborators-openshift-online-pro-account/">Red Hat OpenShift Blog&lt;/a>)&lt;/em>&lt;/p>
&lt;p>OpenShift Online recently made a new feature available to Pro accounts: Collaboration. Collaboration allows a Pro account user to provision cluster account access for other users, called &lt;em>collaborators&lt;/em>. These collaborators have normal access to the same cluster as the Pro account (without any resource quotas or ability to create new projects) and thus can be granted permissions to work on projects owned by the Pro account.&lt;/p></description></item><item><title>My First Simple Chrome Extension</title><link>https://mikeda.me/first-simple-chrome-extension/</link><pubDate>Mon, 04 Dec 2017 02:39:06 +0000</pubDate><guid>https://mikeda.me/first-simple-chrome-extension/</guid><description>&lt;p>Homebrewing is one of my favorite hobbies, so I&amp;rsquo;m a big fan of &lt;a href="https://www.brewersfriend.com/">Brewer&amp;rsquo;s Friend&lt;/a> for looking up recipes (as well as using their various calculators for OG/FG, IBUs, and others). Their search functionality is very good, and makes it easy to find exactly the kind of recipe you&amp;rsquo;re looking for.&lt;/p>
&lt;p>What&amp;rsquo;s odd, however, is that on their recipe pages they will show a total amount of grain used:&lt;/p>
&lt;p>&lt;img src="http://www.mikeda.me/wp-content/uploads/2017/12/grain.png" alt="grain">&lt;/p>
&lt;p>But for hops, they&amp;rsquo;ll only show the total for &lt;em>each type&lt;/em> of hop:&lt;/p></description></item><item><title>Hacking a Controller for OpenShift/Kubernetes, Pt. 3</title><link>https://mikeda.me/hacking-controller-openshiftkubernetes-pt-3/</link><pubDate>Thu, 25 Aug 2016 14:25:14 +0000</pubDate><guid>https://mikeda.me/hacking-controller-openshiftkubernetes-pt-3/</guid><description>&lt;p>&lt;strong>&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes/">Part 1: Introduction to the OpenShift client&lt;/a>
&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes-pt-2/">Part 2: Coding for Kubernetes&lt;/a>&lt;/strong>&lt;/p>
&lt;p>In the &lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes-pt-2/">previous post&lt;/a>, I went more in-depth into how Kubernetes works in the command line. For this post, let&amp;rsquo;s step back to the code from Part 1 of this series and modify it to run continuously, showing the list of pods currently in the cluster and updating every time a new pod is created.&lt;/p>
&lt;h2 id="the-watch-interface" class="heading-anchor">
 &lt;a href="#the-watch-interface" class="anchor-link" aria-hidden="true">&lt;svg viewBox="0 0 16 16" width="16" height="16">&lt;path fill="currentColor" d="M7.775 3.275a.75.75 0 0 0 1.06 1.06l1.25-1.25a2 2 0 1 1 2.83 2.83l-2.5 2.5a2 2 0 0 1-2.83 0 .75.75 0 0 0-1.06 1.06 3.5 3.5 0 0 0 4.95 0l2.5-2.5a3.5 3.5 0 0 0-4.95-4.95l-1.25 1.25zm-.5 9.45a.75.75 0 0 0-1.06-1.06l-1.25 1.25a2 2 0 0 1-2.83-2.83l2.5-2.5a2 2 0 0 1 2.83 0 .75.75 0 0 0 1.06-1.06 3.5 3.5 0 0 0-4.95 0l-2.5 2.5a3.5 3.5 0 1 0 4.95 4.95l1.25-1.25z"/>&lt;/svg>&lt;/a>The Watch Interface&lt;/h2>
&lt;p>Kubernetes&amp;rsquo; &lt;a href="https://godoc.org/k8s.io/kubernetes/pkg/watch#Interface">Watch interface&lt;/a> provides the ability to listen for &lt;a href="https://godoc.org/k8s.io/kubernetes/pkg/watch#Event">several different types of events&lt;/a> in the cluster. Using the &lt;a href="https://www.golang-book.com/books/intro/10#section2">channel functionality built into Go&lt;/a>, this is perfect for us to set up an asynchronous controller that can run continuously. First we need to update our code to take advantage of channels. Go back to the code we had in Part 1 and change the &lt;strong>main()&lt;/strong> function in your &lt;strong>cmd/controller/cmd.go&lt;/strong> file to look like this:
func main() {
config, err := clientcmd.DefaultClientConfig(pflag.NewFlagSet(&amp;ldquo;empty&amp;rdquo;, pflag.ContinueOnError)).ClientConfig()
kubeClient, err := kclient.New(config)
if err != nil {
log.Printf(&amp;ldquo;Error creating cluster config: %s&amp;rdquo;, err)
os.Exit(1)
}
openshiftClient, err := osclient.New(config)
if err != nil {
log.Printf(&amp;ldquo;Error creating OpenShift client: %s&amp;rdquo;, err)
os.Exit(2)
}&lt;/p></description></item><item><title>Hacking a Controller for OpenShift/Kubernetes, Pt. 2</title><link>https://mikeda.me/hacking-controller-openshiftkubernetes-pt-2/</link><pubDate>Tue, 23 Aug 2016 17:10:17 +0000</pubDate><guid>https://mikeda.me/hacking-controller-openshiftkubernetes-pt-2/</guid><description>&lt;p>&lt;strong>&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes/">Part 1: Introduction to the OpenShift client&lt;/a>&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes-pt-3/">Part 3: Writing a controller&lt;/a>&lt;/strong>&lt;/p>
&lt;p>In &lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes/">my last post&lt;/a>, I went over how to set up an OpenShift environment for developing. That tutorial used the &lt;a href="https://godoc.org/github.com/openshift/origin/pkg/client">OpenShift Client API&lt;/a> to make function calls which interacted with our cluster. However, there may be a situation where you need more direct interaction with your cluster&amp;rsquo;s resources (or perhaps you are interested in contributing to the &lt;a href="https://github.com/openshift/origin">open-source OpenShift Origin repository&lt;/a>), and even the provided function calls aren&amp;rsquo;t enough to satiate your needs. In this case, it&amp;rsquo;s good to know how OpenShift interacts with Kubernetes directly to serve your cluster resources hot-and-ready.&lt;/p></description></item><item><title>Hacking a Controller for OpenShift/Kubernetes</title><link>https://mikeda.me/hacking-controller-openshiftkubernetes/</link><pubDate>Mon, 22 Aug 2016 20:05:02 +0000</pubDate><guid>https://mikeda.me/hacking-controller-openshiftkubernetes/</guid><description>&lt;p>&lt;strong>&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes-pt-2/">Part 2: Coding for Kubernetes&lt;/a>&lt;a href="http://www.mikeda.me/hacking-controller-openshiftkubernetes-pt-3/">Part 3: Writing a controller&lt;/a>&lt;/strong>&lt;/p>
&lt;p>For OpenShift Online, we run several controllers in our cluster which serve functions such as provisioning persistent volumes and providing user analytics. But let&amp;rsquo;s say you have your &lt;em>own&lt;/em> OpenShift cluster, upon which you&amp;rsquo;d like to run a controller that interacts with the resources in that cluster. I&amp;rsquo;m going to run you through setting up OpenShift and Kubernetes in a way that allows you to develop your own controller. By the end of this guide, we&amp;rsquo;ll have a simple controller that shows the cumulative running time for all pods in a namespace.&lt;/p></description></item><item><title>Running an IRC Bot in Ruby on OpenShift V3</title><link>https://mikeda.me/running-irc-bot-ruby-openshift-v3/</link><pubDate>Thu, 04 Aug 2016 17:54:01 +0000</pubDate><guid>https://mikeda.me/running-irc-bot-ruby-openshift-v3/</guid><description>&lt;p>&lt;em>Note: This post also appears on the &lt;a href="https://blog.openshift.com/running-irc-bot-ruby-openshift-v3/">Red Hat OpenShift Blog&lt;/a>, along with many other cool posts by cool people.&lt;/em>&lt;/p>
&lt;p>At Red Hat, all of our instant internal messaging is done through IRC. Because of this, many of our channels have a couple bots in them that do things like process links, report new pull requests, and keep track of users&amp;rsquo; karma. What&amp;rsquo;s cool is that a lot of these bots are actually developed and running &lt;em>on&lt;/em> OpenShift, so let&amp;rsquo;s look at how you could get your own IRC bot running in OpenShift Online V3.&lt;/p></description></item></channel></rss>