Skip to content

Instantly share code, notes, and snippets.

View dejanu's full-sized avatar
💭
🎯 all things are subject to interpretation...even API keys

dejanualex dejanu

💭
🎯 all things are subject to interpretation...even API keys
View GitHub Profile
@dejanu
dejanu / aks_upgrade.sh
Last active May 5, 2022 16:01
Upgrade an Azure Kubernetes Service (AKS) cluster
# get available k8s versions for AKS, e.g. for location westeurope
az aks get-versions --location westeurope | jq ".orchestrators[] | .orchestratorVersion"
# get available versions for your AKS
az aks get-upgrades --resource-group <resourcegroup_name> --name <aks_name> --output table
# check your k8s version for control plane and woker node pool
az aks show -g <resourcegroup_name> -n <resourcegroup_name>| grep -E "orchestratorVersion|kubernetesVersion"
# update max-surge to 3 nodes, you can use percentage also e.g.50% (for a node surges half of the no of nodes from the node pool)
@dejanu
dejanu / porter.yml
Created December 30, 2021 13:16
CNAB bundle for Docker mixin
# Informational Metadata: bundle name, version and description
name: whalesay
version: 0.1.2
description: "An example bundle that uses docker through the magic of whalespeak"
registry: getporter
# Required extensions: Docker access is required to run the bundle
required:
- docker
@dejanu
dejanu / cluster_state.sh
Last active August 30, 2021 15:25
oc wrapper
#!/usr/bin/bash
## Quick check cluster node health status as cluster-admin role
oc logout 2>/dev/null
echo "Select cluster ***********"
echo " 1) First cluster:"
echo " 2) Second cluster:"
read n
# add clusters here:
@dejanu
dejanu / proc.py
Created June 27, 2019 21:47
Call process and read output realtime
import subprocess
import shlex
def run_command(command):
"""command: str"""
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break