Thursday, June 25, 2020

k8s: Deploying traefik with helm3

HELM 3
--------
$ helm repo add traefik https://containous.github.io/traefik-helm-chart
$ helm install --namespace kube-system traefik traefik/traefik -f Helm/traefik-helm-values.yaml


HELM 2 (in the past)
-------------------------------
$ helm install stable/traefik --name traefik --namespace kube-system -f Helm/traefik-helm-values.yaml 

k8s: Deploying storageClass with helm3

HELM3
---------
$ helm repo add stable https://kubernetes-charts.storage.googleapis.com
$ helm install --set storageClass.defaultClass=true --set nfs.server=172.16.1.45 --set nfs.path=/Public/k8s-nfs-data --set storageClass.name=nfs-medogz nfs-client-provisioner-nfs-medogz stable/nfs-client-provisioner

HELM2 (in the past) 
------------------------------
$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com
$ helm install stable/nfs-client-provisioner --name nfs-client-provisioner-nfs-medogz --set nfs.server=172.16.1.45 --set nfs.path=/Public/k8s-nfs-data --set storageClass.name=nfs-medogz --set storageClass.defaultClass=true

Tuesday, June 23, 2020

trying openshift installer nightly

Nightly builds: https://openshift-release.svc.ci.openshift.org/

Example:
https://openshift-release-artifacts.svc.ci.openshift.org/4.6.0-0.nightly-2020-06-23-180540/
The installer is: openshift-install-linux-4.6.0-0.nightly-2020-06-23-180540.tar.gz

$ tar zxvf openshift-install-linux-4.6.0-0.nightly-2020-06-23-180540.tar.gz
$ ./openshift-install create  cluster --dir=ocp --log-level=info

Example using oc command:
$ export KUBECONFIG=ocp/auth/kubeconfig
$ ocp get pods 

podman commit - saving a container state

1. Look for the container ID
$ podman ps 
CONTAINER ID   IMAGE                                                                    COMMAND   
6987b050a32e         registry.fedoraproject.org/fedora:32                        /bin/bash
b71273d505f4         localhost/crio-build-debian10-golang-1-14:latest    /bin/bash

2. Commit/Save the current state
$ podman commit b71273d505f4 crio-build-debian10-golang-1-14

3. Now when executing the container just start with exec -it ${container id}
$ podman exec -it b71273d505f4 /bin/bash

Thursday, June 18, 2020

kubectl scale deployment - Scaling App Deployment

$ kubectl scale deployment app --replicas=3

bash: case statement

#!/usr/bin/env bash

usage () {
    echo "usage message..."
}

options=$(getopt -o ug --long createuser:,creategroup: -- "$@")
[ $? -eq 0 ] || {
    usage
    exit 1
}

eval set -- "$options"
while true; do
    case "$1" in
    -g | --creategroup)
        shift
        OPTION="$1"
        ;;
    -u | --createuser)
        shift
        OPTION="$1"
        ;;
    --)
        shift
        break
        ;;
    esac
    shift
done

if [ -n "$OPTION" ]; then
    echo "Option is $OPTION"
else
    usage
    exit 1
fi

exit 0

Wednesday, June 17, 2020

openshift-install: a few options

Create the openshift install-config.yaml file:
$ ./openshift-install create install-config


Create the cluster:

git: rebase a branch with upstream master

Rebase with upstream master:

$ git branch
* min_version_required

$ git remote add upstream https://github.com/openshift/installer
$ git fetch upstream
$ git rebase upstream/master

Update the changes in the github tree:
$ git push -f

Sunday, June 7, 2020

NASA Explains Moon Return Plans in Stunning Animated Short

https://m.youtube.com/watch?feature=youtu.be&v=qMMguZLZxhk

kubectl output verbosity and debugging

--v=0 Generally useful for this to always be visible to a cluster operator.
--v=1 A reasonable default log level if you don’t want verbosity.
--v=2 Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems.
--v=3 Extended information about changes.
--v=4 Debug level verbosity.
--v=6 Display requested resources.
--v=7 Display HTTP request headers.
--v=8 Display HTTP request contents.
--v=9 Display HTTP request contents without truncation of contents.

reference:
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md