Skip to content

Commit

Permalink
remove k8s deploy and update circle confg
Browse files Browse the repository at this point in the history
deploy dashboards to stg and prod

update readme and docs
  • Loading branch information
willc-work committed Sep 5, 2024
1 parent 34daf35 commit 0b7d87f
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 520 deletions.
57 changes: 14 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,39 +164,12 @@ jobs:
- run:
name: Deploy Grafana Dashboards
command: |
kubectl apply -f ./kubernetes_deploy/staging/ingress-dashboard.yml
kubectl apply -f ./kubernetes_deploy/staging/pods-dashboard.yml
if [ -f ./dashboards/${K8S_NAMESPACE}/ingress-dashboard.yml ]; then
kubectl apply -f ./dashboards/${K8S_NAMESPACE}/ingress-dashboard.yml
fi
kubectl apply -f ./dashboards/${K8S_NAMESPACE}/pods-dashboard.yml
deploy:
parameters:
environment:
type: string
docker:
- image: ministryofjustice/cloud-platform-tools
steps:
- checkout
- aws-login-to-ecr-and-tagging
- run:
name: Authenticate with cluster
command: |
echo -n ${K8S_CLUSTER_CERT} | base64 -d > ./ca.crt
kubectl config set-cluster ${K8S_CLUSTER_NAME} --certificate-authority=./ca.crt --server=https://${K8S_CLUSTER_NAME}
kubectl config set-credentials circleci --token=${K8S_TOKEN}
kubectl config set-context ${K8S_CLUSTER_NAME} --cluster=${K8S_CLUSTER_NAME} --user=circleci --namespace=${K8S_NAMESPACE}
kubectl config use-context ${K8S_CLUSTER_NAME}
echo ${K8S_CLUSTER_NAME}
- run:
name: ECR config
command: |
echo "export ECR_ENDPOINT=$AWS_ECR_REGISTRY_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY" >> $BASH_ENV
- run:
name: Deploy to << parameters.environment >>
command: |
.circleci/deploy_to_kubernetes << parameters.environment >>
- slack/status


deploy_with_helm:
parameters:
environment:
type: string
Expand Down Expand Up @@ -239,7 +212,7 @@ workflows:
- test
context: laa-fala

- deploy_with_helm:
- deploy:
name: Deploy UAT branch
environment: staging
requires:
Expand All @@ -261,8 +234,8 @@ workflows:
only:
- main

- deploy_with_helm:
name: Helm Staging Deploy
- deploy:
name: Deploy to Staging
environment: staging
requires:
- staging_deploy_approval
Expand All @@ -275,7 +248,7 @@ workflows:
- laa-fala-live-staging

- deploy_grafana:
name: deploy_grafana
name: Deploy Grafana Staging Dashboards
requires:
- staging_deploy_approval
filters:
Expand All @@ -289,15 +262,14 @@ workflows:
- production_deploy_approval:
type: approval
requires:
- Helm Staging Deploy
- Deploy to Staging
filters:
branches:
only:
- main

- deploy:
name: production_deploy
environment: production

- deploy_grafana:
name: Deploy Grafana Production Dashboards
requires:
- production_deploy_approval
filters:
Expand All @@ -308,12 +280,11 @@ workflows:
- laa-fala
- laa-fala-live-production

- deploy_with_helm:
name: helm_production_deploy
- deploy:
name: Deploy to Production
environment: production
requires:
- production_deploy_approval
- production_deploy
filters:
branches:
only:
Expand Down
33 changes: 0 additions & 33 deletions .circleci/deploy_to_kubernetes

This file was deleted.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ When breakpoint() is reached, you will be able to debug from the command line.

https://docs.python.org/3/library/pdb.html

## Deploying to Staging and Production

The service uses `helm` to deploy to Cloud Platform Environments via CircleCI. This can be installed using:

`brew install helm`

To view helm deployments in a namespace the command is:

`helm -n <namespace> ls --all`

e.g. `helm -n laa-fala-staging ls --all`

Deployments can be deleted by running:

`helm delete <name-of-deployment>`

e.g. `helm -n laa-fala-staging delete el-123-fee-change`

It is also possible to manually deploy to an environment from the command line, the structure of the command can be found in `bin/deploy.sh`


## Documentation
* [Installation via virtualenv](docs/virtual-env.md)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 0 additions & 60 deletions docs/kubernetes.md

This file was deleted.

1 change: 0 additions & 1 deletion kubernetes_deploy/development/dashboard.yml

This file was deleted.

40 changes: 0 additions & 40 deletions kubernetes_deploy/development/deployment.yml

This file was deleted.

1 change: 0 additions & 1 deletion kubernetes_deploy/development/ingress.yml

This file was deleted.

13 changes: 0 additions & 13 deletions kubernetes_deploy/development/service.yml

This file was deleted.

65 changes: 0 additions & 65 deletions kubernetes_deploy/production/deployment.yml

This file was deleted.

27 changes: 0 additions & 27 deletions kubernetes_deploy/production/ingress.yml

This file was deleted.

Loading

0 comments on commit 0b7d87f

Please sign in to comment.