Skip to content

Commit 4c70898

Browse files
authored
Merge pull request #87 from StackStorm/feature/st2packs-imagePullSecret
Add an option to pull custom st2pack image from private Docker repos
2 parents d0cfc69 + 172b55c commit 4c70898

File tree

6 files changed

+36
-6
lines changed

6 files changed

+36
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## In Development
44

5+
## v0.22.0
6+
* Add an option to pull custom st2packs image from private Docker repository (#87)
7+
58
## v0.21.0
69
* Change etcd dependency from incubator/etcd to stable/etcd-operator (#81)
710

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
# Update StackStorm version here to rely on other Docker images tags
33
appVersion: 3.2dev
44
name: stackstorm-ha
5-
version: 0.21.0
5+
version: 0.22.0
66
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
77
home: https://stackstorm.com/#product
88
icon: https://avatars1.githubusercontent.com/u/4969009

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ To deploy the image to the registry, execute:
231231
docker push ${DOCKER_REGISTRY}/st2packs:latest
232232
```
233233

234+
### Pull st2packs from a private Docker registry
235+
If you need to pull your packs Docker image from a private registry, you need to create a Kubernetes Docker registry secret and pass it to helm.
236+
See [K8s documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) for more info.
237+
```
238+
# Create a Docker registry secret called 'st2packs-auth'
239+
kubectl create secret docker-registry st2packs-auth --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-password>
240+
```
241+
242+
Once secret created, you pass its name to helm value: `st2.packs.image.pullSecret`.
243+
234244
### How to provide custom pack configs
235245
Update the `pack.configs` section of `stackstorm-ha/values.yaml`:
236246

templates/deployments.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,13 @@ spec:
141141
annotations:
142142
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
143143
spec:
144-
{{- if .Values.enterprise.enabled }}
145144
imagePullSecrets:
145+
{{- if .Values.enterprise.enabled }}
146146
- name: {{ .Release.Name }}-st2-license
147147
{{- end }}
148+
{{- if .Values.st2.packs.image.pullSecret }}
149+
- name: {{ .Values.st2.packs.image.pullSecret }}
150+
{{- end }}
148151
{{- if .Values.st2.packs.image.repository }}
149152
initContainers:
150153
# Merge packs and virtualenvs from st2api with those from the st2.packs image
@@ -802,10 +805,13 @@ spec:
802805
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") $ | sha256sum }}
803806
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") $ | sha256sum }}
804807
spec:
805-
{{- if $.Values.enterprise.enabled }}
806808
imagePullSecrets:
809+
{{- if $.Values.enterprise.enabled }}
807810
- name: {{ $.Release.Name }}-st2-license
808811
{{- end }}
812+
{{- if $.Values.st2.packs.image.pullSecret }}
813+
- name: {{ $.Values.st2.packs.image.pullSecret }}
814+
{{- end }}
809815
{{- if $.Values.st2.packs.image.repository }}
810816
initContainers:
811817
# Merge packs and virtualenvs from st2sensorcontainer with those from the st2.packs image
@@ -941,10 +947,13 @@ spec:
941947
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
942948
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
943949
spec:
944-
{{- if .Values.enterprise.enabled }}
945950
imagePullSecrets:
951+
{{- if .Values.enterprise.enabled }}
946952
- name: {{ .Release.Name }}-st2-license
947953
{{- end }}
954+
{{- if .Values.st2.packs.image.pullSecret }}
955+
- name: {{ .Values.st2.packs.image.pullSecret }}
956+
{{- end }}
948957
{{- if .Values.st2.packs.image.repository }}
949958
initContainers:
950959
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image
@@ -1152,10 +1161,13 @@ spec:
11521161
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
11531162
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
11541163
spec:
1155-
{{- if .Values.enterprise.enabled }}
11561164
imagePullSecrets:
1165+
{{- if .Values.enterprise.enabled }}
11571166
- name: {{ .Release.Name }}-st2-license
11581167
{{- end }}
1168+
{{- if .Values.st2.packs.image.pullSecret }}
1169+
- name: {{ .Values.st2.packs.image.pullSecret }}
1170+
{{- end }}
11591171
initContainers:
11601172
{{- if .Values.st2.packs.image.repository }}
11611173
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image

templates/jobs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,13 @@ spec:
317317
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
318318
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") . | sha256sum }}
319319
spec:
320-
{{- if .Values.enterprise.enabled }}
321320
imagePullSecrets:
321+
{{- if .Values.enterprise.enabled }}
322322
- name: {{ .Release.Name }}-st2-license
323323
{{- end }}
324+
{{- if .Values.st2.packs.image.pullSecret }}
325+
- name: {{ .Values.st2.packs.image.pullSecret }}
326+
{{- end }}
324327
{{- if .Values.st2.packs.image.repository }}
325328
initContainers:
326329
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image

values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ st2:
8585
name: st2packs
8686
tag: latest
8787
pullPolicy: Always
88+
# Optional name of the imagePullSecret if your custom packs image is hosted by a private Docker registry behind the auth
89+
#pullSecret: st2packs-auth
8890

8991
# https://docs.stackstorm.com/reference/ha.html#st2sensorcontainer
9092
# It is possible to run st2sensorcontainer in HA mode by running one process on each compute instance.

0 commit comments

Comments
 (0)