## Information about Node
# Memory
Use bytes(IEC) and NO bytes(SI) the diff is:
The unit MiB was defined by the International Electrotechnical Commission (IEC)
1 Mebibyte (MB) = 1.04 Megabyte (MiB)
50Mi = 50 mebibytes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################################################################################################ | |
# kubectl wrapper that generates a report concerning cluster state, ## | |
# which creates a dir with compiled information regarding: ## | |
# - control plane components status, cluster events, nodes description, and namespace events ## | |
################################################################################################ | |
# Get nodes, componentsstatuses, and pods for control-plane | |
echo -e "\e[0;32m Cluster Nodes: \e[0m \n $(kubectl get nodes -owide)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
############################################################# | |
# Purpose: wrapper for inspecting Requests/Limits for Pods ## | |
# @dejanualex ## | |
############################################################# | |
# read namespace and po | |
echo -e "Available namespaces are:\n $(kubectl get ns -o=custom-columns=NAMESPACES:.metadata.name) \n" | |
echo -e "\n Please write the name of the namespace for which you want to know the resource status:\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## ##################################################################### | |
## run concurrently command passed as argv on multiple remote servers ## | |
## UPDATE: servers array and user variable ## | |
######################################################################## | |
# define an array of remote servers | |
servers=("server1.fqdn" "server2.fqdn" "server3.fqdn") | |
# Function to execute command on a remote server | |
execute_command() { | |
server=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
db: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
########################################### | |
# ## | |
# @dejanualex: Trivy based image scanner ## | |
# ## | |
########################################### | |
OlderNewer