- Ops Jargon
- Important distinction: Containers are NOT Docker. Docker includes multiple products (i.e. Docker Desktop) and Open Source containerization technologies (i.e. container engine), see Docker's github repo
- Docker Desktop is recommended because it includes the Docker daemon (dockerd), the Docker client (docker), Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper.
- Install Docker engine (aka Docker CE) for various Linux Distros here vs. install Docker Desktop for linux here. The Docker Engine is licensed under the Apache License, Version 2.0.
- How Kubernetes works under the [hood with Docker Desktop](https://www.docker.com/blog/how-kubernetes-works
- Pipeline
An automated process that defines a series of stages or steps to build, test and deploy SW solutions.
- Continuous Integration (CI)
The the process of merging code changes, testing them, and building resulting artifacts, as early in the application lifecycle as possible. The intention is to detect any potential issues in the development phase, since this minimizes the effort and cost involved in fixing them. Automated tests validate that code changes haven't introduced errors or regression issues.
The upgrade process (docs) follows the general procedure of:
- Upgrading the Kubernetes control plane with kubeadm (Kubernetes components and add-ons excluding the CNI)
- If applicable upgrading the CNI network plugin
- Upgrading the Kubernetes packages (kubelet, kubeadm, kubectl) on the control plane and worker nodes
- Upgrading the kubelet config on worker nodes with kubeadm
# check cluster nodes and version
kubectl get no -owide
-
Search official images for desired
:
docker search --format "table {{.Name}}\t{{.StarCount}}\t{{.IsOfficial}}" <IMAGE>
-
Output image name and tag:
docker images --format '{{.Repository}} and {{.Tag}}'
-
Output image name, tag and elapsed time + timestamp since the image has been created:
docker images --format "{{.Repository}}:{{.Tag}} {{.CreatedSince}} --> {{.CreatedAt}}"
-
Inspect
Cmd
for desired:
docker inspect -f '{{.Config.Cmd}}' <IMAGE>
-
Inspect
Entrypoint
for desired:
docker inspect -f '{{.Config.Entrypoint}} <IMAGE>'
-
Inspect attached containers to bridge network:
docker inspect network bridge --format "{{json .Containers }}"
-
Inspect storage:
docker info -f 'Storage drive: {{.Driver}} and storage path {{.DockerRootDir}}'
-
Inspect container runtimes:
docker system info --format "{{.Runtimes}} {{.DefaultRuntime}}"
#!/usr/bin/env bash | |
########################################### | |
# ## | |
# @dejanualex: Trivy based image scanner ## | |
# ## | |
########################################### | |
version: '3.1' | |
services: | |
db: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: example |
#!/bin/bash | |
## ##################################################################### | |
## run concurrently command passed as argv on multiple remote servers ## | |
## UPDATE: servers array and user variable ## | |
######################################################################## | |
# define an array of remote servers | |
servers=("server1.fqdn" "server2.fqdn" "server3.fqdn") | |
# Function to execute command on a remote server | |
execute_command() { | |
server=$1 |
#!/usr/bin/env bash | |
############################################################# | |
# Purpose: wrapper for inspecting Requests/Limits for Pods ## | |
# @dejanualex ## | |
############################################################# | |
# read namespace and po | |
echo -e "Available namespaces are:\n $(kubectl get ns -o=custom-columns=NAMESPACES:.metadata.name) \n" | |
echo -e "\n Please write the name of the namespace for which you want to know the resource status:\n" |
#!/usr/bin/env bash | |
################################################################################################ | |
# kubectl wrapper that generates a report concerning cluster state, ## | |
# which creates a dir with compiled information regarding: ## | |
# - control plane components status, cluster events, nodes description, and namespace events ## | |
################################################################################################ | |
# Get nodes, componentsstatuses, and pods for control-plane | |
echo -e "\e[0;32m Cluster Nodes: \e[0m \n $(kubectl get nodes -owide)" |