Skip to content

Instantly share code, notes, and snippets.

View mikamboo's full-sized avatar
🏠
Working from home

Michaël P.O. mikamboo

🏠
Working from home
View GitHub Profile
@mikamboo
mikamboo / README.md
Last active May 22, 2022 17:29
Kubernetes : Monitoring Stack - Prometheus & Grafana
@mikamboo
mikamboo / Dockerfile
Last active April 19, 2020 19:34
Docker : Crond as service in alpine without root privileges
# Cron docker image with :
# - Supercronic to run crontab file (https://github.com/aptible/supercronic)
# - AWS cli to send content to s3
# - Timezone setup
# - Service user uid 1001
FROM python:3.8-alpine
LABEL africa.encuisine.maintainer="mikamboo" \
africa.encuisine.version="0.1.0" \
@mikamboo
mikamboo / Dockerfile
Last active April 6, 2020 16:42
Docker : Alpine Kubectl + EnvSubs + Helm
FROM alpine:3.10
ENV K8S_RELEASE_BASE_URL=https://storage.googleapis.com/kubernetes-release/release
ENV K8S_STABLE_VERSION=https://storage.googleapis.com/kubernetes-release/release/stable.txt
ENV HELM_VERSION=v3.1.2
RUN apk add --update --no-cache curl gettext libintl
RUN curl -LO ${K8S_RELEASE_BASE_URL}/$(curl -s $K8S_STABLE_VERSION)/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl && \
@mikamboo
mikamboo / README.md
Last active April 26, 2020 21:53
Kubernetes : Gitlab cluster-admin ServiceAccount
@mikamboo
mikamboo / README.md
Last active May 5, 2020 15:34
Kubernetes : Cluster init with nginx-ingress + cert-manager
@mikamboo
mikamboo / README.md
Last active April 2, 2020 23:02
Azure CLI : Quick az cli with Docker
@mikamboo
mikamboo / README.md
Last active March 28, 2020 00:24
Kubernestes copy existing PVC to another

How to Copy existing PVC to another namespace

To achieve this goal we have to :

  1. Create PVC clone (two methods : k8s clone feature or snapshot + restore)
  2. Set reclaim policy for the cloned PV to Retain !
  3. Delete PVC clone (and snapshot if necessary)
  4. Realease the clone PV (set claimRef to null)
  5. Create the new namespace
  6. Create a new PVC that meets realesed PV specification (size, matchLabels ...)
@mikamboo
mikamboo / README.md
Last active March 24, 2020 22:36
Deploy a virtual machine with an Azure quick start model

Azure deploy model

chmod +x azure-sample-resrouce-template.sh
./azure-sample-resrouce-template.sh

Azure deploy extension resource

  1. Download previous model resource
@mikamboo
mikamboo / README.md
Last active August 16, 2020 22:25
Azure : SendGrid + Http trigger

Azure SendGrid HTTP trigger

Send emails with Azure functions + SendGrid biding.

Prerequistes

  • Azure account + subscription

Steps

@mikamboo
mikamboo / README.md
Last active March 9, 2020 09:12
Scripting snippets

Scripting snippets

  • Extract Ubuntu release code using cut to split string and sed to trim text
#!/bin/sh

versioncode=`lsb_release -r | cut -f2 -d':' | sed -e  's/^[[:space:]]*//'`