-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2990 from SEED-platform/develop
Release: 2.12.2
- Loading branch information
Showing
89 changed files
with
19,532 additions
and
809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,5 @@ | ||
## Deploy on Kubernetes | ||
### Note: this deployment requires an existing Amazon EKS cluster | ||
|
||
Download and configure the AWS CLI with instructions [here](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) | ||
``` | ||
aws configure | ||
AWS Access Key ID [None]: <insert key> (from account) | ||
AWS Secret Access Key [None]: <insert secret key> (from account) | ||
Default region name [None]: us-east-1 | ||
Default output format [None]: json | ||
``` | ||
_Note: this deployment requires an existing Amazon EKS cluster. Instructions below show how to create the cluster, but many configurations options are available and show be reviewed._ | ||
|
||
Download Kubectl: | ||
|
||
- [Windows](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows) | ||
- Mac | ||
``` | ||
brew install kubectl | ||
``` | ||
|
||
Download Helm: | ||
- [Windows](https://github.com/helm/helm/releases) | ||
- Mac | ||
``` | ||
brew install helm | ||
``` | ||
|
||
### For a new deployment | ||
From the charts directory: | ||
``` | ||
helm install --generate-name persistentvolumes | ||
helm install --generate-name seed | ||
``` | ||
|
||
Configure kubeconfig | ||
``` | ||
aws eks --region us-east-1 update-kubeconfig --name seed | ||
``` | ||
|
||
View the deployments and services | ||
``` | ||
kubectl get all | ||
``` | ||
|
||
### For an existing deployment | ||
Update the web container | ||
``` | ||
kubectl delete pod/web-<assigned-hash> | ||
``` | ||
Note: the service will restart the pod and re-pull the image | ||
|
||
Common kubectl actions can be found [here](https://kubernetes.io/docs/reference/kubectl/cheatsheet/) | ||
See the instructions in [k8s deployment](../docs/source/kubernetes_deployment.rst) or in the [readthedocs](https://seed-platform.readthedocs.io/en/stable/kubernetes_deployment.html). The instructions in readthedocs may be slightly behind the other documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Author: Nicholas Long | ||
# | ||
# This docker container is used to create a backup of the seed database and | ||
# mediafiles, then push the backups to S3. The script itself is the backup_database.sh | ||
# script that is copied into this container for use by helm/k8s batch/CronJob. | ||
|
||
# docker build -t seedplatform/seed-backup-k8s . | ||
# docker push seedplatform/seed-backup-k8s:latest | ||
|
||
FROM ubuntu:20.04 | ||
|
||
# Keys to access the s3 backups | ||
ENV AWS_ACCESS_KEY_ID "" | ||
ENV AWS_SECRET_ACCESS_KEY "" | ||
ENV AWS_DEFAULT_REGION "" | ||
ENV S3_BUCKET_NAME "" | ||
|
||
# Run the Update and install k8s key | ||
RUN apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y \ | ||
python3 \ | ||
curl \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
gnupg \ | ||
python3-pip && \ | ||
ln -s /usr/bin/python3 /usr/bin/python && \ | ||
pip install --upgrade pip && \ | ||
pip install awscli && \ | ||
# install postgres client for pg_dump for backup - SEED is currently on pg12 | ||
# This is hardcoded with the ubuntu 20 (focal) release. | ||
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | ||
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ | ||
apt update && \ | ||
apt install -y postgresql-client-12 | ||
|
||
WORKDIR /app | ||
ADD backup_database.sh /app/ |
Oops, something went wrong.