This file contains 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 | |
set -x | |
ID=`az account show --query id -o json` | |
SUBSCRIPTION_ID=`echo $ID | tr -d '"' ` | |
TENANT=`az account show --query tenantId -o json` | |
TENANT_ID=`echo $TENANT | tr -d '"' | base64` | |
read -p "What's your cluster name? " cluster_name | |
read -p "Resource group name? " resource_group |
This file contains 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
bash cluster-autoscaler.sh | |
Output: | |
--- | |
apiVersion: v1 | |
data: | |
ClientID: <base64 encoded> | |
ClientSecret: <base64 encoded> | |
ResourceGroup: <base64 encoded> | |
SubscriptionID: <base64 encoded> |
This file contains 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
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
labels: | |
k8s-addon: cluster-autoscaler.addons.k8s.io | |
k8s-app: cluster-autoscaler | |
name: cluster-autoscaler | |
namespace: kube-system | |
--- |
This file contains 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
az aks create --resource-group <resource-group> --name <cluster-name> --kubernetes-version 1.12.4 \ | |
--node-count 1 --node-vm-size Standard_DS1_v2 \ | |
--vnet-subnet-id "/subscriptions/xxxx-xxxx-xxxxxxxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Network/virtualNetworks/k8s-vnet/subnets/k8s-nodes-subnet" \ | |
--network-plugin azure \ | |
--service-cidr 10.20.0.0/16 --dns-service-ip 10.20.0.10 \ | |
--enable-cluster-autoscaler \ | |
--min-count 1 \ | |
--max-count 3 |
This file contains 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: nginx | |
name: nginx | |
spec: | |
replicas: 21 | |
selector: |
This file contains 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
helm template install/kubernetes/helm/istio --name istio --namespace istio-system --set global.proxy.includeIPRanges="10.0.0/16"> ~/workspace/istio/istio.yaml | |
You can add more options on --set key=value with comma seperated | |
Eg: | |
helm template install/kubernetes/helm/istio --name istio --namespace istio-system --set global.proxy.includeIPRanges="10.0.0.0/16",global.mtls.enabled=false,grafana.enabled=true,kiali.enabled=true,tracing.enabled=true > ~/workspace/istio/istio.yaml | |
This file contains 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 | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 onboarding-dev-deploy onboarding" | |
exit 1 | |
fi |
This file contains 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
kind: DaemonSet | |
apiVersion: extensions/v1beta1 | |
metadata: | |
name: startup-script | |
labels: | |
app: startup-script | |
spec: | |
template: | |
metadata: | |
labels: |
This file contains 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
apiVersion: elasticsearch.k8s.elastic.co/v1 | |
kind: Elasticsearch | |
metadata: | |
name: es-prod | |
spec: | |
version: 7.6.0 | |
nodeSets: | |
- name: es-prod | |
count: 3 | |
config: |
This file contains 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
apiVersion: elasticsearch.k8s.elastic.co/v1 | |
kind: Elasticsearch | |
metadata: | |
name: es-test | |
spec: | |
version: 7.5.1 | |
nodeSets: | |
- name: es-test | |
count: 3 | |
config: |
OlderNewer