Skip to main content

cheat sheet

My kubectl Cheat Sheet
·195 words·1 min
kubernetes cheat sheet kubectl
This is a small kubectl Cheat Sheet with the list of commands and settings I use, almost on a daily basis, when working with kubernetes. Get version and cluster information # Get kubectl version # kubectl --version Get cluster information # kubectl cluster-info Check cluster nodes # kubectl get nodes Get running services # kubectl get services -w --all-namespaces Context # List all available contexts # kubectl config get-contexts Get current context # kubectl config current-context Change the context # kubectl config use-context [context name] Deployment # Deploy # kubectl apply -f [yaml definition file] Get deployment definition # kubectl get deployment [deployment name] -o yaml Update the image of a deployment # kubectl set image deployment/[deployment name] [container name]=[image tag] Set autoscale for a deployment # kubectl autoscale deployment [deployment name] --min=2 --max=5 --cpu-percent=80 Delete a deployment # kubectl delete -f [yaml definition file] Get secret definition # kubectl get secret [secret name] -o yaml Force delete a pod # kubectl delete pod [pod name] --grace-period=0 --force Logs # Read a pod’s log # kubectl logs [pod name] -n [namespace name] Misc # Install kubernetes dashboard # kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml Hope it helps!
.NET Core CLI and MSBUILD Cheat Sheet
·320 words·2 mins
dotnet cheat sheet
This is a small .NET Core CLI and MSBUILD Cheat Sheet with the list of commands and settings I use almost on daily basis when working with .NET Core, the command line and Visual Studio Code. Checks # Check installed CLI version: # dotnet --version Show available templates: # dotnet new Solutions # Create a solution with the name of current the folder: # dotnet new sln Create a solution with a specific name: # dotnet new sln --name [solution name] Add a project to a solution: # dotnet add sln [relative path to csproj file] Packages # Add package reference to the project in the current folder: # dotnet add package [package name] Remove a package reference from the project in the current folder: # dotnet remove package [package name] Add a specific package version reference to the project in the current folder: # dotnet add package [package name]-v [version] Restore packages: # dotnet restore Create a nuget package for the project in current folder: # dotnet pack Project Templates # Install a new project template: # dotnet new --install [dotnet template name] Remove a project template: # dotnet new --uninstall [dotnet template name] Run test defined in current folder project # dotnet test Builds # Build current’s folder solution or project # dotnet build Build current’s folder solution or project with release configuration # dotnet build -c Release Publish artifacts for current’s folder solution or project. # dotnet publish MSBUILD # To add a reference to a local assembly without nuget package, edit your csproj and add a Reference as shown in the following sample: # <code> <ItemGroup> <Reference Include="[Relative path to the Assembly dll file]" /> </ItemGroup> </code> Force a file to be copied to the output folder, edit your csproj and add a Content section as shown in the following sample: # <code> <ItemGroup> <Content Include="[name of the file]"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> </ItemGroup> </code> Hope it helps!