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
(
set -x; cd "$(mktemp -d)" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
tar zxvf krew.tar.gz &&
KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/')" &&
"$KREW" install krew
)
az extension add -n front-door
az group create -n fd
az network front-door create -g fd --name doorfront --backend-address 8.8.8.8
@ams0
ams0 / sha256url.sh
Created November 11, 2020 16:10
Extract SHA257 from URL
#!/bin/bash
#Usage: sha256url.sh <URL>
url=$1
curl -fLs $url | tee `basename $url` | sha256sum && rm `basename $url`
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper/release-3.1/deploy/gatekeeper.yaml
kubectl apply -f https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-references/Kubernetes/load-balancer-no-public-ips/template.yaml
kubectl apply -f - <<EOF
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sAzureLoadBalancerNoPublicIPs
metadata:
name: load-balancer-no-public-ips
spec:
match:
excludedNamespaces: ["kube-system","ingress","istio-system"]
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: helm-manifests
spec:
destination:
name: workcluster
namespace: helm-manifests
server: ''
source:
spec:
template:
spec:
containers:
- command:
- argocd-server
- --staticassets
- /shared/app
- --insecure
name: argocd-server
#!/bin/bash
#save as install-k3d.sh
#az vm create -g k3s --image UbuntuLTS --admin-username ubuntu --ssh-key-values ~/.ssh/id_rsa.pub -n k3s --custom-data install-k3d.sh
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1002 --access Allow --protocol Tcp --destination-port-ranges 443 -n https
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1001 --access Allow --protocol Tcp --destination-port-ranges 80 -n http
curl https://get.docker.com/ | sh
sudo usermod -aG docker ubuntu
modules:
http_2xx:
prober: http
http:
preferred_ip_protocol: "ip4"
http_post_2xx:
prober: http
http:
method: POST
Provisioned capacity 1024GiB
Allowed IO/s: 1024
Burst IO/s: 3072
Egress Rate: 121.4 MiBytes / s
Ingress Rate: 81.0 MiBytes / s
==================
= Dbench Summary =
==================
Random Read/Write IOPS: 3247/1892. BW: 183MiB/s / 119MiB/s
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: dbench
spec:
storageClassName: nfs-client
accessModes:
- ReadWriteOnce
resources:
requests: