Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: StackStorm/stackstorm-k8s
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.0
Choose a base ref
...
head repository: StackStorm/stackstorm-k8s
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 10,828 additions and 1,629 deletions.
  1. +73 −49 .circleci/config.yml
  2. +4 −0 .github/FUNDING.yml
  3. +68 −0 .github/workflows/e2e.yaml
  4. +71 −0 .github/workflows/lint.yaml
  5. +47 −0 .github/workflows/unit.yaml
  6. +8 −0 .kubeconform
  7. +215 −2 CHANGELOG.md
  8. +32 −14 Chart.yaml
  9. +201 −0 LICENSE
  10. +203 −63 README.md
  11. +13 −0 conf/datastore_crypto_key.yaml
  12. +35 −0 conf/rabbit-definition.conf
  13. +146 −0 migrations/v1.0/standardize-labels.sh
  14. +0 −23 requirements.yaml
  15. +29 −20 templates/NOTES.txt
  16. +409 −19 templates/_helpers.tpl
  17. +12 −0 templates/configmaps_overrides.yaml
  18. +2 −9 templates/configmaps_packs.yaml
  19. +31 −0 templates/configmaps_post-start-script.yaml
  20. +21 −30 templates/configmaps_rbac.yaml
  21. +32 −16 templates/configmaps_st2-conf.yaml
  22. +4 −11 templates/configmaps_st2-urls.yaml
  23. +15 −0 templates/configmaps_st2web.yaml
  24. +1,283 −792 templates/deployments.yaml
  25. +63 −1 templates/ingress.yaml
  26. +525 −182 templates/jobs.yaml
  27. +27 −0 templates/secrets_datastore_crypto_key.yaml
  28. +16 −0 templates/secrets_rabbitmq.yaml
  29. +14 −10 templates/secrets_ssh.yaml
  30. +1 −8 templates/secrets_st2apikeys.yaml
  31. +18 −12 templates/secrets_st2auth.yaml
  32. +3 −10 templates/secrets_st2chatops.yaml
  33. +2 −9 templates/secrets_st2kv.yaml
  34. +0 −22 templates/secrets_st2license.yaml
  35. +0 −21 templates/secrets_st2web.yaml
  36. +19 −0 templates/service-account.yaml
  37. +55 −72 templates/services.yaml
  38. +8 −0 templates/tests/st2tests-configmap.yaml
  39. +68 −0 templates/tests/st2tests-pod.yaml
  40. +49 −0 tests/README.md
  41. +99 −0 tests/integration/st2tests.sh
  42. +208 −0 tests/unit/custom_annotations_test.yaml
  43. +90 −0 tests/unit/dns_test.yaml
  44. +231 −0 tests/unit/env_test.yaml
  45. +47 −0 tests/unit/extra_volumes_test.yaml
  46. +243 −0 tests/unit/image_entrypoint_test.yaml
  47. +218 −0 tests/unit/image_pull_test.yaml
  48. +560 −0 tests/unit/image_test.yaml
  49. +108 −0 tests/unit/ingress_test.yaml
  50. +391 −0 tests/unit/labels_test.yaml
  51. +155 −0 tests/unit/overrides_test.yaml
  52. +1,127 −0 tests/unit/packs_volumes_test.yaml
  53. +199 −0 tests/unit/placement_test.yaml
  54. +269 −0 tests/unit/post_start_script_test.yaml
  55. +129 −0 tests/unit/resources_test.yaml
  56. +224 −0 tests/unit/secrets_test.yaml
  57. +451 −0 tests/unit/security_context_test.yaml
  58. +200 −0 tests/unit/service_account_test.yaml
  59. +46 −0 tests/unit/services_test.yaml
  60. +664 −0 tests/unit/st2_conf_files_test.yaml
  61. +398 −0 tests/unit/st2sensors_test.yaml
  62. +949 −234 values.yaml
122 changes: 73 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,89 @@
version: 2
version: 2.1

# Add additional CircleCI Orbs dependencies
orbs:
# https://circleci.com/orbs/registry/orb/circleci/kubernetes
kubernetes: circleci/kubernetes@1.3.1
# https://circleci.com/orbs/registry/orb/circleci/helm
helm: circleci/helm@3.0.0
# https://circleci.com/orbs/registry/orb/ccpgames/minikube
minikube: ccpgames/minikube@0.0.1

jobs:
# Run Helm Lint checks
helm-lint:
working_directory: ~/stackstorm-ha
docker:
- image: lachlanevenson/k8s-helm
# Spin up minikube K8s cluster and run Helm chart & e2e tests on it
e2e-k8s:
parameters:
kubernetes-version:
type: string
# 'large' 4 vCPUs & 15GB RAM CircleCI machine executor
# required to deploy heavy 'stackstorm-ha' Helm release with RabbitMQ, MongoDB, Redis clusters and 25+ st2 Pods.
# https://circleci.com/docs/2.0/configuration-reference/#machine-executor-linux
resource_class: large
machine:
# Available images https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
image: ubuntu-2204:current
steps:
- checkout
- kubernetes/install
- minikube/minikube-install:
# https://github.com/kubernetes/minikube/releases
version: v1.31.2
- run:
name: Prepare Helm
command: |
set -x
helm init --client-only
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
helm dependency update
name: Install Helm v3
command: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- run:
name: Helm Lint Check (Community)
command: helm lint
name: Create new K8s cluster
command: minikube start --vm-driver=docker --memory 8192 --cpus 4 --kubernetes-version=<< parameters.kubernetes-version >>
- run:
name: Helm Lint Check (Enterprise)
command: helm lint --set enterprise.enabled=true --set enterprise.license=123asd456fake
name: Update stackstorm-ha chart dependencies
command: helm dependency update
- run:
name: Helm template
command: |
mkdir -p enterprise community
helm template --output-dir community .
helm template --output-dir enterprise --set enterprise.enabled=true --set enterprise.license=123asd456fake .
- persist_to_workspace:
root: ~/stackstorm-ha/
paths:
- community
- enterprise
# TODO: Fill an issue in https://github.com/garethr/kubeval
# 'charts' contains 3rd party templates which doesn't validate against schema due to minor 'object != null' API validation issues
# See: https://circleci.com/gh/StackStorm/stackstorm-enterprise-ha/18
#- charts

# Run Kubernetes lint checks
k8s-lint:
docker:
- image: garethr/kubeval
steps:
- attach_workspace:
at: .
name: Helm install stackstorm-ha chart
command: helm install --timeout 15m0s --debug --wait --name-template stackstorm-ha .
- run:
name: K8s Kubeval Lint Check (Community)
command: kubeval $(find . -type f)
working_directory: community/stackstorm-ha/templates/
name: Helm test
command: helm test stackstorm-ha
- run:
name: K8s Kubeval Lint Check (Enterprise)
command: kubeval $(find . -type f)
working_directory: enterprise/stackstorm-ha/templates/
name: Helm upgrade with RBAC enabled
command: helm upgrade --set st2.rbac.enabled=true --timeout 5m0s --debug --wait stackstorm-ha .
- run:
name: Helm test with RBAC enabled
command: helm test stackstorm-ha
- run:
when: always
name: Show created K8s resources
command: kubectl get all

workflows:
version: 2
helm:
e2e:
jobs:
- e2e-k8s:
matrix:
parameters:
# https://kubernetes.io/releases
kubernetes-version:
- "v1.28.3"
- "v1.27.7"
- "v1.26.10"
# Run periodic nightly Helm tests to ensure there are no regressions
e2e-nightly:
jobs:
- helm-lint
- k8s-lint:
requires:
- helm-lint
- e2e-k8s:
matrix:
parameters:
# https://kubernetes.io/releases
kubernetes-version:
- "v1.28.3"
- "v1.27.7"
- "v1.26.10"
triggers:
- schedule:
cron: "0 1 * * *"
filters:
branches:
only:
- master

experimental:
notify:
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://stackstorm.com/2020/06/12/sponsoring-stackstorm/
# FAQ: https://stackstorm.com/donate/
# Expenses: https://github.com/StackStorm/discussions/issues/36
community_bridge: stackstorm
68 changes: 68 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: E2E Tests

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- master
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

jobs:
k3s:
name: "k3s (experimental)"
runs-on: ubuntu-22.04
# NOTE: Just a thought in case the timeouts fail; might not be
# necessary, but might not hurt either, would vary based on the
# size of the testing matrix, too.
timeout-minutes: 30
strategy:
fail-fast: false
max-parallel: 1
matrix:
# TODO: Document which versions we support and cover them.
# https://github.com/StackStorm/stackstorm-k8s/issues/342
# https://github.com/k3s-io/k3s/releases
k3s-channel:
- "v1.28.3+k3s1"
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up K3s
id: k3s
uses: jupyterhub/action-k3s-helm@v3
with:
k3s-channel: ${{ matrix.k3s-channel }}

- name: Update stackstorm-ha chart dependencies
run: |
set -x
helm dependency update
- name: Helm install
run: |
helm install --timeout 15m0s --debug --wait \
--name-template stackstorm-ha .
- name: Helm test
run: |
helm test stackstorm-ha
- name: Helm upgrade with RBAC enabled
run: |
helm upgrade --set st2.rbac.enabled=true \
--timeout 10m0s --debug --wait stackstorm-ha .
- name: Helm test
run: |
helm test stackstorm-ha
- name: Show all Kubernetes resources
if: ${{ always() }}
run: |
kubectl get all
71 changes: 71 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Lint

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- master
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

jobs:
helm-lint:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Update stackstorm-ha chart dependencies
run: |
set -x
helm dependency update
- name: Helm lint
run: |
helm lint
- name: Cache community
id: cache-community
uses: actions/cache@v3
with:
path: community
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}

- name: Helm template
if: steps.cache-community.outputs.cache-hit != 'true'
shell: bash
run: |
helm template --output-dir community .
k8s-lint:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: [helm-lint]
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install kubeconform-helm
run: |
helm plugin install https://github.com/jtyr/kubeconform-helm --version v0.1.17
- name: Update stackstorm-ha chart dependencies
run: |
set -x
helm dependency update
- name: Cache community
id: cache-community
uses: actions/cache@v3
with:
path: community
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}

- name: Kubernetes kubeconform-helm Lint
run: |
helm kubeconform .
47 changes: 47 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unit Tests

on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

jobs:
helm-unittest:
runs-on: ubuntu-22.04
# strategy:
# matrix:
# Relevant tools installed by default on ubuntu 20.04:
# - helm 3.8.0
# - jq 1.6
# - kind 0.11.1
# - kubectl 1.23.3
# - minikube 1.25.1
# - python 3.8.10
# - yamllint 1.26.3
# - yq 4.19.1
# see: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md

steps:
- uses: actions/checkout@v2

- name: Install helm-unittest
# We should periodically check to see if another fork has taken over maintenance,
# as the de-facto "best" fork has changed several times over the years.
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v0.5.1
- name: Install chart dependencies
run: |
helm dependency update
- name: Run helm-unittest
# by default looks for tests/*_test.yaml
run: |
helm unittest --color -f 'tests/unit/*_test.yaml' .
8 changes: 8 additions & 0 deletions .kubeconform
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Command line options that can be set multiple times can be defined as an array
schema-location:
- default
- https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json
# Command line options that can be specified without a value must have boolean
# value in the config file
summary: true
verbose: true
Loading