KUBERNETES

Kubernetes on Redhat Enterprise Linux 8

Kubernetes on Redhat Enterprise Linux 8

Installation of Kubernetes Server

Nathan Obert
Introduction We will install a Kubernetes on RHEL 8 with CRI-O, and Podman. We are using an r5.large on Amazon EC2 using Amazon’s provided Red Hat Enterprise Linux 8. Installation Install the updates on your fresh server from Amazon. sudo dnf update -y sudo dnf install net-tools -y Setup DNS or atleast Hostname entries in your /etc/hosts file sudo hostnamectl set-hostname k8.obert.dev sudo init 6 echo `/sbin/ifconfig eth0 | grep 'inet ' | awk {'print $2'}` ${HOSTNAME} | sudo tee -a /etc/hosts Set selinux to permissive
Kubernetes how create folders for Physical Volumes (PVs) automatically

Kubernetes how create folders for Physical Volumes (PVs) automatically

Adding commands before an entrypoint.

Nathan Obert
Introduction This will be a quick short blog entry. Today I needed to have a container that could self-initialize it’s own Physical Volumes. This is quite easy to do with an init container. I’m going to provide a simple example to show how this works with busybox. Deployment YAML initContainers: - name: init-pv image: {{ .Values.initpv.image }} volumeMounts: - name: init mountPath: {{ .Values.persistentVolume.path }} {{- with .Values.initpv.command }} command: {{- toYaml .
Kubernetes how inject commands before entrypoint

Kubernetes how inject commands before entrypoint

Adding commands before an entrypoint.

Nathan Obert
Introduction This will be a quick short blog entry. Today I had an image running on Kubernetes from a vender invoked through HELM, and I needed to run some arbtirary commands however I did not want to extend the image and have to deal with maintaining yet another image. Below is the solution I came up with. YAML to inject commands before entry point. image: repository: docker.io/user/image pullPolicy: IfNotPresent tag: "latest" command: - bash - "-c" - | sed -i 's/^param=.
Kubernetes how to patch external address into service

Kubernetes how to patch external address into service

How to make an service bind to host

Nathan Obert
Introduction This will be a quick short blog entry. Today I had an container running Oracle at Amazon EC2 on Kubernetes. I was trying to work thorugh some Pl/SQL code in sqlplus, and decided I wanted to instead use SQL Developer. After a little research this is what I came up with, and wanted to share it. Bash Script kubectl patch svc oracle -p '{"spec":{"externalIPs":["1.2.3.4"]}}' Basically you pass the kubernetes service name, as well as your ip address of the host (in this example 1.
Kubernetes on Ubuntu 22.04 with CRI-Docker

Kubernetes on Ubuntu 22.04 with CRI-Docker

Installation of Kubernetes Server

Nathan Obert
Introduction We will install a Kubernetes on Ubuntu 22.04 with Docker and CRI-Docker. We are using an r5.2xlarge on Amazon EC2 using Amazon’s provided Ubuntu 22.04. You can get by with a much smaller instance depending on what you plan to run. Installation Update Ubuntu Install the updates on your fresh server from Amazon. ## Update Ubunutu sudo bash sudo apt update -y sudo apt upgrade -y sudo apt autoremove -y # if you see kenerl updates you should reboot # init 6 Hostname Your hostname should be in /etc/hosts.
GitHub Actions to automatically build Docker and push to registry

GitHub Actions to automatically build Docker and push to registry

Configuration to have GitHub automatically build and push Docker containers

Introduction GitHub provies “Actions” which are automatic actions that are ran on gitHub for you. This can be used to compile your code, compile your docker image, or do any arbitrary set of commands. This typically is done in software development to automatically push software between development and test. This is typically done to insure all the necessary code, configurations, etc necessary are checked into the source repository. Additionally this insures all the neccessary steps are done uniformly no matter which developer checks in the code.
Kubernetes init container to verify dependent service(s) are online.

Kubernetes init container to verify dependent service(s) are online.

Init container to check if kubernetes service available

Nathan Obert
Introduction With HELM Scripts containers all try to start at the same time. It depends on how the containers scripts were designed on if there is any sort of delay or dependency cchecking built into them. I wrote a very simple busybox script that can be used to prevent a container from starting until the kubernetes services is needs are available. In this example there are 3 checks going on.
HELM Cheatsheet

HELM Cheatsheet

Cheatsheet for HELM

Nathan Obert
Introduction “Helm is the best way to find, share, and use software built for Kubernetes.” Kubernetes is a great container orchistration tool, however managing all the yaml files associated with it become a huge undertaking. Helm is a tool that allows you to create templates for Kubernetes yaml files. Then you only have to manage a set a value pairs that are passed to your templates. This allows you to easily share packages of templates, and other people can easily bring your containers online only having to modify the values to match their needs to customize or configure.
Rancher Desktop for Kubernetes and Docker on Windows 11

Rancher Desktop for Kubernetes and Docker on Windows 11

Installation of Rancher Desktop for Kubernetes and Docker on Windows 11

Introduction Rancher Desktop is a Kubernetes and Docker platform that is a replacement for Docker Desktop. I’ll be installing and configuring it using the installation guide provided in Rancher’s Documentation Rancher is a replacement for Docker Desktop. Rancher provies you helm, kubernetes, docker, the CRI runtimes of dockerd or containerd kubernetes. It integrates in nicely with WSL if you wish to use Linux instead of Windows. Additionally it lets you choose which version of Kubernetes you want to run.
Kubernetes Cheatsheet

Kubernetes Cheatsheet

Cheatsheet for Kubernetes

Nathan Obert
Introduction This is a quick cheat sheet from Kubernetes Website’s Cheatsheet. This page contains a list of commonly used kubectl commands and flags. Kubectl autocomplete BASH source <(kubectl completion bash) # set up autocomplete in bash into the current shell, bash-completion package should be installed first. echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell. You can also use a shorthand alias for kubectl that also works with completion:
Kubernetes on Redhat Enterprise Linux 9

Kubernetes on Redhat Enterprise Linux 9

Installation of Kubernetes Server

Nathan Obert
Introduction We will install a Kubernetes on RHEL 9 with CRI-O, and Podman. We are using an r5.large on Amazon EC2 using Amazon’s provided Red Hat Enterprise Linux. Installation Install the updates on your fresh server from Amazon. sudo dnf update -y Setup DNS or atleast Hostname entries in your /etc/hosts file echo `/sbin/ifconfig eth0 | grep 'inet ' | awk {'print $2'}` ${HOSTNAME} | sudo tee -a /etc/hosts Set selinux to permissive