<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matt Dailey</title>
    <description>The latest articles on DEV Community by Matt Dailey (@matthewdailey).</description>
    <link>https://dev.to/matthewdailey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F566117%2F83fdabf0-48ad-4d36-a97e-55395f75d42e.jpeg</url>
      <title>DEV Community: Matt Dailey</title>
      <link>https://dev.to/matthewdailey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/matthewdailey"/>
    <language>en</language>
    <item>
      <title>Post-mortem: Kubernetes pods don't start because of too many services</title>
      <dc:creator>Matt Dailey</dc:creator>
      <pubDate>Fri, 03 Dec 2021 02:19:48 +0000</pubDate>
      <link>https://dev.to/matthewdailey/post-mortem-kubernetes-pods-dont-start-because-of-too-many-services-1129</link>
      <guid>https://dev.to/matthewdailey/post-mortem-kubernetes-pods-dont-start-because-of-too-many-services-1129</guid>
      <description>&lt;p&gt;A few weeks ago, my team ran into a really interesting service limit in Kubernetes that caused a really unexpected problem in our development environment.&lt;/p&gt;

&lt;h1&gt;
  
  
  What we saw first
&lt;/h1&gt;

&lt;p&gt;We first noticed our REST API was not available, and we quickly noticed our pods were not running.  Starting the investigation, we noticed&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;All of the pods for our REST API deployment were in &lt;code&gt;Init:CrashLoopBackoff&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Some pods in our compute deployment had the same issue, but some of those pods were working fine.&lt;/li&gt;
&lt;li&gt;The pods that were working fine tended to be over a day old, so we suspected they would hit this issue if the pods restarted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We started going down the path of investigating if there was a bug with the init container, but this ended up not being the problem.  Looking at the logs for the init container, the only line logged was.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;standard_init_linux.go:228: exec user process caused: argument list too long
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After escalating to our Kubernetes team, they let us know this error indicates the Docker container cannot start because there are too many environment variables being passed to the container.&lt;/p&gt;

&lt;h1&gt;
  
  
  Who put all these environment variables in my pod?
&lt;/h1&gt;

&lt;p&gt;Our Kubernetes experts told us about &lt;a href="https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service"&gt;enableServiceLinks&lt;/a&gt; in Kubernetes, which adds environment variables for each active service.  From the documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a Pod runs on a Node, the kubelet adds a set of environment variables for each active Service.  &lt;strong&gt;Note&lt;/strong&gt; If the service environment variables are not desired (because possible clashing with expected program ones, too many variables to process, only using DNS, etc) you can disable this mode by setting the enableServiceLinks flag to false on the pod spec.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To verify this was the cause, we started up a pod with &lt;code&gt;enableServiceLinks: false&lt;/code&gt; and it started fine.  After removing that line, we hit the same error we had above.&lt;/p&gt;

&lt;p&gt;In a working pod, you can also check this out yourself and see the environment variables being used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl exec -ti my-pod -- sh -c "env | grep SERVICE | sort"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Where did all these services come from?
&lt;/h1&gt;

&lt;p&gt;So, we had too many environment variables because we had too many services in our namespace.  Why do we have so many services?&lt;/p&gt;

&lt;p&gt;The underlying problem was caused by one process in our system that dynamically creates deployments and services, and there was a bug in cleaning up the services at the time that we would clean up the deployments.  After many weeks, the orphaned services piled up and we finally hit the limit that caused pods to fail to start up.&lt;/p&gt;

&lt;h1&gt;
  
  
  Take Aways
&lt;/h1&gt;

&lt;p&gt;This is my favorite kind of incident because&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We hit this in development before it hit production.&lt;/li&gt;
&lt;li&gt;We learned about a deep part of our infrastructure we would not have known about otherwise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So what did we learn and plan to do next?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If &lt;code&gt;enableServiceLinks&lt;/code&gt; is enabled (which is the default), Kubernetes will populate environment variables in your pod.&lt;/li&gt;
&lt;li&gt;To catch this sooner: We can monitor the number of services in the namespace before it exceeds that threshold.&lt;/li&gt;
&lt;li&gt;To mitigate faster: Write a runbook explaining the problem and how we solved it in this instance.&lt;/li&gt;
&lt;li&gt;To prevent this again: Alert when we approach the threshold, or if we see the log message in our containers again.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>kubernetes</category>
      <category>sre</category>
    </item>
    <item>
      <title>"Your job isn't to be liked" but it is to be trusted</title>
      <dc:creator>Matt Dailey</dc:creator>
      <pubDate>Tue, 04 May 2021 14:02:37 +0000</pubDate>
      <link>https://dev.to/matthewdailey/your-job-isn-t-to-be-liked-but-it-is-to-be-trusted-14e</link>
      <guid>https://dev.to/matthewdailey/your-job-isn-t-to-be-liked-but-it-is-to-be-trusted-14e</guid>
      <description>&lt;p&gt;When entering management, one piece of advice you may receive is that "your job isn't to be liked."  When I was internally interviewing for my first management position, our area lead (a senior director) handed me this knowledge.  It's even Thing #97 in &lt;a href="https://www.oreilly.com/library/view/97-things-every/9781492050896/"&gt;97 Things Every Engineering Manager Should Know&lt;/a&gt;.  If you're like me and prefer to flip to the end of books in the book store, it'll be the first thing you see!  Ultimately, I think this is really important advice, but I feel there is extra nuance that folks often miss when doling out this piece of wisdom.&lt;/p&gt;

&lt;h1&gt;
  
  
  What it's supposed to mean
&lt;/h1&gt;

&lt;p&gt;The underlying purpose of this tenet is to convey that "success" as a manager is much more than being liked by your direct reports.  In fact, seeking out being liked can be problematic because it means you may &lt;em&gt;avoid&lt;/em&gt; parts of your job, such as giving difficult feedback to your reports.  This ultimately stunts their growth, and may set them up for failure.  Kim Scott, author of &lt;a href="https://www.radicalcandor.com/the-book/"&gt;Radical Candor&lt;/a&gt;, &lt;a href="https://youtu.be/4yODalLQ2lM?t=668"&gt;tells the story of Bob&lt;/a&gt;, a floundering employee, and how she failed to deliver much-needed feedback to him until her more-productive employees finally told her "either you fire him, or we're leaving."  Trying to be liked may also mean not giving bad news to leadership or stakeholders because you don't want to disappoint them.  This can result in a missed deadline, which has a really rough impact that could have been avoided or mitigated if you were upfront about the issues.&lt;/p&gt;

&lt;h1&gt;
  
  
  So what's the problem?
&lt;/h1&gt;

&lt;p&gt;I've seen a few managers take this too far the other direction: "Just because my team doesn't like me doesn't mean I'm doing a bad job."  These managers think they're just "telling it like it is, because the team needs to hear it," but they're really just coming off as jerks. It's also true that sometimes you'll have to make a decision where you say "the team won't like this decision, but I know it's for the best."  Usually, this would be a decision like bringing your team on-call, a reorganization, or other changes that you know nobody will be thrilled about.  This can be effective some of the time, but it can't be successful if that's the default mode of thinking.  You have smart team members that report to you.  Let them do their jobs!&lt;/p&gt;

&lt;h1&gt;
  
  
  What's missing?
&lt;/h1&gt;

&lt;p&gt;Trust.  You can only balance likability and unpopular decisions if your team trusts that you are capable, and that you've weighed the consequences of those decisions.  If you make decisions without consulting with your team, or constantly go against their wishes, you risk straining this trust, and ultimately, causing your team members to leave.  Or maybe even worse yet for you, them talking to &lt;em&gt;your&lt;/em&gt; manager about how you're not doing your job properly.  Either way, it's not a good outcome for you.&lt;/p&gt;

&lt;p&gt;How do you build that trust?  You build trust by first trusting your team.  If they tell you something hadn't worked in the past, listen to them.  If they tell you something isn't working, take a look at the evidence they are showing you.  If they say they're getting burnt out, figure out how to help them.  After your team knows you care about their well-being and careers, then it can be possible to make unpopular decisions and still have your team stick with you.&lt;/p&gt;

&lt;p&gt;And please, please measure and react to those decisions.  Make sure you have proof when you say "see, this is working," or be open and admit "you were right, this wasn't the right choice."  I once watched a C-level executive lose his job after doing a massive shift in how the company worked.  Everyone complained, attrition was widespread, and his ultimate goal of faster delivery wasn't met (delivery was, in fact, slower).  He never decided to shift gears even after presented with all that evidence, so they fired him after a year of not listening to feedback.&lt;/p&gt;

&lt;p&gt;So yes, being liked shouldn't be your goal, but I've found it to be a byproduct of being trusted by your team.&lt;/p&gt;

</description>
      <category>management</category>
      <category>leadership</category>
    </item>
    <item>
      <title>Reflecting on 5 years of remote work</title>
      <dc:creator>Matt Dailey</dc:creator>
      <pubDate>Tue, 02 Mar 2021 02:11:51 +0000</pubDate>
      <link>https://dev.to/matthewdailey/reflecting-on-5-years-of-remote-work-2il0</link>
      <guid>https://dev.to/matthewdailey/reflecting-on-5-years-of-remote-work-2il0</guid>
      <description>&lt;p&gt;Let me start with what I miss. I miss seeing people in person and being able to periodically hang out with them. Everyone is feeling this now with the pandemic, but I still feel this is worth calling out as the thing that makes remote work hardest on me.&lt;/p&gt;

&lt;p&gt;OK, let's get back on track.&lt;/p&gt;

&lt;h1&gt;
  
  
  Going remote
&lt;/h1&gt;

&lt;p&gt;When I started working remotely, I ultimately wanted two things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To be able to work for interesting companies&lt;/li&gt;
&lt;li&gt;To live where I already lived&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That was it.  Articles talk a lot about perks of working remotely, but if I'm being honest, this was all I really cared about and everything else was a bonus.&lt;/p&gt;

&lt;p&gt;At the time, I was tired of my first job and said "I don't want to work in the industry I currently am, and there aren't many other jobs around here."&lt;/p&gt;

&lt;p&gt;It was always my wife and my plan to stay in the area so that we'd have family support when we had children.  That decision has really paid off since our first was born in 2020 in the middle of the pandemic.  It took 4 years, but it's vindicating to have that decision work out how we wanted it to.&lt;/p&gt;

&lt;p&gt;So, I decided if I wanted to achieve both of my two goals, that required I work remotely.  I went on StackOverflow jobs and searched "Remote, Java" which eventually landed me at Rocana, an all-remote company, which was eventually acquired by Splunk where I work now.&lt;/p&gt;

&lt;h1&gt;
  
  
  Remote work is a trade-off
&lt;/h1&gt;

&lt;p&gt;Remote work definitely has its perks such as no commute, ability to live wherever (including somewhere with a low cost of living), the ability to reduce in-person distractions, or the ability to raid your own fridge whenever you'd like.  But there are also things you miss out on like easier networking and mentorship opportunities, more difficult and missed communications, and free company swag/meals/happy hours/holiday parties.&lt;/p&gt;

&lt;p&gt;You also can run into leaders who are less empathetic about remote work.  One leader offhandedly ended a story with "and that's why I don't trust remote workers" while I was on the call (that leader has since left).  Having that story ring in my ears each time I was thinking about my future and the future of my remote direct reports was pretty demoralizing.&lt;/p&gt;

&lt;p&gt;When thinking if you want to stay remote full-time after the pandemic, these are things to think about.&lt;/p&gt;

&lt;h1&gt;
  
  
  What next
&lt;/h1&gt;

&lt;p&gt;I see myself continuing to work remotely for the foreseeable future since my family is best suited where we are now.  I definitely miss seeing people in the office, and I know that traveling to the offices will be harder post-pandemic since I have the baby at home, but I think this is still what works best for me and the family.&lt;/p&gt;

&lt;p&gt;So, ultimately, as much as I love the flexibility and opportunities I've gotten from working remotely the last 5 years, I wanted to make sure I painted a realistic picture here.  It's not completely perfect for me, but I still think it's worked out well the last few years.&lt;/p&gt;

</description>
      <category>remote</category>
      <category>workplace</category>
    </item>
    <item>
      <title>From GitHub Pages to Dev.to</title>
      <dc:creator>Matt Dailey</dc:creator>
      <pubDate>Sun, 24 Jan 2021 02:02:10 +0000</pubDate>
      <link>https://dev.to/matthewdailey/from-github-pages-to-dev-to-g79</link>
      <guid>https://dev.to/matthewdailey/from-github-pages-to-dev-to-g79</guid>
      <description>&lt;p&gt;I've been using GitHub pages &lt;a href="https://matthew-dailey.github.io/"&gt;for my blog&lt;/a&gt; since 2015, but I never really had much love for the platform.  Whenever the mood did strike for me to write a new post, I'd spend so much time setting up the dev environment again that I'd end up losing interest in writing before writing the first word.&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--C73SHZt7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1117945517361762304/IOX7tsTe_normal.png" alt="Matt Dailey profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Matt Dailey
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @matthew_dailey1
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Every time I want to update my blog:&lt;br&gt;- There's a vulnerability with some ruby something, you should update it&lt;br&gt;- OK cool, update that library&lt;br&gt;- Whoops that's not the right bundler command.  Here, try this one instead&lt;br&gt;- OK cool, for real this time&lt;br&gt;- Womp, can't compile C extensions
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      02:48 AM - 04 Sep 2019
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1169079706404057088" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1169079706404057088" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1169079706404057088" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;The last straw was realizing I couldn't use the Liquid template for tweets because GH pages does not have the plugin for tweets in its allow-list of plugins.  Enough was enough!&lt;/p&gt;

&lt;p&gt;So, since the major draw of GH pages was having the power to customize layout and theme, and I really don't need that, I wanted to try out dev.to for blogging instead.  Let's see how it goes!&lt;/p&gt;

</description>
      <category>blogging</category>
    </item>
  </channel>
</rss>
