From b575c6fdb89459f06e219093fd870c2399aaeb76 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Mon, 25 Feb 2019 16:47:32 +0100 Subject: [PATCH 01/22] Update deploy_cap_aks_cluster.sh --- deploy_cap_aks_cluster.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index f3d5b9f..b91cae4 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -51,6 +51,7 @@ esac deploymentid=CAP-AKS-`date +'%Y-%m-%d_%Hh%M'`_$(echo $conffile | cut -d "." -f1) logfile=$deploymentid/deployment.log mkdir $deploymentid +export AKSDEPLOYID=$deploymentid echo -e "Deployment log: $deploymentid \n\nValues from $conffile:\n" > $logfile cat $conffile | sed -e 's/#.*$//' -e '/^$/d' >> $logfile From 8e68c3f3b424f678ca086bcd6d14ee3c0dd0545b Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Thu, 28 Feb 2019 17:35:38 +0100 Subject: [PATCH 02/22] Add CAP Deploy on AKS cluster in a by step approach --- .scf-config-values.template | 23 +++++- aks-cluster-config.conf | 39 +++++++++ deploy_cap_aks_cluster.sh | 11 +-- deploy_cap_on_aks_by_step.sh | 148 +++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+), 7 deletions(-) create mode 100644 aks-cluster-config.conf create mode 100755 deploy_cap_on_aks_by_step.sh diff --git a/.scf-config-values.template b/.scf-config-values.template index c88eb68..7b4e0de 100644 --- a/.scf-config-values.template +++ b/.scf-config-values.template @@ -2,10 +2,10 @@ secrets: # Password for user 'admin' in the cluster - CLUSTER_ADMIN_PASSWORD: password + CLUSTER_ADMIN_PASSWORD: # Password for SCF to authenticate with UAA - UAA_ADMIN_CLIENT_SECRET: password + UAA_ADMIN_CLIENT_SECRET: env: # Use the public IP address @@ -38,3 +38,22 @@ kube: services: loadbalanced: true +kubernetes: + authEndpoint: https://:443 +prometheus: + kubeStateMetrics: + enabled: true +nginx: + username: admin + password: +firehoseExporter: + dopplerUrl: wss://doppler.:4443) + uaa: + endpoint: uaa.:2793 + skipSslVerification: "true" + cfIdentityZone: cf + admin: + client: admin + clientSecret: + + diff --git a/aks-cluster-config.conf b/aks-cluster-config.conf new file mode 100644 index 0000000..dfa94b4 --- /dev/null +++ b/aks-cluster-config.conf @@ -0,0 +1,39 @@ +# Configure your cluster deployment +VERSION=7 +# Select LoadBalancer - "azure" for having public/private IPs with AzureLB | "kube" for using e.g. .susecap.net DNS with KubeLB +AZ_LOAD_BALANCER=azure + +# If you plan to have a susecap.net domain entry (loadbalanced=true), set your subdomain e.g. example.susecap.net +AZ_SUB_DOMAIN=jml-script$VERSION + +# Set the Azure resource group name (e.g. -cap-aks) +AZ_RG_NAME=jml-cap-aks-$VERSION-rg + +# Set the kubernetes cluster name +AZ_AKS_NAME=jml-script-cluster-$VERSION + +# Set the cluster region (see https://docs.microsoft.com/en-us/azure/aks/container-service-quotas) +AZ_REGION=eastus + +# Set the ports needed by your CAP deployment (for LB and NSG) +# "80 443 4443 2222 2793" are mandatory, "8443" is for Stratos UI +# "$(echo 2000{0..9})" is needed to run SCF tests +CAP_PORTS="80 443 4443 2222 2793 8443 $(echo 2000{0..9})" + +# Set the name of the VM pool (alphanumeric characters only) +AZ_AKS_NODE_POOL_NAME=jmlpool$VERSION + +# Set the number of VMs to create +AZ_AKS_NODE_COUNT=4 + +# Select the Azure node flavour (see https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-sizes-specs) +AZ_AKS_NODE_VM_SIZE=Standard_DS3_v2 + +# Set the public SSH key name associated with your Azure account +AZ_SSH_KEY=~/.ssh/id_rsa.pub + +# Set a new admin username +AZ_ADMIN_USER=scf-admin + +# Set the default password for admin +AZ_ADMIN_PSW=pswd.cap diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index b91cae4..f049c13 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -37,6 +37,7 @@ if [ -e $conffile ]; then export AZ_AKS_NODE_VM_SIZE export AZ_SSH_KEY export AZ_ADMIN_USER + export AZ_ADMIN_PSW else echo -e "Error: Can't find config file: \"$conffile\"" exit 1 @@ -51,7 +52,6 @@ esac deploymentid=CAP-AKS-`date +'%Y-%m-%d_%Hh%M'`_$(echo $conffile | cut -d "." -f1) logfile=$deploymentid/deployment.log mkdir $deploymentid -export AKSDEPLOYID=$deploymentid echo -e "Deployment log: $deploymentid \n\nValues from $conffile:\n" > $logfile cat $conffile | sed -e 's/#.*$//' -e '/^$/d' >> $logfile @@ -64,7 +64,8 @@ az aks create --resource-group $AZ_RG_NAME --name $AZ_AKS_NAME \ --node-count $AZ_AKS_NODE_COUNT --admin-username $AZ_ADMIN_USER \ --ssh-key-value $AZ_SSH_KEY --node-vm-size $AZ_AKS_NODE_VM_SIZE \ --node-osdisk-size=60 --nodepool-name $AZ_AKS_NODE_POOL_NAME 2>&1>> $logfile - +export AZ_CLUSTER_FQDN=$(az aks list -g $AZ_RG_NAME|jq '.[].fqdn'|sed -e 's/"//g') +echo -e "Cluster FQDN: $AZ_CLUSTER_FQDN" export AZ_MC_RG_NAME=$(az group list -o table | grep MC_"$AZ_RG_NAME"_ | awk '{print $1}') echo -e "Created AKS cluster: $AZ_AKS_NAME in $AZ_MC_RG_NAME" @@ -124,7 +125,7 @@ if [ "$mode" = "default" ]; then --name probe-$i \ --protocol tcp \ --port $i 2>&1>> $logfile - + az network lb rule create \ --resource-group $AZ_MC_RG_NAME \ --lb-name $AZ_AKS_NAME-lb \ @@ -169,8 +170,8 @@ if [ "$mode" = "default" ]; then internal_ips=($(az network nic list --resource-group $AZ_MC_RG_NAME | jq -r '.[].ipConfigurations[].privateIpAddress')) extip=\[\"$(echo "${internal_ips[*]}" | sed -e 's/ /", "/g')\"\] public_ip=$(az network public-ip show --resource-group $AZ_MC_RG_NAME --name $AZ_AKS_NAME-public-ip --query ipAddress --output tsv) - domain=${public_ip}.omg.howdoi.website - cat ./.scf-config-values.template | sed -e '/^# This/d' -e 's//'$domain'/g' -e 's//'"$extip"'/g' -e '/^services:/d' -e '/loadbalanced/d' > $deploymentid/scf-config-values.yaml + domain=${public_ip}.xip.io + cat ./.scf-config-values.template | sed -e '/^# This/d' -e 's//'$domain'/g' -e 's//'"$extip"'/g' -e '/^services:/d' -s 's//'"$AZ_CLUSTER_FQDN"'/g' -e 's//'"$AZ_ADMIN_PSW"'/g' -e '/loadbalanced/d' > $deploymentid/scf-config-values.yaml echo -e " Public IP:\t\t\t\t${public_ip}\n \ Private IPs (external_ips for CAP):\t$extip\n \ Suggested DOMAIN for CAP: \t\t\"$domain\"\n\n \ diff --git a/deploy_cap_on_aks_by_step.sh b/deploy_cap_on_aks_by_step.sh new file mode 100755 index 0000000..b727a73 --- /dev/null +++ b/deploy_cap_on_aks_by_step.sh @@ -0,0 +1,148 @@ +#!/bin/bash +#Check if AKSDEPLOYID envvar exist +if [[ -z "${AKSDEPLOYID}" ]]; then + echo "This script expects AKSDEPLOYID envvar to be provided"; exit +else + [ -f "$AKSDEPLOYID/.envvar.sh" ]; source $AKSDEPLOYID/.envvar.sh; +fi +kubectl get nodes +export SUBSCRIPTION_ID=$(az account show | jq -r '.id') +echo "export SUBSCRIPTION_ID=$SUBSCRIPTION_ID" >> $AKSDEPLOYID/.envvar.sh; +export KUBECONFIG="$AKSDEPLOYID/kubeconfig" +echo "export KUBECONFIG=$KUBECONFIG" >>$AKSDEPLOYID/.envvar.sh; +PS3='Please enter your choice: ' +set -e +options=("Quit" "Review scfConfig" "Deploy UAA" "Pods UAA" \ + "Deploy SCF" "Pods SCF" "Deploy CATALOG" "Pods CATALOG" \ +"Create Azure SB" "Deploy OSBA" "Pods OSBA" "CF API set" \ +"CF Add SB" "CF CreateOrgSpace" "CF 1st Service" \ +"CF 1st Service Status" "AZ List Mysql DBs to Disable" "AZ Disable SSL Mysql DBs" "Deploy 1st Rails Appl" "Deploy Stratos SCF Console" "Pods Stratos" "Deploy Metrics" "Pods Metrics") +select opt in "${options[@]}" +do + case $opt in + "Quit") + break + ;; + "Review scfConfig") + vim $AKSDEPLOYID/scf-config-values.yaml + ;; + "Deploy UAA") + helm install suse/uaa --name susecf-uaa --namespace uaa --values $AKSDEPLOYID/scf-config-values.yaml + ;; + "Pods UAA") + watch kubectl get pods -n uaa + ;; + "Deploy SCF") + SECRET=$(kubectl get pods --namespace uaa -o jsonpath='{.items[?(.metadata.name=="uaa-0")].spec.containers[?(.name=="uaa")].env[?(.name=="INTERNAL_CA_CERT")].valueFrom.secretKeyRef.name}'); + CA_CERT="$(kubectl get secret $SECRET --namespace uaa -o jsonpath="{.data['internal-ca-cert']}" | base64 --decode -)"; + echo "CA_CERT=$CA_CERT"; + helm install suse/cf --name susecf-scf --namespace scf --values $AKSDEPLOYID/scf-config-values.yaml --set "secrets.UAA_CA_CERT=${CA_CERT}" + ;; + "Pods SCF") + watch kubectl get pods -n scf + ;; + "Deploy CATALOG") + helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com ; + helm repo update; + helm install svc-cat/catalog --name catalog --namespace catalog --set apiserver.storage.etcd.persistence.enabled=true \ + --set apiserver.healthcheck.enabled=false --set controllerManager.healthcheck.enabled=false --set apiserver.verbosity=2 \ + --set controllerManager.verbosity=2 + ;; + "Pods CATALOG") + watch kubectl get pods -n catalog + ;; + "Create Azure SB") + export SUBSCRIPTION_ID=$(az account show | jq -r '.id') + export REGION=eastus + export SBRGNAME=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 8)-service-broker + az group create --name ${SBRGNAME} --location ${REGION} + echo SBRGNAME=${SBRGNAME} + export SERVICE_PRINCIPAL_INFO="$(az ad sp create-for-rbac --name ${SBRGNAME})" + echo "export SBRGNAME=$SBRGNAME" >>$AKSDEPLOYID/.envvar.sh + echo "export REGION=$REGION" >>$AKSDEPLOYID/.envvar.sh + echo "export SERVICE_PRINCIPAL_INFO='$SERVICE_PRINCIPAL_INFO'" >>$AKSDEPLOYID/.envvar.sh + ;; + "Deploy OSBA") + helm repo add azure https://kubernetescharts.blob.core.windows.net/azure; + helm repo update; + TENANT_ID=$(echo ${SERVICE_PRINCIPAL_INFO} | jq -r '.tenant') + CLIENT_ID=$(echo ${SERVICE_PRINCIPAL_INFO} | jq -r '.appId') + CLIENT_SECRET=$(echo ${SERVICE_PRINCIPAL_INFO} | jq -r '.password') + echo REGION=${REGION}; + echo SUBSCRIPTION_ID=${SUBSCRIPTION_ID} \; TENANT_ID=${TENANT_ID}\; CLIENT_ID=${CLIENT_ID}\; CLIENT_SECRET=${CLIENT_SECRET} + helm install azure/open-service-broker-azure --name osba --namespace osba \ + --set azure.subscriptionId=${SUBSCRIPTION_ID} \ + --set azure.tenantId=${TENANT_ID} \ + --set azure.clientId=${CLIENT_ID} \ + --set azure.clientSecret=${CLIENT_SECRET} \ + --set azure.defaultLocation=${REGION} \ + --set redis.persistence.storageClass=default \ + --set basicAuth.username=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 16) \ + --set basicAuth.password=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 16) \ + --set tls.enabled=false + ;; + "Pods OSBA") + watch kubectl get pods -n osba + ;; + "CF API set") + CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) + echo "CF Endpoint : $CFEP" + cf api --skip-ssl-validation $CFEP + ADMINPSW=$(awk '/CLUSTER_ADMIN_PASSWORD:/{print $NF}' $AKSDEPLOYID/scf-config-values.yaml) + cf login -u admin -p $ADMINPSW + ;; + "CF Add SB") + cf create-service-broker azure $(kubectl get deployment osba-open-service-broker-azure \ + --namespace osba -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name == "BASIC_AUTH_USERNAME")].value}') $(kubectl get secret --namespace osba osba-open-service-broker-azure -o jsonpath='{.data.basic-auth-password}' | base64 -d) http://osba-open-service-broker-azure.osba + cf service-access -b azure | awk '($2 ~ /basic/)||($1 ~ /mongo/) { system("cf enable-service-access " $1 " -p " $2)}' + ;; + "CF CreateOrgSpace") + cf create-org testorg; + cf create-space scftest -o testorg; + cf target -o "testorg" -s "scftest"; + ;; + "CF 1st Service") + cf create-service azure-mysql-5-7 basic scf-rails-example-db -c "{ \"location\": \"${REGION}\", \"resourceGroup\": \"${SBRGNAME}\", \"firewallRules\": [{\"name\": \"AllowAll\", \"startIPAddress\":\"0.0.0.0\",\"endIPAddress\":\"255.255.255.255\"}]}"; + ;; + "CF 1st Service Status") + watch -n10 cf service scf-rails-example-db ; + + + ;; + "AZ List Mysql DBs to Disable") + az mysql server list --resource-group $SBRGNAME|jq '.[] |select(.sslEnforcement=="Enabled")' |awk '/name.*-/{print "az mysql server update --resource-group $SBRGNAME --name " substr($2,2,length($2)-3) " --ssl-enforcement Disabled"}' + ;; + "AZ Disable SSL Mysql DBs") + az mysql server list --resource-group $SBRGNAME|jq '.[] |select(.sslEnforcement=="Enabled")' |awk '/name.*-/{print "az mysql server update --resource-group $SBRGNAME --name " substr($2,2,length($2)-3) " --ssl-enforcement Disabled"}'|sh + ;; + "Deploy 1st Rails Appl") + echo "Clone the rails application to consume the mySQL db" + git clone https://github.com/scf-samples/rails-example $AKSDEPLOYID/rails-example + cd $AKSDEPLOYID/rails-example + echo "Push the application to SCF" + cf push + echo "Populate the DB with sample data" + cf ssh scf-rails-example -c "export PATH=/home/vcap/deps/0/bin:/usr/local/bin:/usr/bin:/bin && \ + export BUNDLE_PATH=/home/vcap/deps/0/vendor_bundle/ruby/2.5.0 && \ + export BUNDLE_GEMFILE=/home/vcap/app/Gemfile && cd app && bundle exec rake db:seed" + cd ../.. + cf apps + cf services + echo "Test the app" + cf apps|awk '/xip/{print "curl " $NF }'|sh + ;; + "Deploy Stratos SCF Console") + helm install suse/console --name susecf-console --namespace stratos --values $AKSDEPLOYID/scf-config-values.yaml --set services.loadbalanced=true --set metrics.enabled=true + ;; + "Pods Stratos") + watch kubectl get pods -n stratos + ;; + "Deploy Metrics") + helm install stratos/metrics --name=scf-metrics --devel --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml + ;; + "Pods Metrics") + watch kubectl get pods -n metrics + ;; + *) echo "invalid option $REPLY";; + esac +done From 2f164771baa435200c8888baa9a8176a65c45d44 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Thu, 28 Feb 2019 17:50:01 +0100 Subject: [PATCH 03/22] add envvar init for the cap deployment --- init_aks_env.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 init_aks_env.sh diff --git a/init_aks_env.sh b/init_aks_env.sh new file mode 100644 index 0000000..d02cd9b --- /dev/null +++ b/init_aks_env.sh @@ -0,0 +1,4 @@ +export AKSDEPLOYID=CAP-AKS-2019-02-28_12h22_jmlcluster5 +export KUBECONFIG="$AKSDEPLOYID/kubeconfig" +CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) +cf api --skip-ssl-validation $CFEP From 055b5264cb9aa67d14312888256ec0fbef5961bc Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Thu, 28 Feb 2019 18:31:57 +0100 Subject: [PATCH 04/22] update document for CAP/AKS deployment --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d67ccab..c365cc2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,19 @@ These scripts are for internal use, as they rely on some fixed presets. * Get preconfigured scf-config-values.yaml files * Stop/start your clusters (VMs) by pointing to the config file * Delete clusters by pointing to the config file - +* > additions JML 280219 : +* >use the aks-cluster-config.conf file for your deployment (allows versioning of AZ objects while testing) +* >Deploy CAP + OSBA & components & 1st mysql/rail Application through a menu driven approach. +```bash +1) Quit 9) Create Azure SB 17) AZ List Mysql DBs to Disable +2) Review scfConfig 10) Deploy OSBA 18) AZ Disable SSL Mysql DBs +3) Deploy UAA 11) Pods OSBA 19) Deploy 1st Rails Appl +4) Pods UAA 12) CF API set 20) Deploy Stratos SCF Console +5) Deploy SCF 13) CF Add SB 21) Pods Stratos +6) Pods SCF 14) CF CreateOrgSpace 22) Deploy Metrics +7) Deploy CATALOG 15) CF 1st Service 23) Pods Metrics +8) Pods CATALOG 16) CF 1st Service Status +``` # Prerequisites @@ -24,8 +36,9 @@ Tested with the following versions: The scripts take configuration files. "example.conf" is the default one, which is used if no configuration file is given. You need to modify "example.conf" for your needs, while I recommend to just copy it to e.g. "myaks.conf" and modify that +You may use the aks-cluster-config.conf as well if you have multiple attempts/versions in parallel. ```bash -$ + + + +

Hello from Rails on SCF!

+2019-03-01T08:52:53+00:00 + +
    +
  • #1: Drink coffee
  • +
  • #2: Go to work
  • +
  • #3: Have some rest
  • +
+ + + +Deploy Stratos SCF Console +NAME: susecf-console +LAST DEPLOYED: Fri Mar 1 09:52:55 2019 +NAMESPACE: stratos +STATUS: DEPLOYED + +RESOURCES: +==> v1beta1/StatefulSet +NAME DESIRED CURRENT AGE +stratos 1 1 0s + +==> v1/Pod(related) +NAME READY STATUS RESTARTS AGE +stratos-db-69cd4469ff-7t96r 0/1 Pending 0 0s +stratos-0 0/3 Pending 0 0s + +==> v1/Secret +NAME TYPE DATA AGE +susecf-console-secret Opaque 2 1s +susecf-console-mariadb-secret Opaque 2 1s + +==> v1/PersistentVolumeClaim +NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE +susecf-console-encryption-key-volume Pending default 1s +console-mariadb Pending default 1s +susecf-console-upgrade-volume Pending default 1s + +==> v1/Service +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +susecf-console-mariadb ClusterIP 10.0.31.189 3306/TCP 1s +susecf-console-ui-ext LoadBalancer 10.0.214.23 52.186.13.127,10.240.0.7,10.240.0.6,10.240.0.5,10.240.0.4 8443:32305/TCP 1s + +==> v1beta1/Deployment +NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE +stratos-db 1 1 1 0 1s + + +Wait for STRATOS pods to be ready +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 2 pods to wait for in stratos +Til 1 pods to wait for in stratos +Til 1 pods to wait for in stratos +Til 1 pods to wait for in stratos +Til 0 pods to wait for in stratos +Deploy Metrics +NAME: scf-metrics +LAST DEPLOYED: Fri Mar 1 09:56:46 2019 +NAMESPACE: metrics +STATUS: DEPLOYED + +RESOURCES: +==> v1/PersistentVolumeClaim +NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE +scf-metrics-prometheus-prometheus Pending default 2s + +==> v1beta1/ClusterRole +NAME AGE +scf-metrics-prometheus-kube-state-metrics 2s +scf-metrics-prometheus-prometheus 2s + +==> v1beta1/Deployment +NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE +scf-metrics-prometheus-kube-state-metrics 1 1 1 0 1s +scf-metrics-prometheus-prometheus 1 1 1 0 1s +stratos-metrics-cfdevio 1 1 1 0 1s + +==> v1/Service +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +scf-metrics-prometheus-kube-state-metrics ClusterIP None 80/TCP 2s +scf-metrics-prometheus-prometheus ClusterIP 10.0.175.130 9090/TCP 1s +scf-metrics-metrics-nginx NodePort 10.0.157.88 52.186.13.127,10.240.0.7,10.240.0.6,10.240.0.5,10.240.0.4 7443:30413/TCP 1s +scf-metrics-f-exp-service ClusterIP 10.0.167.120 9186/TCP 1s + +==> v1/Pod(related) +NAME READY STATUS RESTARTS AGE +scf-metrics-prometheus-kube-state-metrics-7bcbb75bf-2wtl6 0/1 ContainerCreating 0 1s +scf-metrics-prometheus-prometheus-7fb98f4d69-wb8d6 0/2 Pending 0 1s +stratos-metrics-cfdevio-6977d9cf6f-8fkjs 0/2 Init:0/1 0 1s + +==> v1/Secret +NAME TYPE DATA AGE +scf-metrics-nginx-tls Opaque 2 2s + +==> v1/ConfigMap +NAME DATA AGE +scf-metrics-stratos-metrics-config 3 2s + +==> v1/ServiceAccount +NAME SECRETS AGE +scf-metrics-prometheus-kube-state-metrics 1 2s +scf-metrics-prometheus-node-exporter 1 2s +scf-metrics-prometheus-prometheus 1 2s + +==> v1beta1/ClusterRoleBinding +NAME AGE +scf-metrics-prometheus-kube-state-metrics 2s +scf-metrics-prometheus-prometheus 2s + + +Wait for METRICS pods to be ready +Til 3 pods to wait for in metrics +Til 2 pods to wait for in metrics +Til 2 pods to wait for in metrics +Til 1 pods to wait for in metrics +Til 1 pods to wait for in metrics +Til 1 pods to wait for in metrics +Til 1 pods to wait for in metrics +Til 0 pods to wait for in metrics +Please enter your choice: 1 +jmlambert@linux:~/azure-cap/deploy-cap-aks-cluster-jml> + From fab83d6b63f5bec742b8baa9f26728f0c31e7d35 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Fri, 1 Mar 2019 12:51:35 +0100 Subject: [PATCH 11/22] fix typo in menu --- deploy_cap_on_aks_automated.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy_cap_on_aks_automated.sh b/deploy_cap_on_aks_automated.sh index 0e4c380..c302d98 100755 --- a/deploy_cap_on_aks_automated.sh +++ b/deploy_cap_on_aks_automated.sh @@ -12,7 +12,7 @@ export KUBECONFIG="$AKSDEPLOYID/kubeconfig" echo "export KUBECONFIG=$KUBECONFIG" >>$AKSDEPLOYID/.envvar.sh; PS3='Please enter your choice: ' set -e -options=("Quit" "Review scfConfig" "Deploy APP All Steps") +options=("Quit" "Review scfConfig" "Deploy CAP All Steps") select opt in "${options[@]}" do case $opt in From 727ff09473a3d03c4e40692160253318e5a62766 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Fri, 1 Mar 2019 13:22:22 +0100 Subject: [PATCH 12/22] remove the psp for 1.3.1 --- deploy_cap_aks_cluster.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index 59b7c13..1d6743a 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -63,6 +63,7 @@ echo -e "Created resource group: $AZ_RG_NAME" az aks create --resource-group $AZ_RG_NAME --name $AZ_AKS_NAME \ --node-count $AZ_AKS_NODE_COUNT --admin-username $AZ_ADMIN_USER \ --ssh-key-value $AZ_SSH_KEY --node-vm-size $AZ_AKS_NODE_VM_SIZE \ + --kubernetes-version 1.11.6 \ --node-osdisk-size=60 --nodepool-name $AZ_AKS_NODE_POOL_NAME 2>&1>> $logfile export AZ_CLUSTER_FQDN=$(az aks list -g $AZ_RG_NAME|jq '.[].fqdn'|sed -e 's/"//g') echo -e "Cluster FQDN: $AZ_CLUSTER_FQDN" @@ -161,8 +162,8 @@ kubectl create -f rbac-config.yaml 2>&1>> $logfile helm init --service-account tiller 2>&1>> $logfile echo -e "Initialized helm for AKS" -kubectl create -f suse-cap-psp.yaml 2>&1>> $logfile -echo -e "Applied PodSecurityPolicy: suse-cap-psp" +#kubectl create -f suse-cap-psp.yaml 2>&1>> $logfile +#echo -e "Applied PodSecurityPolicy: suse-cap-psp" echo -e "\nKubeconfig file is stored to: \"$KUBECONFIG\"\n" | tee -a $logfile From 6c1a8b4ddd5056a83e5357fdaa24e957cc9cecb9 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Mon, 4 Mar 2019 12:20:33 +0100 Subject: [PATCH 13/22] add mongodb example --- deploy_cap_on_aks_by_step.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/deploy_cap_on_aks_by_step.sh b/deploy_cap_on_aks_by_step.sh index b727a73..84d4846 100755 --- a/deploy_cap_on_aks_by_step.sh +++ b/deploy_cap_on_aks_by_step.sh @@ -16,7 +16,9 @@ options=("Quit" "Review scfConfig" "Deploy UAA" "Pods UAA" \ "Deploy SCF" "Pods SCF" "Deploy CATALOG" "Pods CATALOG" \ "Create Azure SB" "Deploy OSBA" "Pods OSBA" "CF API set" \ "CF Add SB" "CF CreateOrgSpace" "CF 1st Service" \ -"CF 1st Service Status" "AZ List Mysql DBs to Disable" "AZ Disable SSL Mysql DBs" "Deploy 1st Rails Appl" "Deploy Stratos SCF Console" "Pods Stratos" "Deploy Metrics" "Pods Metrics") +"CF 1st Service Status" "AZ List Mysql DBs to Disable" "AZ Disable SSL Mysql DBs" "Deploy 1st Rails Appl" \ +"Deploy Stratos SCF Console" "Pods Stratos" "Deploy Metrics" "Pods Metrics" \ +"CF 1st mongoDB Service" "CF 1st mongoDB Service Status" "Deploy 2nd App Nodejs") select opt in "${options[@]}" do case $opt in @@ -143,6 +145,27 @@ do "Pods Metrics") watch kubectl get pods -n metrics ;; + "CF 1st mongoDB Service") + cf create-service azure-cosmosdb-mongo-account account scf-mongo-db -c "{ \"location\": \"${REGION}\", \"resourceGroup\": \"${SBRGNAME}\"}" + ;; + "CF 1st mongoDB Service Status") + watch -n10 cf service scf-mongo-db ; + ;; + "Deploy 2nd App Nodejs") + echo "Clone the nodejs application to consume mongodb db" + git clone https://github.com/jmlambert78/node-backbone-mongo $AKSDEPLOYID/nodejs-example + cd $AKSDEPLOYID/nodejs-example + echo "Push the application to SCF" + cf push + cf bind-service node-backbone-mongo scf-mongo-db + cf restage node-backbone-mongo + cd ../.. + cf apps + cf services + echo "Test the app" + cf apps|awk '/node-backbone-mongo/{print "curl " $NF }'|sh + ;; + *) echo "invalid option $REPLY";; esac done From 01b6082cdd0ea4325aed76bec77f4cddf84c2c32 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Mon, 29 Apr 2019 12:02:33 +0200 Subject: [PATCH 14/22] update k8S version --- deploy_cap_aks_cluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index 1d6743a..11c711d 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -63,7 +63,7 @@ echo -e "Created resource group: $AZ_RG_NAME" az aks create --resource-group $AZ_RG_NAME --name $AZ_AKS_NAME \ --node-count $AZ_AKS_NODE_COUNT --admin-username $AZ_ADMIN_USER \ --ssh-key-value $AZ_SSH_KEY --node-vm-size $AZ_AKS_NODE_VM_SIZE \ - --kubernetes-version 1.11.6 \ + --kubernetes-version 1.12.7 \ --node-osdisk-size=60 --nodepool-name $AZ_AKS_NODE_POOL_NAME 2>&1>> $logfile export AZ_CLUSTER_FQDN=$(az aks list -g $AZ_RG_NAME|jq '.[].fqdn'|sed -e 's/"//g') echo -e "Cluster FQDN: $AZ_CLUSTER_FQDN" From 843ffe6806d9c66dbdf1db91b687eea9644e3dab Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Tue, 16 Jul 2019 17:01:28 +0200 Subject: [PATCH 15/22] updte azure command for status --- deploy_cap_aks_cluster.sh | 2 +- deploy_cap_on_aks_automated.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index 11c711d..e359d3c 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -63,7 +63,7 @@ echo -e "Created resource group: $AZ_RG_NAME" az aks create --resource-group $AZ_RG_NAME --name $AZ_AKS_NAME \ --node-count $AZ_AKS_NODE_COUNT --admin-username $AZ_ADMIN_USER \ --ssh-key-value $AZ_SSH_KEY --node-vm-size $AZ_AKS_NODE_VM_SIZE \ - --kubernetes-version 1.12.7 \ + --kubernetes-version 1.13.7 \ --node-osdisk-size=60 --nodepool-name $AZ_AKS_NODE_POOL_NAME 2>&1>> $logfile export AZ_CLUSTER_FQDN=$(az aks list -g $AZ_RG_NAME|jq '.[].fqdn'|sed -e 's/"//g') echo -e "Cluster FQDN: $AZ_CLUSTER_FQDN" diff --git a/deploy_cap_on_aks_automated.sh b/deploy_cap_on_aks_automated.sh index c302d98..fb78f48 100755 --- a/deploy_cap_on_aks_automated.sh +++ b/deploy_cap_on_aks_automated.sh @@ -114,7 +114,7 @@ do PODSTATUS="progress" ; while [ $PODSTATUS != "succeeded" ]; do sleep 20 ; - PODSTATUS=$(cf services|awk '/scf-rails/{print $NF}'); + PODSTATUS=$(cf services|awk '/scf-rails/{print $(NF-1)}'); echo "Status $PODSTATUS for db service"; done From 5fd5ea11ac85e180edc20584e9509b6da27c3a17 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Thu, 18 Jul 2019 13:46:43 +0200 Subject: [PATCH 16/22] add few steps in automated and add region variable --- deploy_cap_aks_cluster.sh | 3 ++- deploy_cap_on_aks_automated.sh | 3 ++- init_aks_env.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deploy_cap_aks_cluster.sh b/deploy_cap_aks_cluster.sh index e359d3c..c2b0196 100755 --- a/deploy_cap_aks_cluster.sh +++ b/deploy_cap_aks_cluster.sh @@ -38,6 +38,7 @@ if [ -e $conffile ]; then export AZ_SSH_KEY export AZ_ADMIN_USER export AZ_ADMIN_PSW + export AZ_AKS_KUBE_VERSION else echo -e "Error: Can't find config file: \"$conffile\"" exit 1 @@ -63,7 +64,7 @@ echo -e "Created resource group: $AZ_RG_NAME" az aks create --resource-group $AZ_RG_NAME --name $AZ_AKS_NAME \ --node-count $AZ_AKS_NODE_COUNT --admin-username $AZ_ADMIN_USER \ --ssh-key-value $AZ_SSH_KEY --node-vm-size $AZ_AKS_NODE_VM_SIZE \ - --kubernetes-version 1.13.7 \ + --kubernetes-version $AZ_AKS_KUBE_VERSION \ --node-osdisk-size=60 --nodepool-name $AZ_AKS_NODE_POOL_NAME 2>&1>> $logfile export AZ_CLUSTER_FQDN=$(az aks list -g $AZ_RG_NAME|jq '.[].fqdn'|sed -e 's/"//g') echo -e "Cluster FQDN: $AZ_CLUSTER_FQDN" diff --git a/deploy_cap_on_aks_automated.sh b/deploy_cap_on_aks_automated.sh index fb78f48..abd120a 100755 --- a/deploy_cap_on_aks_automated.sh +++ b/deploy_cap_on_aks_automated.sh @@ -61,7 +61,7 @@ do done echo "Create Azure SB" export SUBSCRIPTION_ID=$(az account show | jq -r '.id') - export REGION=eastus + #export REGION=${AZ_REGION} export SBRGNAME=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 8)-service-broker az group create --name ${SBRGNAME} --location ${REGION} echo SBRGNAME=${SBRGNAME} @@ -127,6 +127,7 @@ do git clone https://github.com/scf-samples/rails-example $AKSDEPLOYID/rails-example cd $AKSDEPLOYID/rails-example echo "Push the application to SCF" + cf push -c 'rake db:seed' -i 1 cf push echo "Populate the DB with sample data" cf ssh scf-rails-example -c "export PATH=/home/vcap/deps/0/bin:/usr/local/bin:/usr/bin:/bin && \ diff --git a/init_aks_env.sh b/init_aks_env.sh index d02cd9b..539f13e 100644 --- a/init_aks_env.sh +++ b/init_aks_env.sh @@ -1,4 +1,5 @@ -export AKSDEPLOYID=CAP-AKS-2019-02-28_12h22_jmlcluster5 +export AKSDEPLOYID=CAP-AKS-2019-07-17_15h23_jmlcluster13 +export REGION=westeurope export KUBECONFIG="$AKSDEPLOYID/kubeconfig" CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) cf api --skip-ssl-validation $CFEP From fc1ef0426c8fd47987f61e4af4705da9393fecf1 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Fri, 19 Jul 2019 18:48:00 +0200 Subject: [PATCH 17/22] COrrect the metrics repo & some changes --- deploy_cap_on_aks_automated.sh | 2 +- deploy_cap_on_aks_by_step.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy_cap_on_aks_automated.sh b/deploy_cap_on_aks_automated.sh index abd120a..25014ce 100755 --- a/deploy_cap_on_aks_automated.sh +++ b/deploy_cap_on_aks_automated.sh @@ -148,7 +148,7 @@ do echo "Til $PODSTATUS pods to wait for in $NS"; done echo "Deploy Metrics" - helm install stratos/metrics --name=scf-metrics --devel --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml + helm install suse/metrics --name=scf-metrics --devel --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml echo "Wait for METRICS pods to be ready" PODSTATUS="1" ; NS="metrics" ; while [ $PODSTATUS -ne "0" ]; do diff --git a/deploy_cap_on_aks_by_step.sh b/deploy_cap_on_aks_by_step.sh index 84d4846..0b64be0 100755 --- a/deploy_cap_on_aks_by_step.sh +++ b/deploy_cap_on_aks_by_step.sh @@ -122,6 +122,7 @@ do git clone https://github.com/scf-samples/rails-example $AKSDEPLOYID/rails-example cd $AKSDEPLOYID/rails-example echo "Push the application to SCF" + cf push -c 'rake db:seed' -i 1 cf push echo "Populate the DB with sample data" cf ssh scf-rails-example -c "export PATH=/home/vcap/deps/0/bin:/usr/local/bin:/usr/bin:/bin && \ @@ -140,7 +141,7 @@ do watch kubectl get pods -n stratos ;; "Deploy Metrics") - helm install stratos/metrics --name=scf-metrics --devel --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml + helm install suse/metrics --name=scf-metrics --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml ;; "Pods Metrics") watch kubectl get pods -n metrics From 433a5711457fbde400b85b37819c3788fdc04317 Mon Sep 17 00:00:00 2001 From: jmlambert78 Date: Thu, 8 Aug 2019 21:38:30 +0200 Subject: [PATCH 18/22] Update for some evolution of CAP --- aks-cluster-config.conf | 13 ++++++---- deploy_cap_on_aks_automated.sh | 2 +- deploy_cap_on_aks_by_step.sh | 44 ++++++++++++++++++++++++++++++---- init_aks_env.sh | 8 ++++++- 4 files changed, 55 insertions(+), 12 deletions(-) diff --git a/aks-cluster-config.conf b/aks-cluster-config.conf index dfa94b4..bc72b12 100644 --- a/aks-cluster-config.conf +++ b/aks-cluster-config.conf @@ -1,5 +1,5 @@ # Configure your cluster deployment -VERSION=7 +VERSION=20 # Select LoadBalancer - "azure" for having public/private IPs with AzureLB | "kube" for using e.g. .susecap.net DNS with KubeLB AZ_LOAD_BALANCER=azure @@ -12,8 +12,11 @@ AZ_RG_NAME=jml-cap-aks-$VERSION-rg # Set the kubernetes cluster name AZ_AKS_NAME=jml-script-cluster-$VERSION +# Set the kubernetes cluster kubernetes version +AZ_AKS_KUBE_VERSION=1.12.8 + # Set the cluster region (see https://docs.microsoft.com/en-us/azure/aks/container-service-quotas) -AZ_REGION=eastus +AZ_REGION=westeurope # Set the ports needed by your CAP deployment (for LB and NSG) # "80 443 4443 2222 2793" are mandatory, "8443" is for Stratos UI @@ -24,10 +27,10 @@ CAP_PORTS="80 443 4443 2222 2793 8443 $(echo 2000{0..9})" AZ_AKS_NODE_POOL_NAME=jmlpool$VERSION # Set the number of VMs to create -AZ_AKS_NODE_COUNT=4 +AZ_AKS_NODE_COUNT=3 # Select the Azure node flavour (see https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-sizes-specs) -AZ_AKS_NODE_VM_SIZE=Standard_DS3_v2 +AZ_AKS_NODE_VM_SIZE=Standard_DS4_v2 # Set the public SSH key name associated with your Azure account AZ_SSH_KEY=~/.ssh/id_rsa.pub @@ -36,4 +39,4 @@ AZ_SSH_KEY=~/.ssh/id_rsa.pub AZ_ADMIN_USER=scf-admin # Set the default password for admin -AZ_ADMIN_PSW=pswd.cap +AZ_ADMIN_PSW=psw.cap diff --git a/deploy_cap_on_aks_automated.sh b/deploy_cap_on_aks_automated.sh index 25014ce..8997be9 100755 --- a/deploy_cap_on_aks_automated.sh +++ b/deploy_cap_on_aks_automated.sh @@ -148,7 +148,7 @@ do echo "Til $PODSTATUS pods to wait for in $NS"; done echo "Deploy Metrics" - helm install suse/metrics --name=scf-metrics --devel --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml + helm install suse/metrics --name=scf-metrics --namespace=metrics -f $AKSDEPLOYID/scf-config-values.yaml echo "Wait for METRICS pods to be ready" PODSTATUS="1" ; NS="metrics" ; while [ $PODSTATUS -ne "0" ]; do diff --git a/deploy_cap_on_aks_by_step.sh b/deploy_cap_on_aks_by_step.sh index 0b64be0..39ca750 100755 --- a/deploy_cap_on_aks_by_step.sh +++ b/deploy_cap_on_aks_by_step.sh @@ -5,6 +5,40 @@ if [[ -z "${AKSDEPLOYID}" ]]; then else [ -f "$AKSDEPLOYID/.envvar.sh" ]; source $AKSDEPLOYID/.envvar.sh; fi +PS3='Please enter your choice: ' +set -e +capversions=("1.3.0" "1.3.1" "1.4.0" "1.4.1") +select ver in "${capversions[@]}" +do + case $ver in + "1.3.0") + export UAA_HELM_VERSION=" --version 2.14.5 " + export SCF_HELM_VERSION=" --version 2.14.5 " + export CONSOLE_HELM_VERSION=" --version 2.2.0 " + break; + ;; + "1.3.1") + export UAA_HELM_VERSION=" --version 2.15.2 " + export SCF_HELM_VERSION=" --version 2.15.2 " + export CONSOLE_HELM_VERSION=" --version 2.3.0 " + break; + ;; + "1.4.0") + export UAA_HELM_VERSION=" --version 2.16.4 " + export SCF_HELM_VERSION=" --version 2.16.4 " + export CONSOLE_HELM_VERSION=" --version 2.4.0 " + break; + ;; + "1.4.1") + export UAA_HELM_VERSION=" --version 2.17.1 " + export SCF_HELM_VERSION=" --version 2.17.1 " + export CONSOLE_HELM_VERSION=" --version 2.4.0 " + break; + ;; + esac +done +echo ">>> Installing CAP version $ver <<<" + kubectl get nodes export SUBSCRIPTION_ID=$(az account show | jq -r '.id') echo "export SUBSCRIPTION_ID=$SUBSCRIPTION_ID" >> $AKSDEPLOYID/.envvar.sh; @@ -29,7 +63,7 @@ do vim $AKSDEPLOYID/scf-config-values.yaml ;; "Deploy UAA") - helm install suse/uaa --name susecf-uaa --namespace uaa --values $AKSDEPLOYID/scf-config-values.yaml + helm install suse/uaa $UAA_HELM_VERSION --name susecf-uaa --namespace uaa --values $AKSDEPLOYID/scf-config-values.yaml ;; "Pods UAA") watch kubectl get pods -n uaa @@ -38,7 +72,7 @@ do SECRET=$(kubectl get pods --namespace uaa -o jsonpath='{.items[?(.metadata.name=="uaa-0")].spec.containers[?(.name=="uaa")].env[?(.name=="INTERNAL_CA_CERT")].valueFrom.secretKeyRef.name}'); CA_CERT="$(kubectl get secret $SECRET --namespace uaa -o jsonpath="{.data['internal-ca-cert']}" | base64 --decode -)"; echo "CA_CERT=$CA_CERT"; - helm install suse/cf --name susecf-scf --namespace scf --values $AKSDEPLOYID/scf-config-values.yaml --set "secrets.UAA_CA_CERT=${CA_CERT}" + helm install suse/cf $SCF_HELM_VERSION --name susecf-scf --namespace scf --values $AKSDEPLOYID/scf-config-values.yaml --set "secrets.UAA_CA_CERT=${CA_CERT}" ;; "Pods SCF") watch kubectl get pods -n scf @@ -94,9 +128,9 @@ do cf login -u admin -p $ADMINPSW ;; "CF Add SB") - cf create-service-broker azure $(kubectl get deployment osba-open-service-broker-azure \ + cf create-service-broker azure${REGION} $(kubectl get deployment osba-open-service-broker-azure \ --namespace osba -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name == "BASIC_AUTH_USERNAME")].value}') $(kubectl get secret --namespace osba osba-open-service-broker-azure -o jsonpath='{.data.basic-auth-password}' | base64 -d) http://osba-open-service-broker-azure.osba - cf service-access -b azure | awk '($2 ~ /basic/)||($1 ~ /mongo/) { system("cf enable-service-access " $1 " -p " $2)}' + cf service-access -b azure${REGION} | awk '($2 ~ /basic/)||($1 ~ /mongo/) { system("cf enable-service-access " $1 " -p " $2 " -b " brok)}/^broker:/{brok=$2}' ;; "CF CreateOrgSpace") cf create-org testorg; @@ -135,7 +169,7 @@ do cf apps|awk '/xip/{print "curl " $NF }'|sh ;; "Deploy Stratos SCF Console") - helm install suse/console --name susecf-console --namespace stratos --values $AKSDEPLOYID/scf-config-values.yaml --set services.loadbalanced=true --set metrics.enabled=true + helm install suse/console $CONSOLE_HELM_VERSION --name susecf-console --namespace stratos --values $AKSDEPLOYID/scf-config-values.yaml --set services.loadbalanced=true --set metrics.enabled=true ;; "Pods Stratos") watch kubectl get pods -n stratos diff --git a/init_aks_env.sh b/init_aks_env.sh index 539f13e..527d5ec 100644 --- a/init_aks_env.sh +++ b/init_aks_env.sh @@ -1,5 +1,11 @@ -export AKSDEPLOYID=CAP-AKS-2019-07-17_15h23_jmlcluster13 +#!/bin/bash +export AKSDEPLOYID="$PWD/"CAP-AKS-2019-08-07_20h13_jmlcluster20"" export REGION=westeurope export KUBECONFIG="$AKSDEPLOYID/kubeconfig" +export CF_HOME="$AKSDEPLOYID/cfconfig" +export PS1="\u:\w:$AKSDEPLOYID>\[$(tput sgr0)\]" + +export PS1="\w:>\[$(tput sgr0)\]" + CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) cf api --skip-ssl-validation $CFEP From a60ae7cf2612e85dec7a0b16225f07c6290a3e95 Mon Sep 17 00:00:00 2001 From: Jean Marc Lambert Date: Sat, 10 Aug 2019 09:53:20 +0200 Subject: [PATCH 19/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c488ded..78067ce 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ cf api --skip-ssl-validation $CFEP * Save your file * initialise your ENVVARs by ```bash -source init_aks_env.sh +source init_aks_env_my1.sh ``` * you may review/edit/modify the `scf-config-values.yaml` file that is generated in the `$AKSDEPLOYID/scf-config-values.yaml` From d266b6ae0eb9ddfc52168f482195ece2fbe87459 Mon Sep 17 00:00:00 2001 From: Jean Marc Lambert Date: Sat, 10 Aug 2019 10:01:56 +0200 Subject: [PATCH 20/22] Update README.md --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78067ce..631aa23 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,12 @@ vim init_aks_env_my1.sh ``` * Edit the `AKSDEPLOYID` value to match your deployment above. ```bash -export AKSDEPLOYID=CAP-AKS-2019-02-28_12h22_jmlcluster5 -export KUBECONFIG="$AKSDEPLOYID/kubeconfig" -CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) +export AKSDEPLOYID="$PWD/"CAP-AKS-2019-08-07_20h13_jmlcluster20"" <- ENVVAR pointing toyour config area for this cluster deployment +export REGION=westeurope <- Your azure region where the ServiceBroker will be deployed +export KUBECONFIG="$AKSDEPLOYID/kubeconfig" <- This is the result of the AKS cluster creation already +export CF_HOME="$AKSDEPLOYID/cfconfig" <- Your Cloudfoundry config will be stored there +export PS1="\u:\w:$AKSDEPLOYID>\[$(tput sgr0)\]" +CFEP=$(awk '/Public IP:/{print "https://api." $NF ".xip.io"}' $AKSDEPLOYID/deployment.log) <- Extract the public IP from the deployment cf api --skip-ssl-validation $CFEP ``` * Save your file @@ -89,6 +92,10 @@ cf api --skip-ssl-validation $CFEP source init_aks_env_my1.sh ``` * you may review/edit/modify the `scf-config-values.yaml` file that is generated in the `$AKSDEPLOYID/scf-config-values.yaml` +> **__The project CAPnMore contains an updated way to make this, compatible with this AKS deployment__** +> https://github.com/jmlambert78/CAPnMore +> ** This version supports both AKS and any K8S cluster compatible with CAP. +** AN UPDATE CHAPTER WILL BE INCLUDED SOON ** OPTION1: Now you may launch the menu driven steps for deploying CAP on the cluster just deployed. ```bash From 35e536b22cf0c122d923e5fb2afa54c37f12067f Mon Sep 17 00:00:00 2001 From: Jean Marc Lambert Date: Sat, 10 Aug 2019 10:02:37 +0200 Subject: [PATCH 21/22] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 631aa23..1ceb947 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,11 @@ cf api --skip-ssl-validation $CFEP source init_aks_env_my1.sh ``` * you may review/edit/modify the `scf-config-values.yaml` file that is generated in the `$AKSDEPLOYID/scf-config-values.yaml` + > **__The project CAPnMore contains an updated way to make this, compatible with this AKS deployment__** > https://github.com/jmlambert78/CAPnMore > ** This version supports both AKS and any K8S cluster compatible with CAP. + ** AN UPDATE CHAPTER WILL BE INCLUDED SOON ** OPTION1: Now you may launch the menu driven steps for deploying CAP on the cluster just deployed. From 72e1ad1f4d68b3e2a231acb1bd8532e71d391419 Mon Sep 17 00:00:00 2001 From: Jean Marc Lambert Date: Sat, 10 Aug 2019 10:03:21 +0200 Subject: [PATCH 22/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ceb947..d55d4e7 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ source init_aks_env_my1.sh > https://github.com/jmlambert78/CAPnMore > ** This version supports both AKS and any K8S cluster compatible with CAP. -** AN UPDATE CHAPTER WILL BE INCLUDED SOON ** +**AN UPDATE CHAPTER WILL BE INCLUDED SOON** OPTION1: Now you may launch the menu driven steps for deploying CAP on the cluster just deployed. ```bash