Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDST-681: Update devops docs #58

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The file tree below show the files which will be used to manage sites:
│   │   ├── ingress.yaml -> ../shared/ingress.yaml
│   │   ├── saml.yaml
│   │   └── values.yaml
│   ├── extras.yaml
│   ├── memcache
│   │   └── affinity.yaml -> ../shared/affinity.yaml
│   ├── postgres
Expand Down Expand Up @@ -75,6 +76,9 @@ script creates a list of services to run against from the `$ns/charts.yaml`
file. The file contains an object called `charts` where the keys are the
service/installation name and the values contains a helm chart reference.

It will also create kubernetes resources found in the file `$ns/extras.yaml`.
Any additional resources required by the site can be defined there.

For example, running `update-all.sh dc` will install all the services for the
dc site declared in the file `dc/charts.yaml`

Expand Down Expand Up @@ -125,6 +129,24 @@ multiple services. These files are stored in `$ns/shared`

Below will contain explanations of the required configurations.

#### extras.yaml

`$siteName/extras.yaml` is not a helm configuration file but extra resources
that will be created for the site. Currently it only contains the sites
namespace. The name of the namespace and the `dgicloud.com/drupal.site` label
must be updated to match the site name.

Ex:
```yaml
---
apiVersion: v1
kind: Namespace
metadata:
labels:
dgicloud.com/drupal.site: oc
name: oc
```

#### Shared

The configurations in this directory are used by multiple services by being
Expand Down Expand Up @@ -312,6 +334,7 @@ installed.

- [ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
- [python boto 3](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#installation)
- botocore `pip install botocore`
- [aws cli](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

Your workstation must also be configured to access the containerprod account
Expand Down Expand Up @@ -352,6 +375,8 @@ beln-arca-dc.dc.sfu.ca | SUCCESS => {
}
```

If running ansible from a mac run `export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES` before running the playbook.

To provision the node with Ansible run replacing the hostname with that of the
new node:

Expand Down
11 changes: 11 additions & 0 deletions docs/resources/devops_scripts/update-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ SCRIPTS_DIR="$(dirname -- "${BASH_SOURCE[0]}")"

namespace=${1?"A namespace is required"}

echo Checking if extra manifests need updates.
if ! kubectl diff -n $namespace -f $namespace/extras.yaml; then
echo Updates to the extra kubernetes manifests are avilable or kubectl diff failed to run.
read -p "Apply Updates (y/n)?" choice
case "$choice" in
y|Y ) kubectl apply -n $namespace -f $namespace/extras.yaml;;
n|N ) ;;
* ) echo "invalid"; exit 1;;
esac
fi

charts_file=$namespace/charts.yaml
if [ ! -f $charts_file ]; then
echo Charts file $charts_file does not exist
Expand Down
Loading