{jenkins-plugin-info:azure-acs}

A Jenkins Plugin to deploy configurations to Azure Container Service (AKS).

It also supports deployment to the legacy Azure Container Service (ACS) with the following orchestrator:

It also supports deployments on Azure Kubernetes Service.

It provides the following main functionality:

Pre-requirements

Configure the plugin

screenshot

  1. Within the Jenkins dashboard, Select a Job then select Configure
  2. Scroll to the "Add post-build action" drop down.
  3. Select "Deploy to Azure Container Service"
  4. Select the service principal from "Azure Credentials" dropdown. If no credentials are configured, create one.
  5. All resource group names will be loaded into the "Resource Group" dropdown. Select the one containing your ACS cluster.
  6. All the container service available in the selected resource group will be loaded into the "Container Service" dropdown. Select your target ACS cluster. (It's suggested that we use a standalone resource group to manage an ACS cluster, and do not add other resources or ACS clusters into the resource group.)
  7. Select the "Master Node SSH Credentials". This should be the credentials of type "SSH Username with private key", where username is the login name you specified when you create the ACS cluster (azureuser by default), and private key is the one matching the public key you specified on the ACS cluster creation (by default that may be $HOME/.ssh/id_rsa on Linux and %USERPROFILE%\.ssh\id_rsa on Windows).
  8. Enter the "Config Files" path of the configurations you want to deploy, in the form of Ant glob syntax. Use comma (,) to separate multiple patterns.
  9. If you want to dynamically update the configurations on each build, for example, use the $BUILD_NUMBER as the tag name of the image being pulled, you can tick the "Enable Variable Substitution in Config" option and the variables (in the pattern $VARIABLE or ${VARIABLE}) in the configurations will be substituted with the corresponding value if they exists in the environment variables.
  10. If the configurations needs to pull images from private repository, click the "Docker Container Registry Credentials..." button and add them one by one.
  11. You may verify the static configuration by clicking "Verify Configuration". This will give you basic result of the configuration quality. You need to run a sample build to verify it works as some of the contents has to be loaded at build time.

Pipeline Support

To use the plugin in pipeline, go to the Pipeline Syntax page when you configure the pipeline job, and choose acsDeploy: Deploy to Azure Container Service from the Sample Step dropdown. You can configure it and click Generate Pipeline Scriptwhich will give you

acsDeploy(azureCredentialsId: '<azure-credential-id>',
          resourceGroupName: '<resource-group-name>',
          containerService: '<acs-name> | <acs-type>',
          sshCredentialsId: '<ssh-credentials-id>',
          configFilePaths: '<configuration-file-paths>',
          enableConfigSubstitution: true,
          
          // Kubernetes
          secretName: '<secret-name>',
          secretNamespace: '<secret-namespace>',
          
          // Docker Swarm
          swarmRemoveContainersFirst: true,
          
          // DC/OS Marathon
          dcosDockerCredentialsPath: '<dcos-credentials-path>',
          
          containerRegistryCredentials: [
              [credentialsId: '<credentials-id>', url: '<docker-registry-url>']
          ])

Data/Telemetry

Azure Container Service Plugin collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more.

You can turn off usage data collection in Manage Jenkins -> Configure System -> Azure -> Help make Azure Jenkins plugins better by sending anonymous usage statistics to Azure Application Insights.

Changelog

Version 0.2.3, 2018-04-03

Version 0.2.2, 2018-02-09

Version 0.2.1, 2018-01-09

Version 0.2.0, 2018-01-05

Version 0.1.5, 2017-11-27

Version 0.1.4, 2017-11-07

Version 0.1.3, 2017-10-18

Version 0.1.2, 2017-09-29

Version 0.1.1, 2017-09-28

Version 0.1.0, 2017-09-27