Skip to content

StateArchivesOfNorthCarolina/ratom-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

ratom-deploy

Configure a Kubernetes cluster for the RATOM project.

Setup

Install Python and Ansible requirements:

pip install -r requirements.txt
cd deploy/
ansible-galaxy install -f -r requirements.yaml -p roles/

Choose Hosting Provider

Cluster Access

  • Download and install kubectl (please ensure you install v1.16 or later; v1.17 is current as of January, 2020)

  • Obtain Kubernetes API credentials for the environment.

  • Verify access to the cluster:

    $ kubectl cluster-info
    Kubernetes master is running at https://...
    CoreDNS is running at https://...
    Metrics-server is running at https://...

To further debug and diagnose cluster problems, use kubectl cluster-info dump.

  • Set the namespace in your kubectl context to ratom-staging:
    kubectl config set-context --current --namespace=ratom-staging

Interacting with Pods

You can interact with running pods via kubectl, for example:

    # list running pods
    $ kubectl get pods
    NAME                       READY   STATUS    RESTARTS   AGE
    api-55c4fbb789-b8m2v       1/1     Running   0          13m
    api-55c4fbb789-zmksn       1/1     Running   0          13m
    frontend-687d4b9bf-9xcfz   1/1     Running   0          15m
    frontend-687d4b9bf-pnqkw   1/1     Running   0          15m

    # tail logs for the api
    $ kubectl logs -f -lapp=api
    # <snip>
    [pid: 15|app: 0|req: 10/14] 10.52.1.7 () {58 vars in 1375 bytes} [Fri Nov  8 11:19:57 2019] GET /admin/ratom/message/ => generated 28852 bytes in 129 msecs (HTTP/1.1 200) 10 headers in 513 bytes (1 switches on core 2)
    [pid: 14|app: 0|req: 5/15] 10.52.1.7 () {60 vars in 1271 bytes} [Fri Nov  8 11:20:32 2019] POST /graphql => generated 240 bytes in 30 msecs (HTTP/1.1 200) 8 headers in 400 bytes (1 switches on core 1)

    # start a shell in a pod, where you can run management commands, etc.
    $ kubectl exec -it api-55c4fbb789-b8m2v bash
    root@api-55c4fbb789-b8m2v:/code#

    # copy a file to a pod
    $ kubectl cp /path/to/source api-55c4fbb789-b8m2v:/path/to/dest

Update Python requirements

If requirements.in is updated, run:

pip-compile --upgrade requirements.in
pip-sync requirements.txt

License(s)

Logos, documentation, and other non-software products of the RATOM team are distributed under the terms of Creative Commons 4.0 Attribution. Software developed for the RATOM project is distributed under the terms of the MIT License. See the LICENSE file for additional details.

© 2020, The University of North Carolina at Chapel Hill.

Development Team

Developed by Caktus Group for the Review, Appraisal, and Triage of Mail (RATOM) project.

See https://ratom.web.unc.edu for RATOM project details, staff bios, and news.

About

Deployment for the RATOM project

Topics

Resources

License

Stars

4 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors