Categories
Programming

More Kubernetes: WSL2, Hyper-V, Docker, and X11

Most programming I do at my day job is done via PuTTY and IntelliJ. The latter runs on Linux and I run MobaXterm as an X11 server. I don't use Moba's terminal because the chrome around it's way to gizmo-ey, like I'm at an ugly sweater party or something.

PuTTY is ideal because it's so minimal and it has all the features I need. I actually use PuTTY Tray, which is a fork that has a few more options than the standard PuTTY. IntelliJ works great over X11 and MobaXterm is pretty snappy on our local network, even from our datacenter to our office.

That said, at home I don't have access to a fancy $70k server running dual Intel Platinum Xeon processors with 512GB of RAM and 1.6TB of Enterprise-grade Northbridge-connected NVMe drives. I have a 12/24 core AMD Ryzen 3900X and Windows 10 Pro for Workstations. But Windows is so developer-friendly these days, it gives me a ton of options for development.

You can do Linux a few ways, two of which are in a VM via Hyper-V or using Windows Subsystem for Linux (WSL). In the very latest fast-ring builds of Windows, you can enable WSL2, which is an overhaul of the subsystem that's a lot faster and more compatible with Linux binaries.

WSL2

To get WSL2, I joined the Windows Insider program and set updates to the "Fast Ring". Right now I'm running Windows 10 Pro for Workstations Build 19025.vb_release.191112-1414, or whatever. Then I followed the steps here to enable WSL2. Yippee!

Docker

Docker isn't by default available in WSL2, and I'd prefer it was since I like to stay in a bash prompt over PowerShell or cmd.exe. Lucking the latest Docker for Windows Edge version has an option to expose Docker to WSL2. It's in Settings > Resources > WSL Integration. To check things are working, run wsl -l -v

PS C:\Users\nic> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

X11

I wanted to see if I could get IntelliJ to run under WSL/X11 and my initial attempts were met with utter failure. IntelliJ wouldn't start up no matter what I set my DISPLAY variable to. localhost:0 (or 0.0) didn't work, nor 127.0.0.1:0, nor the eth0 IP reported by ifconfig, nor the Windows desktop IP. Finally, I went into /etc.resolve.conf and saw this:

nameserver 172.22.80.1

Setting my DISPLAY to 172.22.80.1:0 worked.

One interesting observation is that the WSL2 network and my Desktop bridged network to my home router are isolated enough that IntelliJ's license check can't detect that I had two copies open. One copy running natively on Windows and the second running in the WSL context over X11. On a flat network, the second copy would refuse to run, or the first copy would die on launch of the second. I forget!

Kubernetes

So I went through all of this so I could interact with my Kubernetes cluster at the WSL prompt. I setup Rancher as a container running in Docker for Windows. Once Rancher was running, I created three VM's running Ubuntu using Hyper-V and called them node1, node2, and node3. Rancher made it easy to have each VM register itself as a node in a cluster called "Lab". At this point I'm using 27GB of my 32GB of RAM, which is surprising so I'll probably scale down Docker and the VM's RAM. maybe giving each VM 4GB was a little excessive.

I still have two free DIMM slots so I guess it will be time to get to 64GB soon.

The cluster is extremely unstable and I'm in the process of figuring out why. When I reboot the desktop, the VM's (cluster nodes) shut down (along with Rancher's container) and after the reboot rancher comes up, tons of containers in each node come up, but the status is redder than Carrie at her Prom.

For some reason, the containers running on each VM node do not auto-start until I invoke docker somehow, like sudo docker ps. I'm still researching why this is.

Categories
Hardware

New PC Build: Server

I'm putting together a new PC. For myself this time. The last, I don't know, ten PC's I've built have been for my kids or my kids' friends. I got fed up and decided to build one of my own.

I was set on AMD this time around, and Windows (more on that later). AMD Threadrippers have great benchmarks and the price point makes it a no-brainer to go the AMD route.

I ordered a motherboard that supports a whopping 4400Mhz of DDR4 memory. But I wanted 64GB and I couldn't find 16GB DIMMS (the motherboard only has 4 slots) so I went with 3600Mhz memory. It looks like the Threadripper 3900x I'm getting only supports 3200Mhz without overclocking so I suppose this was a good compromise on memory. Here's the parts list:

  • CPU - AMD Ryzen 9 3900X 12-core, 24-Thread
  • Motherboard - ASUS AM4 TUF Gaming X570-Plus
  • Memory - G.SKILL Trident Z Neo Series 32GB (2 x 16GB) 288-Pin RGB DDR4 SDRAM DDR4 3600
  • Storage - SAMSUNG 970 PRO M.2 512GB
  • Power Supply - CORSAIR RMx Series RM850x
  • Case - Corsair Graphite Series 760T Black Full Tower Windowed Case

You may notice a a graphics card is missing. This was intentional for the initial build to reduce costs. Also, a graphics card is unnecessary because I'm building a server so I can play around with containers, VM's, and Kubernetes. I'll access it after the install via Remote Desktop from my Macbook Pro.

Choice of OS

I've always thought about doing my day-to-day work a Linux Desktop and this would be the perfect time, right? Unfortunately, no. In the back of my mind this rig will get a GPU upgrade one day and when that happens I'll start doing gaming or VR on it. As such, Windows 10 will give me the most flexibility. And now I see Microsoft has Windows 10 Pro for Workstations, which is a new flavor of desktop OS with some features borrowed from recent Windows Server builds:

  • More sockets support (up 4 CPU's)
  • RDMA support
  • Support for 6TB of RAM (from Windows 10 Pro's 2TB)
  • Support for NVDIMM-N (storage-class RAM, which can recover on power failure)
  • ReFS support
  • SMB-direct support for faster file transfers

Upgrades

  • The motherboard I got supports two M.2 slots so at some point I'll add a 1TB Samsung EVO Pro for extra storage.
  • Another 32GB of RAM to get me to 64GB
  • Obviously a graphics card, one with a lot of GPU's, like 2080 Ti maybe? Probably not as it's pretty expensive.

K8s Configuration?

My plan right now it to use Hyper-V natively, instead of something like VirtualBox, to host Linux VM's. Why? I don't know. I just want to try something new. I read a good article on Hypervisor performance between Hyper-V, KVM, Zen, and vSphere:

https://www.researchgate.net/publication/242105480_A_Component_Based_Performance_Comparison_of_Four_Hypervisors

It seems like performance varies greatly from workload and most of these hypervisors are in the same ball-park in terms of performance.

I plan to create 2-3 VM's and have those be my Kubernetes nodes. On these nodes, I'll deploy all of the containers I'm interested in configuring and using:

  • Kubernetes core pods
  • Docker image repository
  • Rancher
  • Prometheus
  • Grafana
  • Kafka
  • Gitlab and maybe Azure DevOps

Categories
Productivity

Where am I?

Two years is a long time between posts. Yet I used to remember a time when I posted more often. I used to think of myself as a blogger. I mean, what happened?

First, the numbers:

  • 4 posts in 2016
  • 3 posts in 2015
  • 4 posts in 2014
  • 0 posts in 2013 (holy moley)
  • 8 posts in 2012

2012 is when I started this blog, nickcoding.com. But I blogged before, way before. In my other blog, the one I maintained for many, many years, the one I started in the  early days of blogging, I had a lot more posts.

  • 4 posts in 2014
  • 4 posts in 2013
  • 15 posts in 2012
  • 58 posts in 2011
  • 113 posts in 2010
  • and it goes back all the way to 2004...

Wait, what? I went from 113 posts per year to basically 0. So why?

I guess my life changed a lot. Things seemed easy for a long time. I was young and optimistic. I thought people would want to hear what I had to say. I thought the world was my oyster, that I had unlimited possibilities ahead of me. Then reality set in. Things started to get hard. My view of the world and the opportunity in that world began to shrink. I had mounting responsibilities. I had setbacks. I started to realize life wasn't such a cakewalk. I started to realize I wasn't actually good at what I did, or at least there were a lot of people who were a lot better. I went on the defensive and I stayed there. Why would anyone give a shit about what I had to say? So I stopped blogging. Not that blogging is a reliable measure of a person's worth, but it was something I did and then something I stopped doing and there was a reason for it.

So where do I go from here? Why am I even writing this? The answer is simple. I'm writing for me, not for you (sorry). I always did. It's OK, blogging was always my means of taking notes, in a public way. It was a way for me to document for myself what I was working on, what interested me. Like many bloggers in the early days I posted my musings because maybe someone would comment on it. Maybe someone would find my tip on managing a photo library as useful and they would thank me in a comment and then I'd be floating on a cloud all day because I actually reached someone.

You see, I wrote this book (a novel) and it means a lot to me. It means a lot to me for you to read it. For probably two years I've struggled on the editing process but now I realize what I've struggled with. I've struggled with me.

So how do you beat yourself anyway? How do you get yourself under control? I don't know, exactly. But what I do know is that I have a growing anxiety. I have a growing discomfort. I have a growing anger and utter dissatisfaction about what I've done about the gap between what I'm doing and what I want to do.

And still, There is a gap in who I used to be and who I am now. Yet this is a different kind of gap. I used to be naive, hopeful, stupid. I've closed up, dried out, and shriveled into cynicism and self-doubt. But something has been setting me free and in this freedom I'm shedding all of my baggage. I am cleaning house. I'm feeling hopeful again.

My mother said something amazing to me yesterday. She told me she had a new idea that inspired her. She said if you believe you're never too old, that it is never too late to begin again, then you are free.

Categories
Life Productivity Writing

Establishing my groove

Last weekend I attended the annual Writer's Digest conference in NYC. The event served as an informal deadline for me, to get my revisions done so I could pitch my story to agents of the science fiction genre during the conference's Pitch Slam event.

So I did that and it was great. I had a number of agents show interest in my story so I began to send out queries. One step closer to rejection letters!

The book is on the long side at 104k words. I'll be spending the next month or two waiting for more beta reader and agent feedback and ruminating on tweaks that I can make. Like every writer, I hope the feedback isn't disastrous--necessitating major work--but that's something I need to anticipate and accept. When it's time to roll up my sleeves and get the work done, then that's what I'll do. That aside, I'll be researching more agents to query. I'll start fleshing out my ideas for follow on books. I'll keep writing.

I need to establish my groove.

Categories
Productivity Tools Writing

On Beta Reading

I've been on both sides of the beta reading spectrum in my journey to write my first novel, The Harvester. Rewarding is the best word I can think of right now when I think of both the experience in beta reading for others as well as the experience in working with people who've read my manuscript. My friends have been wonderful and this past January I joined a writing group and the past six months has been a whirlwind of discovery.

That said, know that whatever I say here are the words of a beginner. I know nothing. I am learning as I go.