Skip to content

Instantly share code, notes, and snippets.

@mohatb
mohatb / ds
Created January 13, 2020 14:36
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginxx
spec:
selector:
matchLabels:
dsapp: nginxd
template:
metadata:
@mohatb
mohatb / kube-user-x509.sh
Last active January 13, 2021 11:20
create users in kubernetes
#!/bin/bash
CLUSTERNAME=mycluster.mydomain
NAMESPACE=default
USERNAME=myclusteruser
GROUPNAME=mygroup
openssl genrsa -out ${USERNAME}.key 2048
CSR_FILE=$USERNAME.csr
@mohatb
mohatb / check_vpn.sh
Created June 23, 2020 10:05
Test openvpn connection
echo -e "\x38\x01\x00\x00\x00\x00\x00\x00\x00" | timeout 10 nc -u <openvpnserver> 1194 | cat -v
@mohatb
mohatb / kubectl.md
Created December 16, 2020 21:04 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@mohatb
mohatb / kubectl.md
Created December 16, 2020 21:04 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
component: alert-on-reboot-la
name: alert-on-reboot-la
namespace: kube-system
spec:
selector:
matchLabels:
FROM alpine:3.11 AS build
ARG CHANNEL=unstable
ARG VERSION=0.99.1-127
ARG ARCH=amd64
RUN mkdir /build
WORKDIR /build
RUN apk add --no-cache curl tar
@mohatb
mohatb / aks.sh
Created February 5, 2022 21:36 — forked from vfarcic/aks.sh
# Source: https://gist.github.com/0e28b2a9f10b2f643502f80391ca6ce8
####################
# Create a Cluster #
####################
# This script assumes that you followed the instructions from the "Creating And Managing Google Kubernetes Engine (GKE) Clusters With Terraform" section" section.
# It assumes that you have:
# * The resource group *devops-catalog-aks*
# * The storage account *devopscatalog*
#!/bin/sh
# Source: http://kubernetes.io/docs/getting-started-guides/kubeadm
set -e
source /etc/lsb-release
if [ "$DISTRIB_RELEASE" != "20.04" ]; then
echo "################################# "
echo "############ WARNING ############ "