Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Azure Devops Pipeline to provision OSB #696

Open
cforce opened this issue Apr 23, 2019 · 0 comments
Open

Azure Devops Pipeline to provision OSB #696

cforce opened this issue Apr 23, 2019 · 0 comments

Comments

@cforce
Copy link

cforce commented Apr 23, 2019

For everybody who wants to start a pipeline on ado for rollout osb on an aks

trigger: none
variables:
- group: sp-variables
- group: infrastructure
- name: resourcegroup
  value: '$(region)-$(cluster)-$(domain)-k8s-rg'
- name: kubecluster
  value: '$(region)-$(cluster)-$(domain)-k8s'

jobs:
- job: Provision
  pool:
    vmImage: ubuntu-16.04
  steps:
  - bash: |
      echo "pipeline variable region was not set."
      exit 1
    condition: eq(variables['region'], '')
    name: ValidationRegion
    displayName: Validation region
  - bash: |
      echo "pipeline variable cluster was not set."
      exit 1
    condition: eq(variables['cluster'], '')
    name: ValidationCluster
    displayName: Validation cluster
  - bash: |
      echo "pipeline variable domain was not set."
      exit 1
    condition: eq(variables['domain'], '')
    name: ValidationDomain
    displayName: Validation domain  
  - task: HelmInstaller@0
    displayName: 'Install Helm 2.9.1'
  - task: HelmDeploy@0
    displayName: Helm init
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      command: init
      upgradetiller: true
      arguments: --client-only
  - task: HelmDeploy@0
    displayName: 'helm repo del osba'
    continueOnError: true
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      command: del
      arguments: '--purge osba'
      waitForExecution: true
  - task: HelmDeploy@0
    displayName: 'helm repo del catalog'
    continueOnError: true
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      command: del
      arguments: '--purge catalog'
      waitForExecution: true
  - task: HelmDeploy@0
    displayName: 'helm repo add osba'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      command: repo
      arguments: 'add azure https://kubernetescharts.blob.core.windows.net/azure'
  - task: HelmDeploy@0
    displayName: 'helm repo add catalogue'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      command: repo
      arguments: 'add svc-cat https://svc-catalog-charts.storage.googleapis.com'
  - bash: |
      echo "wait for volumes to be removed"
      sleep 2m
      exit 0
    displayName: Resource removel timeout    
  - task: HelmDeploy@0
    displayName: 'helm install catalog'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      namespace: catalog
      command: upgrade
      install: true
      chartName: 'svc-cat/catalog'
      releaseName: catalog
      overrideValues: 'apiserver.storage.etcd.persistence.enabled=true,apiserver.healthcheck.enabled=false,controllerManager.healthcheck.enabled=false,apiserver.verbosity=4,controllerManager.verbosity=4'
      updateDependency: true
      waitForExecution: true
      continueOnError: false      
      # https://github.com/helm/helm/issues/3173
      # https://github.com/helm/helm/issues/4210
  - task: Kubernetes@1
    displayName: 'kubectl catalog-api rollout status'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      namespace: catalog
      command: 'rollout'
      waitForExecution: true
      continueOnError: false
      outputFormat: 
      # see https://github.com/Microsoft/azure-pipelines-tasks/pull/9925
      arguments: 'status --watch deployment/catalog-catalog-apiserver'
  - task: Kubernetes@1
    displayName: 'kubectl catalog-controller rollout status'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      namespace: catalog
      command: 'rollout'
      waitForExecution: true
      continueOnError: false
      outputFormat: 
      # see https://github.com/Microsoft/azure-pipelines-tasks/pull/9925      
      arguments: 'status deployment/catalog-catalog-controller-manager'
  - bash: |
      echo "wait for api controller init"
      sleep 1m
      exit 0      
  - task: HelmDeploy@0
    displayName: 'helm install osba'
    inputs:
      connectionType: Azure Resource Manager
      azureSubscriptionEndpoint: $(azure.subscription)
      azureResourceGroup: $(resourcegroup)
      kubernetesCluster: $(kubecluster)
      namespace: osba
      command: upgrade
      install: true
      chartName: 'azure/open-service-broker-azure'
      releaseName: osba
      overrideValues: 'azure.subscriptionId=$(azure.subscription.id),azure.tenantId=$(sp-tenant),azure.clientId=$(sp-clientId),azure.clientSecret=$(sp-password),modules.minStability=EXPERIMENTAL'
      updateDependency: true
      continueOnError: false
      waitForExecution: true
      arguments: '--debug'
 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant