Skip to content

Instantly share code, notes, and snippets.

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

Alessandro Vozza ams0

🏠
Working from home
View GitHub Profile
# Open source AI/ML workloads on Cloud Native Infrastructure: match made in heaven - Devtalks.ro - 2024
# https://docs.google.com/presentation/d/16P7rNydNXLn6AA3rDL8ZB7yevkZ3lWLwTPizlV5OB3A/edit?usp=sharing
#
export RG=aksclusters
export AZURE_LOCATION=westeurope
export CLUSTER_NAME=kaito
export K8S_VERSION=1.29.4
export ACR_NAME=aicommdaynl
az acr create --resource-group $RG --name $ACR_NAME --sku Basic
@ams0
ams0 / kind_cilium.sh
Last active May 22, 2024 16:13
Create Script to deploy a multinode kind cluster with Cilium, MetalLB and local folder sharing
#!/bin/bash
# Usage: ./kind_cilium.sh -k <k8s_version> -n <cluster_name> -s <start_ip> -e <end_ip> -i <image> -p <preload> -m <mount_hostpath>
# Example: ./kind_cilium.sh -k v1.21.1 -n kind -s 200 -e 250 -p true -m true
set -e
# Default values
DEFAULTK8SVERSION="v1.30.0"
DEFAULTNAME="kind"
variable "env_id" {}
variable "region" {}
variable "simple_env_id" {}
variable "subscription_id" {}
variable "tenant_id" {}
#Istio check
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 1
#Cilium cluster mesh with kind
cat <<EOF | kind create cluster --image kindest/node:v1.28.0 --config -
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: cluster-01
nodes:
- role: control-plane
- role: worker
networking:
#!/bin/bash
# LFS458 VM prep script
#update and upgrade
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get upgrade -y
#add basic tools
apt-get install -y vim curl apt-transport-https vim git wget software-properties-common lsb-release ca-certificates -y
@ams0
ams0 / bosh-azshell.sh
Last active October 30, 2023 11:14
Install bosh with Azure Shell
# Install bosh from Azure Shell
# in azure shell run pip install certbot
# change quota of Azure shell file share
az ad sp create-for-rbac -n bosh -o json > sp.json
az role assignment create --assignee $(jq -r .appId sp.json) --role "Contributor" --scope /subscriptions/$(az account list --query "[?isDefault].id" -o tsv)
SP_FILE="$HOME/pre/sp.json"
export NAME=${PWD##*/}
@ams0
ams0 / install-ambient-helm.sh
Last active October 18, 2023 22:03
Install Istio Ambient Mesh with Helm
# Install Ambient Mesh with Helm Charts
REPO="https://istio-release.storage.googleapis.com/charts"
VERSION=1.19.0
helm_opts="upgrade -i --namespace istio-system --create-namespace --repo ${REPO} --version ${VERSION}"
# base
helm $(echo $helm_opts) istio-base base
# istiod
@ams0
ams0 / multipass-cloudinit.sh
Last active March 27, 2023 05:53
multipass cloud init script to install kubectl helm and more
#!/bin/bash
ARCH=$(dpkg --print-architecture)
wget -q "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl"
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
rm kubectl
# Enable bash completion for kubectl
echo "source /usr/share/bash-completion/bash_completion" >> /root/.bashrc
@ams0
ams0 / osm-nginx-keycloak-mtls-acme.md
Last active June 26, 2022 09:19
Setup Keycloak with OSM, mTLS between pods and SSL Let'sEncrypt certificate termination at ingress

Let me go thru the setup :

  1. Install a 1.24.0 cluster
  2. Install OSM and add the namespaces:
osm install --set OpenServiceMesh.enablePermissiveTrafficPolicy=false
kubectl patch meshconfig osm-mesh-config -n osm-system -p '{"spec":{"traffic":{"enableEgress":true}}}'  --type=merge

kubectl create ns keycloak