Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.54 KB

kubernetes.md

File metadata and controls

70 lines (46 loc) · 2.54 KB

MHRA Medicines microservice

Setup

To run the following steps, first you should:

  1. Install Terraform - required to deploy, delete and check the status of current cloud infrastructure from resource files from the command line

  2. Install Azure CLI - allows you to log in to your Azure account and retrieve details about deployed instances. Accessed using az

  3. Authenticate with Azure

    az login
  4. If you have access to more than one subscription, you can set the current subscription by using the relevant SUBSCRIPTION_ID from the output of the above login command:

    az account set --subscription="SUBSCRIPTION_ID"
  5. Install kubectl - a command line tool for interacting with a kubernetes cluster via it's API

Connecting to a Kubernetes cluster

To connect to a cluster, you need to set the Kubernetes credentials file path as the KUBECONFIG environment variable.

  1. Change to the relevant environment directory (e.g. infrastructure/environments/non-prod)

  2. Source the environment variables

      set -a && source .env && set +a
  3. Create the credentials file by running this script and selecting the kubernetes cluster that you want to point to (by environment)

    ../../scripts/update-kubernetes-config.sh

Now you can run kubectl commands against the selected cluster, e.g.

kubectl get nodes

Installing Istio, Sealed Secrets, Argo and service workloads:

  1. Apply manifest to the cluster - to do this, clone the deployments repo, install the necessary prerequisites, go to cluster-init dir and run

    make overlay=non-prod
  2. Validate the Istio installation

    kubectl get svc --namespace istio-system --output wide
  3. Confirm that the required pods have been created

    kubectl get pods --namespace istio-system
  4. Note: you will need to install an SSL certificate and private key. There is a ./certs.sh for a self-sign, or you can obtain a valid cert from Let's Encrypt (e.g. using acme.sh). You may need to restart the ingress gateway pod to pick up the new certs.

    kubectl create -n istio-system secret tls istio-ingressgateway-certs --key key.txt --cert crt.txt