Skip to content

Instantly share code, notes, and snippets.

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

Yuri Burger yuriburger

🏠
Working from home
View GitHub Profile
@yuriburger
yuriburger / nginx-ingress
Last active June 21, 2019 10:56
[nginx ingress] Create a nginx-ingress controller on kubernetes #helm #kubernetes
// vim: syntax=bash
# Based on Nginx stable repo
#
helm repo add nginx-stable https://helm.nginx.com/stable
helm repo update
helm install nginx-stable/nginx-ingress --name <name> --namespace <namespace> --set controller.service.loadBalancerIP="<ip address>" --set controller.replicaCount=1
# Based on Helm default stable repo
#
helm install stable/nginx-ingress --name <name> --namespace <namespace> --set controller.service.loadBalancerIP="<ip address>" --set controller.replicaCount=1
@yuriburger
yuriburger / trigger-patch-update
Last active May 9, 2019 08:00
[trigger update] Trigger a deployment by patching a label #kubernetes
// vim: syntax=bash
k patch deployment <servicename> -p "{\"spec\": {\"template\": {\"metadata\": { \"labels\": { \"redeploy\": \"$(date +%s)\"}}}}}"
@yuriburger
yuriburger / curl-resolve-dns
Last active May 9, 2019 08:00
[curl resolve dns] Curl with a custom DNS resolve #curl
// vim: syntax=bash
curl -v -k --resolve <dns name>:<port>:<ip address> http://<dns name>/whatever
@yuriburger
yuriburger / az-aks-get-credentials
Last active May 9, 2019 08:00
[az aks get-credentials] Get access credentials for a managed Kubernetes cluster #kubernetes #azure
// vim: syntax=bash
az aks get-credentials --name <clustername> --resource-group <rg name>
@yuriburger
yuriburger / helm-init
Last active January 29, 2020 03:24
[tiller account and binding] Service Account for Helm in an RBAC-enabled AKS cluster #helm #azure #kubernetes
// vim: syntax=bash
helm init --service-account tiller
helm repo update
@yuriburger
yuriburger / kill-all-applications
Last active May 10, 2019 07:31
[kill all apps] Kill all "specific" kubernetes pods #kubernetes
// vim: syntax=bash
// All pods with "application" in the name
for app in `kgp|grep application|awk '{print $1;}'`; do kdelp $app; done
@yuriburger
yuriburger / grant-aks-access-acr
Created May 10, 2019 09:38
[grant aks access to acr] Grant Azure Kubernetes Service pull access to Azure Container Registry #kubernetes #azure
// vim: syntax=bash
# Get the id of the service principal configured for AKS
CLIENT_ID=$(az aks show -g <resource group> -n <aks cluster> --query "servicePrincipalProfile.clientId" --output tsv)
# Get the ACR registry resource id
ACR_ID=$(az acr show -g <resource group> -n <name acr> --query "id" --output tsv)
# Create role assignment
az role assignment create --assignee $CLIENT_ID --role acrpull --scope $ACR_ID
@yuriburger
yuriburger / create-azure-container-instance
Last active May 14, 2019 09:19
[create azure container instance] Deploy Azure Container Instance to Azure #azure
// vim: syntax=bash
az container create --resource-group <resource-group> --file create-azure-container-instance.yaml
@yuriburger
yuriburger / git-commit-push-new-branch
Last active June 24, 2019 07:22
[git commit & push to new branch] How to commit changes to new branch #git
// vim: syntax=bash
git checkout -b your-new-branch
git add .
git commit -m "Your commit message"
git push origin your-new-branch
@yuriburger
yuriburger / mongo-import
Last active June 13, 2019 05:37
[mongo import] Mongo Import JSON from commandline #mongo
// vim: syntax=bash
mongoimport --db <dbname> --jsonArray --username <username> --password <passwd> --authenticationDatabase admin --drop --file <filename>.json --collection <collectionname>