My Windows Setup for DevOps/SRE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
are you an engineer that uses windows and you're looking for the perfect setup to get all those different tools running that seem to be built for Linux or Mac OS well in this video I'm going to show you my Windows setup that I use as a devops engineer and in my opinion it works just as well as my MacBook setup so I'm going to go over all the different tools and how I get them to work together some of this is pretty obvious like Windows terminal and integrating it with WSL so just make sure to use the chapters to skip to the tools that you're most interested in alright so the first tool is pretty obvious here it's Windows terminal and this is by far my favorite terminal to use on Windows this is something that you can just install Through the Windows store and it has a lot of features it gives you access to tabs custom appearances as well as being able to split up your terminal into multiple panes which is really really good for troubleshooting and working on multiple things at a time so Windows is continuously developing new features for Windows terminal and the newest one that they're going to come out with soon is GitHub copilot integration directly with the terminal and this is something I'm really excited for using AI especially using AI directly inside the terminal is a really powerful tool so I really look forward to that feature it's not currently out when I created this video but if you're watching this video sometime in the future then likely Microsoft has already delivered this feature and I'm hoping it's just really good I'll probably do a separate video on that one now the final thing I want to talk about when it comes to Windows terminal is its ability to save sessions as well as its integration with WSL so the ability to save sessions will save you a lot of time I have all my remote hosts that I connect to through SSH as safe sessions so I can just go down from a drop down list and pick my save session and I'll automatically connect to that server now the other thing I like to do is I have Ubuntu running on my Windows machine all the time through Windows WSL and this gives me access to a Linux environment that I run all my tools from do all my troubleshooting and it feels like I'm working directly on a Linux machine now in order to get this set up you're going to need wsl2 installed and configured so I'll leave a link in the description below on how to set that up but once you have that set up all you need to do is install your favorite flavor of Linux through the Microsoft store so I have Ubuntu 20.04 installed and this is actually where I run all my tools from I don't run my tools directly from Windows I run them from my Ubuntu wsl2 environment and this makes it so I don't run into any issues when I'm reading any guides or following any tutorials most of these guides are made for Mac OS or Linux in mind and I can follow all these directions directly because I have access to all these tools I can even install everything that I want to use on my machine using Homebrew which most people think is strictly a tool for installing packages on just Mac OS and Linux but you can actually use it on Windows if you're doing this method I don't use any of those windows package managers like choco or scoop since I'm doing everything from my Ubuntu terminal I can use Homebrew so I find this is a much cleaner solution for installing all the tools that I need now one thing you're going to notice about my terminal environment is it's not the default setup I actually have quite a few tools that I use to enhance my shell experience so the first tool that I use is zsh and in particular it's oh my zsh so you can think of zsh like an improved bash shell but umizetta Sage actually improves the functionality even more it gives you things like tab completion Auto suggestions as well as a bunch of functionality and add-ons to enhance your shell experience I'm going to go a little bit deeper into my exact configuration and all the add-ons I use but before I get into my DOT files that I'll share with everyone here in the description below but I want to mention that I'm using a Starship prompt as well and Starship prompt is what gives my terminal that certain look that it has so if you like my terminal theme then Starship prompt is another Edition that you're going to have to add into your shell environment all right so this is what my shell looks like by default and this is because I'm using multiple add-ons with oh my zsh as well as using the Starship prompt so I'm going to go through my configuration right now and explain what these things are so you can see at the top left here this is my actual kubernetes contacts as well as my kubernetes namespace so it has kubernetes aware context so it knows your cluster name as well as your namespace and this is really good when you're working with production clusters and development clusters you always want to make sure that you're in the right cluster using the right namespaces for the commands that you're using now if you move to the far right you can see this is my GitHub status so I can tell which branch I'm on if I'm on the master Branch the main branch or some sort of feature branch and it gives me the status of the branch if everything's up to date or if I need to pull down any code the next thing in the middle is my directory so this tells me which directory I'm in and it took a little customization to get it the way that I like so I'll go into My Starship configuration to show that off now if we look at my configuration of zsh I have an alias for it and if we just go through it you can see I have some environment variables set at the top here I need to specify these before I load up zsh and then if we scroll down I have my actual zsh plugins so you can see all the plugins available here and then it just loads it and I also have Cube control completion so these are all the plugins that I use by default I'll go over some of my favorite ones Zed is one that in my opinion everyone needs to use this allows you to jump to your directories that you frequently access you just type Zed and then specify part of the directory name that you want to go to and it'll take you right there the next thing is auto suggestions so half the time I don't even have to type out the full command I just start typing part of it and it will auto suggest the command and usually it's right and I just hit the forward arrow and I get what I want then I have a couple of other add-ons for the tools that I frequently use so aw us get Brew Docker Docker compose terraform all tools that I use daily and then at the bottom here we have santax highlighting the santax highlighting just makes everything sort of stand out and pop so I really like that one so if you go down here this is just my Cube control completion I'm just going to skip past that I have environment variables that I want to store these are things like environment variable Secrets uh things specific to my environment that I don't share so they're in a separate file I also have a few other aliases that I maintain in this Alias file so I'll make that available in my GitHub as well I have a couple of functions that I'm working on one of them is a chat GPT function I'll leave that code up in the GitHub repository as well but basically I have chat GPT integrated directly into my terminal this will take some additional setup for you guys to get working if you want to try it out basically you have to generate an API key and install the chat gbt python pack package so if you want to check it out you can try out my function I find it pretty helpful I'm probably going to be improving on it quite a bit the next thing here is my Starship prompt and it's just loading up my Starship configuration I'll hop into that after but the last thing I want to go through here is my fuzzy finder so I use the fuzzy finder called fzf and this is a command that I cannot live without this makes me so much more of an efficient engineer I never have to remember a command I only have to remember parts of commands and if I've ever run it in the past I'll be able to find it so let me actually demonstrate that one right now so if I want to find a command that I ran in the past all I have to do is hit control R and then it gives me a complete history of my commands but what's better is I can actually just start typing the command so if I were to go Cube control I can see all the cube control commands that I ran in the past May maybe I want the command to be specific to cube control deployments so let's type deployment and you can see all the commands that have Cube control and deployment in it maybe I want the one that I sent to my prod cluster and uh here's a good command that I could run so this gives me the command that I want to run now let's say I want to look at some of my Docker compose commands and I forgot what the santax was to do something with Docker compose so I'll just delete this command go Ctrl R and type Docker compose and there's all the docker compose commands that I've run in the past so if you take anything away from this video I hope it's that using a fuzzy finder is really great starting to use them has really made me a way more efficient engineer okay so the next thing I'm going to show off here is my actual GitHub repository so you can start actually using these configurations and get everything installed just like I have it so I'm going to try to keep this repository up to date so it may change from this video and if anyone runs into any installation problems just let me know in the comments and I will try to address them here I use these same instructions whenever I'm setting up new systems myself so you can see here I have the complete setup information for setting up zsh and Starship so you'll start off with installing zsh and this is going to work the same if you're on a Linux system or if you're on Windows WSL so I just do an apt update and then I install zsh and then switch shells to zsh and then I run the actual installation script for oh my zsh so after that I install my zsh plugins these are the plugins that don't come with setsh by default you actually need to clone down their directories to your Zeta Sage customization folder so you can run these different clone commands this one clones down Auto suggestions and then this one's syntax highlighting once you have your plugins installed that's when I usually install Starship prompt so you can just install it by curling this installation script and that should install it for you now if you want to customize your Starship prompt similar to a customization like mine you can find my configuration in this doc config file and then it has this star ship dot toml file now I didn't come up with this configuration myself I think I grabbed it from Christian or it may have been one of the defaults I can't really remember but I was motivated by one of his videos on actually setting this up but here's the configuration that I currently use and I use this one in most of my videos I have a couple of them disabled for the videos like the AWS stuff but if you go down you can see all the different get statuses and everything like that you should just be able to copy my configuration or you could go to the actual Starship website and they have plenty of different themes that you can use and just use whatever one makes the most sense for you now if I head back to my main directory here and scroll down the other additional thing that you should have installed if you want your setup to look like mine is I use a thing called nerd fonts so this is the best way to get it installed in my opinion uh you just do a GitHub clone depth one of this GitHub repository it'll clone down there fonts you go into it and then you install the Hacked style nerd font after that I have some additional setup for some tools I haven't gone over pekko or EXA in this video maybe I'll do a separate video for those type of tools this is the one for installing the fuzzy finder and this is a really important tool so definitely go ahead and clone this one down and install it I have some additional things if you scroll on down I have neovim I have a couple cheat sheets so just check out the repository if you're interested in that alright so now that you have a good understanding of the base tools that I use for my terminal setup which is the most important part to the setup I'll show you my workflow of how I can work with things like Docker minicube as well as vs code and how all these different things integrate together so let's hop into the demo alright so I want to give a quick little demo of what my workflow looks like here so I'll just start off with opening a fresh terminal and then I'll decide which director I want to go to so I've been working on my home Lab Services a lot so I can just type Zed and then home lab and the Zed command is smart enough to know that I meant home lab services and it brought me exactly to that directory so I didn't have to specify the full path you can see that the full path is home slash Brad slash code all I had to do was type Z home lab and it was smart enough to figure out that this is the directory that I wanted once I'm in my repository I'll do a get pull but it looks like everything's up to date according to my prompt so I can just hop into my code editor now my code editor of choice is vs code so if I want to launch it I'll just type code and then a period and a lot of people don't know this but you can use vs code directly with WSL so it's working on your windows subsystem for Linux so if you open this here you can see at the very bottom left it's actually using WSL and it's connected to my WSL Ubuntu 20.04 environment now the first time that you're doing this you're probably going to have to install some additional add-ons to get this working but once you get it set up this feels like I'm working directly on a Ubuntu box so all the code changes that I make it makes it directly to that Ubuntu file system in that directory that I'm in I also have access to the Shell of Ubuntu so you can see my terminal here looks just the same as it did in my windows terminal I have access to my ubuntu.sh cell so this is where I run all my tools from this is a Docker compose directory so if I wanted to do like my Docker compose up I could do a Docker compose up and that would bring up all my services now another tool that I use a lot that I have integrated with wsl2 is Docker and the way to set that up is pretty easy you just go into the settings of docker and then just to resources WSL integration and then you just make sure that this box is checked and this will use your default WSL distro just make sure that you're using WSL version 2 and not version one WSL version one has a lot more limitations and you're going to run into some issues when you're trying to use that but if you have wsl2 then everything is going to work really smoothly for you now that I have a Docker integrated with wsl2 I can start using tools like minicube to simulate kubernetes clusters so I could go like minicube start and this is going to start up a mini Cube cluster and as you can see right now I'm connected to my k3s Argo CD namespace but as soon as this cluster comes up my kubernetes context is going to change and I'll have access to my mini Cube cluster so I'm connected to my mini Cube cluster in the default namespace so you can see how my prompt changes there and if I wanted to change back to my k3s cluster I could go Cube contacts k3s and that brings me back there so that just sort of shows you how beneficial having a kubernetes context integrated into your prompt how beneficial that is alright thanks so much for watching the video and if you have any questions in regards to my setup or you see a future video and something has changed just ask in the comments below and I'll try to answer them and whenever my DOT files change I'll be making updates to them so they might not be exactly the same as what you saw in the video so just keep that in mind anyways thanks again for watch watching and I'll see you all in the next video
Info
Channel: DevOps Journey
Views: 6,781
Rating: undefined out of 5
Keywords: devops, devops tutorial, devops training, devops how to
Id: XBU_6OSlgyI
Channel Id: undefined
Length: 16min 49sec (1009 seconds)
Published: Mon Jun 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.