Skip to content

Commit 389a5f2

Browse files
authored
Merge branch 'master' into add/ingress
2 parents 81f2674 + dff8360 commit 389a5f2

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

.circleci/config.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
version: 2
1+
version: 2.1
2+
3+
# Add additional CircleCI Orbs dependencies
4+
orbs:
5+
# https://circleci.com/orbs/registry/orb/circleci/kubernetes
6+
kube: circleci/[email protected]
7+
# https://circleci.com/orbs/registry/orb/circleci/helm
8+
helm: circleci/[email protected]
9+
210
jobs:
311
# Run Helm Lint checks
412
helm-lint:
@@ -52,6 +60,48 @@ jobs:
5260
command: kubeval $(find . -type f)
5361
working_directory: enterprise/stackstorm-ha/templates/
5462

63+
# Spin up lightweight K8s cluster with 'KIND' and run Helm chart & e2e tests on it
64+
helm-e2e:
65+
machine:
66+
# Available images https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
67+
image: ubuntu-1604:201903-01
68+
steps:
69+
- checkout
70+
- kube/install
71+
- helm/install-helm-client
72+
- run:
73+
name: Apply workaround for rabbitmq-ha chart DNS issue
74+
command: |
75+
# busybox image used in rabbitmq-ha chart timeouts on DNS resolution
76+
# multiple 'search' domains in resolv.conf makes it even worse
77+
# https://github.com/kubernetes/kubernetes/issues/66924
78+
sudo sed -i '/^search/ d' /etc/resolv.conf
79+
- run:
80+
name: Install K8s in Docker (KinD)
81+
command: sudo wget -O /usr/local/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.3.0/kind-linux-amd64 && sudo chmod +x /usr/local/bin/kind
82+
- run:
83+
name: Create new K8s cluster
84+
command: |
85+
kind create cluster
86+
echo 'export KUBECONFIG="$(kind get kubeconfig-path)"' >> $BASH_ENV
87+
- helm/install-helm-on-cluster:
88+
enable-cluster-wide-admin-access: true
89+
- run:
90+
name: Update Helm repo dependencies
91+
command: |
92+
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
93+
helm dependency update
94+
- run:
95+
name: Helm install stackstorm-ha chart
96+
command: |
97+
# disable mongodb-ha chart persistent volumes as cluster can't start in CircleCI/KinD env
98+
helm install --debug --name stackstorm-ha . \
99+
--set mongodb-ha.persistentVolume.enabled=false
100+
- run:
101+
when: always
102+
name: Show created K8s resources
103+
command: kubectl get all
104+
55105
workflows:
56106
version: 2
57107
helm:
@@ -60,6 +110,10 @@ workflows:
60110
- k8s-lint:
61111
requires:
62112
- helm-lint
113+
- helm-e2e:
114+
requires:
115+
- helm-lint
116+
- k8s-lint
63117

64118
experimental:
65119
notify:

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ It's more than welcome to fine-tune each component settings to fit specific avai
1919
2020
2) Pull 3rd party Helm dependencies:
2121
```
22+
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
2223
helm dependency update
2324
```
2425

@@ -253,3 +254,15 @@ Grab all logs only for stackstorm backend services, excluding st2web and DB/MQ/e
253254
```
254255
kubectl logs -l release=<release-name>,tier=backend
255256
```
257+
258+
## Extending this chart
259+
If you have any suggestions or ideas about how to extend this chart functionality,
260+
we welcome you to collaborate in [Issues](https://github.com/stackstorm/stackstorm-ha/issues)
261+
and contribute via [Pull Requests](https://github.com/stackstorm/stackstorm-ha/pulls).
262+
However if you need something very custom and specific to your infra that doesn't fit official chart plans,
263+
we strongly recommend you to create a parent Helm chart with custom K8s objects and referencing `stackstorm-ha` chart
264+
as a child dependency.
265+
This approach allows not only extending sub-chart with custom objects and templates within the same deployment,
266+
but also adds flexibility to include many sub-chart dependencies and pin versions as well as include all the sub-chart values in one single place.
267+
This approach is infra-as-code friendly and more reproducible. See official Helm documentation about
268+
[Subcharts](https://helm.sh/docs/chart_template_guide/#subcharts-and-global-values) and [Dependencies](https://helm.sh/docs/developing_charts/#managing-dependencies-manually-via-the-charts-directory).

0 commit comments

Comments
 (0)