Skip to content

Commit

Permalink
build: add k8s validation workflow (#91)
Browse files Browse the repository at this point in the history
* fix: correct template tags

* build: add k8s validation workflow

* chore: add minio test case
  • Loading branch information
Cristhian Garcia authored May 3, 2024
1 parent dfbbef4 commit acbfec8
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/environments/disabled/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
DRYDOCK_INIT_JOBS: true
K8S_NAMESPACE: testing-openedx
PLUGINS:
- forum
- mfe
- drydock
DRYDOCK_BYPASS_CADDY: false
DRYDOCK_FLOWER: false
DRYDOCK_INGRESS: false
DRYDOCK_DEBUG: false
DRYDOCK_ENABLE_CELERY_TUNING: false
DRYDOCK_ENABLE_MULTITENANCY: false
DRYDOCK_ENABLE_SCORM: false
DRYDOCK_ENABLE_SENTRY: false
DRYDOCK_POD_LIFECYCLE: false
DRYDOCK_AUTO_TLS: false
DRYDOCK_NEWRELIC_LICENSE_KEY: ""
DRYDOCK_INGRESS_LMS_EXTRA_HOSTS: []
DRYDOCK_INGRESS_EXTRA_HOSTS: []
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_MFE: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_FORUM: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CADDY: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS_WORKER: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS: 0
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS_WORKER: 0
32 changes: 32 additions & 0 deletions .github/environments/enabled/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DRYDOCK_INIT_JOBS: true
K8S_NAMESPACE: testing-openedx
PLUGINS:
- forum
- mfe
- drydock
- s3
DRYDOCK_BYPASS_CADDY: true
DRYDOCK_FLOWER: true
DRYDOCK_INGRESS: true
DRYDOCK_DEBUG: true
DRYDOCK_ENABLE_CELERY_TUNING: true
DRYDOCK_ENABLE_MULTITENANCY: true
DRYDOCK_ENABLE_SCORM: true
DRYDOCK_ENABLE_SENTRY: true
DRYDOCK_POD_LIFECYCLE: true
DRYDOCK_AUTO_TLS: true
DRYDOCK_NEWRELIC_LICENSE_KEY: "your_newrelic_license_key"
DRYDOCK_INGRESS_LMS_EXTRA_HOSTS:
- "lms1.testing.example.com"
- "lms2.testing.example.com"
DRYDOCK_INGRESS_EXTRA_HOSTS:
- "superset.testing.example.com"
- "forum.testing.example.com"
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_MFE: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_FORUM: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CADDY: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS_WORKER: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS: 50
DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS_WORKER: 50
DRYDOCK_MIGRATE_FROM: 13
15 changes: 15 additions & 0 deletions .github/environments/minio_enabled/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
DRYDOCK_INIT_JOBS: true
K8S_NAMESPACE: testing-openedx
PLUGINS:
- mfe
- drydock
- minio
DRYDOCK_BYPASS_CADDY: true
DRYDOCK_INGRESS: true
DRYDOCK_ENABLE_SCORM: true
DRYDOCK_INGRESS_LMS_EXTRA_HOSTS:
- "lms1.testing.example.com"
- "lms2.testing.example.com"
DRYDOCK_INGRESS_EXTRA_HOSTS:
- "superset.testing.example.com"
- "forum.testing.example.com"
3 changes: 3 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tutor[full]<18
setuptools
git+https://github.com/hastexo/tutor-contrib-s3@v1.4.0
47 changes: 47 additions & 0 deletions .github/workflows/kubeconform-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Kubeconform Validation

on:
pull_request:

jobs:
load-environments:
name: Load environments
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(ls .github/environments/ | jq -R -s -c 'split("\n")[:-1]')"
validation:
needs: load-environments
strategy:
matrix:
environment: ${{fromJson(needs.load-environments.outputs.matrix)}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup Tutor environment
run: |
echo "TUTOR_ROOT=$GITHUB_WORKSPACE/.github/environments/${{ matrix.environment }}" >> $GITHUB_ENV
echo "TUTOR_PLUGINS_ROOT=$TUTOR_ROOT/plugins" >> $GITHUB_ENV
- name: Install python reqs
run: |
pip install -r .github/requirements.txt
pip install -e .
- name: Tutor config save
run: tutor config save
- name: Install Kubernetes tools
uses: alexellis/arkade-get@master
with:
kubectl: latest
kustomize: latest
kubeconform: latest
- name: Check k8s manifests
run: |
kustomize build $TUTOR_ROOT/env | kubeconform -strict -ignore-missing-schemas -kubernetes-version latest
1 change: 1 addition & 0 deletions drydock/patches/caddyfile-cms
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ route @scorm_matcher {
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com
}
}
{% endif %}
1 change: 1 addition & 0 deletions drydock/patches/caddyfile-lms
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ route @scorm_matcher {
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com
}
}
{% endif %}

0 comments on commit acbfec8

Please sign in to comment.