17 Commits

Author SHA1 Message Date
dandds
46643f7f41 Config for JEDI dev cluster.
- Transition to VMSS identity for flexvol
- Update some environment variables for cloudzero dev
- Overlay for applying migrations
- Updates to disable CDN, which will not be available
- Removes CronJob for resetting the database; don't need that in this
  cluster for now.
2020-02-08 15:06:43 -05:00
dandds
2ab9790f3e
Merge branch 'staging' into cloudzero-k8s 2020-01-21 10:23:50 -05:00
raydds
14b9f36204 Minimize staging 2020-01-20 15:41:52 -05:00
dandds
d121a12429 Minimal config for cloudzero dev environment.
This includes config for the VMSS assigned identity to authenticate for
FlexVol purposes. Right now, some dummy keys are referenced in the
config that we'll swap for the real ones later.

This also includes config for specifying the subnet the load balancers
should be in.
2020-01-16 11:51:02 -05:00
raydds
5813cc1370 Do not explicitly set replica count 2020-01-16 10:16:54 -05:00
dandds
8ec23b54a8 WIP: k8s config for cloud-zero 2019-12-23 18:39:55 -05:00
dandds
9d282ee82a K8s cronjob for resetting the database on staging.
This K8s CronJob will run the script for resetting the database. It will
only be applied to the staging site.
2019-12-17 13:19:40 -05:00
dandds
972cf14a66 K8s configuration for mounting application config.
This adds an additional volume mount for Flask application secrets.
These will be mounted into the ATST container so that their values can
be read in as config.
2019-12-10 10:14:53 -05:00
tomdds
728bb5713f Fix flexVol serving of nginx certificates
FlexVol requires that you specify certificates as secrets in order to get both the certificate and private key in the appropriate format for nginx to consume. Additionally, flexvol shouldn't interfer with other secrets mounted in it's host directory.
2019-12-02 15:45:16 -05:00
tomdds
33ce02d045 Better differentiate between master and staging vault config via overlay 2019-12-02 15:45:16 -05:00
tomdds
221e9ab26b Add a staging overlay for the key vault name
Currently we're just using the test vault, but in the future we want to be able to prescribe vault names for different environments via overlay.
2019-12-02 15:45:16 -05:00
dandds
08fc530223 Add config value for CDN origin.
This value is set as the Access-Control-Allow-Origin header value for
the application. When using Azure CDN, the CDN will consume this header
when it populates its cache and use it on subsequent requests.

It would be possible to make this the same as the Flask SERVER_NAME
value. We explicitly set SERVER_NAME for Celery worker processes because
they need that information to contruct URLs outside of the request cycle
(Flask can infer the server name within a request cycle). I decided not
to rely on SERVER_NAME though because it has side effects:

- It determines what `url_for` uses as the host domain (which would be
  fine).
- It makes it so that the Flask app can only server requests to that
  domain (probably fine, but it felt like too big a side effect).

Additionally, SERVER_NAME does not include the scheme. For all of these
reasons I opted to make CDN_ORIGIN a separate config value.
2019-11-21 16:43:22 -05:00
dandds
c6187466a3 Configure staging with different FLASK_ENV, include sub-route for CDN_URL. 2019-11-21 16:43:22 -05:00
richard-dds
8e12c6bfbd Add CDN config for staging 2019-11-21 16:42:42 -05:00
dandds
280778ab5f Set SERVER_NAME correctly for staging Celery workers. 2019-11-19 13:36:47 -05:00
dandds
88171aaee7 Supply named default queue for Celery.
Supplying this will prevent queue clashes between various ATAT sites
sharing the same Redis instance.

Note that the Celery documentation is currently wrong about the name for
configuring this:

https://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_default_queue

It specifies `CELERY_TASK_DEFAULT_QUEUE`, but
`CELERY_DEFAULT_QUEUE` is the value that Celery currently looks for.
This appears to be fixed in on an upcoming release:

https://github.com/celery/celery/issues/5575

This is worth keeping an eye on, since the configuration key could
change in the future.
2019-11-14 15:48:14 -05:00
dandds
630469744a Use kustomize and envsubst to generalize k8s config.
Adds a [kustomize](https://github.com/kubernetes-sigs/kustomize) overlay
for a new staging environment. Additionally, adds environment variables
in the place of certain pieces of information that need to be templated.

The K8s README ("deploy/README.md") has been updated to reflect the new
method for applying config.

This commit also removes the configuration for the AWS cluster and
references to AWS in the README.
2019-11-08 14:28:45 -05:00