Skip to content

Instantly share code, notes, and snippets.

View abdennour's full-sized avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
#!/usr/bin/env bash
VERSION="$1"
VERSION="${VERSION#[vV]}"
VERSION_MAJOR="${VERSION%%\.*}"
VERSION_MINOR="${VERSION#*.}"
VERSION_MINOR="${VERSION_MINOR%.*}"
VERSION_PATCH="${VERSION##*.}"
echo "Version: ${VERSION}"
@abdennour
abdennour / README.md
Last active July 16, 2021 12:23
Rolling Update EKS Worker Nodes

Pre usage

export AWS_PROFILE=xxx
export AWS_REGION=xxx
export KUBECONFIG=xxx
kubectl config use-context xxx 

Usage

@abdennour
abdennour / ingress-kube-apiserver.yaml
Created April 18, 2021 00:50
expose kube-apiserver thru ingress
kind: Ingress
metadata:
name: kubeapi
namespace: default
annotations:
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
rules:
- host: "api.devops.example.com"
@abdennour
abdennour / go-lang-sheet-cheat.md
Last active March 14, 2021 00:25
Golang Sheet Cheat

Value Types vs Reference Types

When using Value types, Use pointers to modify these things in a function

Value Types Reference Types
int slices
float maps
string channels
boot pointers
server:
  config:
    # https://github.com/argoproj/argo-cd/blob/master/docs/user-guide/config-management-plugins.md#plugins

    configManagementPlugins: |
      - name: vault
        init:
          command: ["/bin/sh", "-c"]
@abdennour
abdennour / expand-pvc.md
Last active August 26, 2020 07:38
Expand kubernetes PVC - Fix No space left on device

0. Collect these info

  • What's your PVC which has space issue ?
  • What's the StorageClassName of that PVC ?

1. Make sure StorageClassName has the following prop :

allowVolumeExpansion: true
@abdennour
abdennour / vault-auth-k8s-method.sh
Last active January 16, 2024 19:00
Vault - Enable Kubernetes Auth Method
# $1: vault namespace
# $2: Vault Token Reviewer Service Account
vault_namespace=${1:-"vault"}
token_reviewer_sa=${2:-"vault"}
if [ -z "${VAULT_TOKEN}" ] || [ -z "${VAULT_ADDR}" ]; then
echo "ERROR: VAULT_TOKEN and VAULT_ADDR env vars are required"
exit 404
fi
cat <<EOF | kubectl apply -f -
@abdennour
abdennour / README.md
Created July 26, 2020 17:52
README.md how to write it following Best practices

Overview

This gist is about a collection of lectures about how to write a good README

01. introduction

https://youtu.be/zYyRDFx3e28

02. What's documentation

@abdennour
abdennour / README.md
Created July 26, 2020 17:52
README.md how to write it following Best practices

Overview

This gist is about a collection of lectures about how to write a good README

01. introduction

https://youtu.be/zYyRDFx3e28

02. What's documentation

@abdennour
abdennour / vault-read-write-yaml.sh
Last active July 23, 2020 10:03
vault read write utils
read_vault_data()
{
vault read -field=value $VAULT_SECRET_PATH/config > config.yaml
}
write_vault_data()
{
vault write $VAULT_SECRET_PATH/config value=@config.yaml
}