Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Latest commit

 

History

History
152 lines (101 loc) · 6.49 KB

run-azure.md

File metadata and controls

152 lines (101 loc) · 6.49 KB

Table of Contents

View Kubernetes Dashboard in Dev

Prerequisites - Dashboard

In Addition, you will need to be connected to your Corporate VPN solution

Dashboard Access

To view the kubernetes dashboard in dev, run the snippet below

az login # Only needed once per day

# This will launch a browser - please authenticate with your SHORTCODE based NHS account

az account set --subscription "GP IT Futures Buying Catalogue"
az aks get-credentials --name gpitfutures-development-aks -g gpitfutures-development-rg-aks --admin
az aks browse --name gpitfutures-development-aks -g gpitfutures-development-rg-aks

Note: Best accesssed in Firefox

Note: In the event of issues accessing 127.0.0.1 (in Chromium Browsers) '(NET::ERR_CERT_INVALID)' that CANNOT be overriden, a setting can be changed here to allow access - chrome://flags/#allow-insecure-localhost

Simple Deployment to Azure

The build pipeline for this repository is set up so that each branch publishes to its own namespace in the dev environment, which is then available when pushed.

WARNING Resources on the cluster are limited, so please try not to create too many environments, and remove them once finished (see Destroy Branch)

Prerequisites

  • Pull (locally) the latest copy of the Platform Helm Repository
  • You will need to be connected to your Corporate VPN solution

Creating an Environment

Create a branch & push it

git checkout master
git pull
git checkout -b feature/ticketnumber-branch-name
git push -u origin feature/ticketnumber-branch-name:feature/ticketnumber-branch-name

Next run launch-helper.ps1 selecting either option 3 or 4 (3 = master, 4 = development)

Once it has completed commit the changes to github:

git commit -a -m "enter a meaningful commit message"
git push

Viewing Deployment

The action of pushing a branch to Platform Helm is that the Platform Helm Pipeline will run and create an environment for you on the Development Kubernetes Cluster in Azure.

Browsing Dynamic Environment

The URL will be displayed during the deployment, but will be something like:

URL: https://bc-<story-id>-<my-feature>.dev.buyingcatalogue.digital.nhs.uk # eg. https://bc-feature-12345-dummy-branch.dev.buyingcatalogue.digital.nhs.uk

Destroy Branch

Switch to Master Branch and destroy remote branch

git checkout master
git branch -D feature/<story-id>-<my-feature>
git push origin --delete feature/<story-id>-<my-feature>

Advanced Deployment to Azure

Prerequisites - Advanced

In Addition, you will need to be connected to your Corporate VPN solution

Creating and Viewing an environment

Create a branch & push it

git checkout -b feature/<story-id>-my-feature
<Do Something>
git push

The pipeline will start creating an environment. Progress can be viewed here: nhs-digital-gp-it-futures.platform-helm

Once the environment is created, you'll see a warning on the script spelling out your environment name:

PR Process

The deployment is also hooked up to the PR process, which will create another environment, currently called merge-<pull request number>. This is subject to change, but allows the checks that run against the PR to fully create the environment, and validate the deployment. It is intended this will also run the acceptance tests, allowing feedback on issues across the entire system. This means there will be two environments per PR, one for the branch, and one for the PR.

Environment Removal

IT IS IMPORTANT TO CLEAR DOWN ANY CREATED ENVIRONMENTS

Housekeeping Teardown

A nightly housekeeping task runs that clears up any legacy environments (with properly formatted names).

To utilise this cleardown method all you need to do is remove the branch associated with your environment. The housekeeping task will detect this and clear down the resources automatically.

Manual Teardown

NOTE In order for the script to also clear the databases and storage containers, you'll need to be connected to the VPN

Run the tear down script:

tear-down-azure.sh -n <namespace> -a '<blob store account connection string>'

you can get the connection string from the azure portal

Launch to Azure script - Advanced Environment Creation

There is a helper script that allows the direct creation of an environment in azure, mimicking the build process. To use:

  • Point kubectl to the development cluster
    • az aks get-credentials -n gpitfutures-development-aks -g gpitfutures-development-rg-aks to get the credentials, if you've not previously connected.
  • Run launch-or-update-azure.sh -h for details of the parameters needed to deploy the system in the cloud.