Compare commits

...

431 Commits

Author SHA1 Message Date
stakater-user
b73b04d9ae [skip-ci] Update artifacts 2024-06-21 13:50:22 +00:00
Kunj Bosamia
2e68364298 [ENHANCE] #639 , Add resources to the Reloader deployment. (#692)
* issue-639 , adding Resources to the values.yaml

* revert old change

* adding resources in helm template command

* add resources to  reloader.yaml file only

* Update readme about the default resource limit and request values

* fix lint error

* fix lint error
2024-06-21 19:15:24 +05:30
Bharath Nallapeta
0ab949f781 Merge pull request #696 from stakater/renovate/stakater-vale-package-0.x
chore(deps): update dependency stakater/vale-package to v0.0.27
2024-06-21 13:34:33 +05:30
renovate[bot]
e718be07c2 chore(deps): update dependency stakater/vale-package to v0.0.27 2024-06-19 09:51:03 +00:00
stakater-user
fb9748eae7 [skip-ci] Update artifacts 2024-06-19 09:50:00 +00:00
Bharath Nallapeta
d571ebec0c Merge pull request #688 from stakater/renovate/github.com-argoproj-argo-rollouts-1.x
fix(deps): update module github.com/argoproj/argo-rollouts to v1.7.0
2024-06-19 15:15:55 +05:30
renovate[bot]
1e285cbc11 fix(deps): update module github.com/argoproj/argo-rollouts to v1.7.0 2024-06-19 08:14:30 +00:00
Bharath Nallapeta
b557e68d16 Merge pull request #689 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.82
2024-06-19 13:42:58 +05:30
renovate[bot]
757f76c739 chore(deps): update stakater/.github action to v0.0.82 2024-06-19 08:03:50 +00:00
Bharath Nallapeta
0a3a01a859 Merge pull request #691 from stakater/renovate/github.com-spf13-cobra-1.x
fix(deps): update module github.com/spf13/cobra to v1.8.1
2024-06-19 13:32:32 +05:30
renovate[bot]
3848e031c2 fix(deps): update module github.com/spf13/cobra to v1.8.1 2024-06-15 00:04:07 +00:00
stakater-user
8595b4ac43 [skip-ci] Update artifacts 2024-06-11 14:13:20 +00:00
Muneeb Aijaz
aa1e2655bf Merge pull request #679 from IdanAdar/patch-1
Update .goreleaser.yml with support for IBM Power/ppc64le architecture
2024-06-11 19:08:31 +05:00
renovate[bot]
21711b347a chore(deps): update dependency stakater/vale-package to v0.0.25 (#680)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-11 15:51:42 +02:00
Muneeb Aijaz
24d7b6b584 Merge pull request #682 from stakater/update-releaser
Update goreleaser with --clean flag
2024-06-11 18:43:59 +05:00
Muneeb Aijaz
4bbbbc26ea Update goreleaser with --clean flag 2024-06-11 18:38:34 +05:00
Idan Adar
c40632f11c Update .goreleaser.yml 2024-06-05 15:13:42 +03:00
stakater-user
1e752f5e3d [skip-ci] Update artifacts 2024-06-05 09:12:19 +00:00
Muneeb Aijaz
e8fdf56406 Merge pull request #677 from onedr0p/patch-1
chore: delete yq binary from repo
2024-06-05 13:08:57 +05:00
Devin Buhl
c3e40f2f34 Update .gitignore 2024-06-03 17:05:05 -04:00
Devin Buhl
d7a3d4ca7e chore: delete yq
Not sure why the yq binary is in this repo?
2024-06-03 17:02:48 -04:00
stakater-user
6f46ebc9ee [skip-ci] Update artifacts 2024-06-03 20:01:24 +00:00
Muneeb Aijaz
c71ce83b93 Merge pull request #673 from plotly/bump-go
bump go from 1.21.6 -> 1.21.9
2024-06-04 00:56:54 +05:00
stakater-user
ec2f2e8f0a [skip-ci] Update artifacts 2024-06-03 11:06:36 +00:00
renovate[bot]
e8a5b84603 chore(deps): update stakater/.github action to v0.0.79 (#674)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-03 13:02:06 +02:00
renovate[bot]
b1ee068b89 chore(deps): update nginxinc/nginx-unprivileged docker tag to v1.27 (#676)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-03 13:01:44 +02:00
Antoine Roy-Gobeil
7b088bed23 bump go from 1.21.6 -> 1.21.9 2024-05-30 17:36:17 -04:00
stakater-user
f682a69322 [skip-ci] Update artifacts 2024-05-30 17:58:13 +00:00
Muneeb Aijaz
5dea8d2afb Merge pull request #672 from plotly/go_modules/golang.org/x/net-0.25.0
Bump golang.org/x/net from 0.20.0 to 0.25.0
2024-05-30 22:53:43 +05:00
Antoine Roy-Gobeil
2c4a6d5e8b go mod tidy 2024-05-30 12:44:36 -04:00
Antoine Roy-Gobeil
8323a35609 Bump golang.org/x/net from 0.20.0 to 0.25.0 2024-05-30 12:22:56 -04:00
renovate[bot]
81199fdeb5 chore(deps): update stakater/.github action to v0.0.77 (#670)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-30 09:19:09 +02:00
Muneeb Aijaz
f8ac8b949a Merge pull request #669 from stakater/renovate/stakater-vale-package-0.x
chore(deps): update dependency stakater/vale-package to v0.0.24
2024-05-30 11:58:10 +05:00
renovate[bot]
c9ea89480c chore(deps): update dependency stakater/vale-package to v0.0.24 2024-05-29 09:29:20 +00:00
renovate[bot]
667322ea29 chore(deps): update dependency stakater/vale-package to v0.0.23 (#668)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-29 10:14:33 +02:00
renovate[bot]
26faea70cc chore(deps): update dependency stakater/vale-package to v0.0.21 (#666)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-28 13:22:34 +02:00
renovate[bot]
df92a3a3dc chore(deps): update stakater/.github action to v0.0.76 (#667)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-28 11:09:47 +02:00
stakater-user
c53ed24c2c [skip-ci] Update artifacts 2024-05-15 09:04:42 +00:00
Muhammad Sheryar Butt
c76234d9f3 Merge pull request #660 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.75
2024-05-15 13:59:59 +05:00
renovate[bot]
2e5e5b41eb chore(deps): update stakater/.github action to v0.0.75 2024-05-15 08:52:26 +00:00
stakater-user
195b129cdd [skip-ci] Update artifacts 2024-05-15 08:51:29 +00:00
Muhammad Sheryar Butt
bad7ad33a3 Merge pull request #661 from stakater/renovate/github.com-prometheus-client_golang-1.x
fix(deps): update module github.com/prometheus/client_golang to v1.19.1
2024-05-15 13:30:41 +05:00
renovate[bot]
5da570abb8 fix(deps): update module github.com/prometheus/client_golang to v1.19.1 2024-05-10 07:14:06 +00:00
stakater-user
a8710c8132 [skip-ci] Update artifacts 2024-05-10 07:12:50 +00:00
Muneeb Aijaz
6da76a7a7e Merge pull request #662 from miguel-cardoso-mindera/master
Change git submodule url from ssh to https
2024-05-10 12:08:17 +05:00
miguel-cardoso-mindera
335467843b Change git submodule url from ssh to https 2024-05-09 22:12:59 +01:00
renovate[bot]
adb519b4c7 chore(deps): update dependency stakater/vale-package to v0.0.19 (#654)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-08 10:17:08 +02:00
stakater-user
6c5e46c776 [skip-ci] Update artifacts 2024-04-28 17:48:33 +00:00
renovate[bot]
4e909e5df2 fix(deps): update k8s.io/utils digest to 0849a56 (#573)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-28 19:08:24 +02:00
Karl Johan Grahn
63627bb7f3 update (#653) 2024-04-28 00:43:06 +02:00
stakater-user
906e622ce0 [skip-ci] Update artifacts 2024-04-27 21:25:21 +00:00
Karl Johan Grahn
30c0f5be0b Workflow updates for paths (#651)
* update

* update
2024-04-27 23:06:00 +02:00
stakater-user
d4b7d384ed [skip-ci] Update artifacts 2024-04-27 19:34:19 +00:00
Karl Johan Grahn
da9e526185 update (#650) 2024-04-27 21:15:15 +02:00
stakater-user
9a9fee2d10 [skip-ci] Update artifacts 2024-04-26 20:46:35 +00:00
renovate[bot]
c82dd8b730 chore(deps): update anothrnick/github-tag-action action to v1.69.0 (#635)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 22:05:04 +02:00
stakater-user
0838acdb02 [skip-ci] Update artifacts 2024-04-26 17:12:43 +00:00
renovate[bot]
db927a2ff2 chore(deps): update stakater/.github action to v0.0.73 (#648)
* chore(deps): update stakater/.github action to v0.0.73

* update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Karl Johan Grahn <karl.johan@stakater.com>
2024-04-26 18:52:53 +02:00
stakater-user
5b602f68c3 [skip-ci] Update artifacts 2024-04-26 15:59:32 +00:00
renovate[bot]
95d2173a80 chore(deps): update golangci/golangci-lint-action action to v5 (#642)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 17:39:56 +02:00
Karl Johan Grahn
e383fb2fed update (#647) 2024-04-26 17:08:13 +02:00
renovate[bot]
51d63c786e chore(deps): update dependency stakater/vale-package to v0.0.18 (#645)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 16:51:02 +02:00
renovate[bot]
481725b1c8 chore(deps): update nginxinc/nginx-unprivileged docker tag to v1.26 (#646)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 16:50:26 +02:00
stakater-user
70eafce2c1 [skip-ci] Update artifacts 2024-04-26 13:00:49 +00:00
Karl Johan Grahn
f0c3b61f56 Docs restructuring (#644)
* update

* update

* update
2024-04-26 14:55:15 +02:00
renovate[bot]
7cde0e7985 chore(deps): update stakater/.github action to v0.0.71 (#634)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Karl Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com>
2024-04-26 13:44:04 +02:00
stakater-user
768f7196b7 [skip-ci] Update artifacts 2024-04-26 11:38:11 +00:00
renovate[bot]
222a9fd42f chore(deps): update dependency stakater/vale-package to v0.0.17 (#637)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 13:33:31 +02:00
Karl Johan Grahn
467a2e6229 update (#643) 2024-04-25 21:23:35 +02:00
stakater-user
226f1159dc [skip-ci] Update artifacts 2024-04-24 09:50:08 +00:00
Muneeb Aijaz
24bb264c5a Merge pull request #641 from testwill/close_body
fix: close resp body
2024-04-24 14:44:28 +05:00
Muneeb Aijaz
038c923636 Merge branch 'master' into close_body 2024-04-24 14:37:49 +05:00
stakater-user
c1bc54d904 [skip-ci] Update artifacts 2024-04-24 08:22:50 +00:00
guangwu
0442c5512f fix: close resp body 2024-04-24 16:16:24 +08:00
Muneeb Aijaz
6f798c0664 Merge pull request #638 from diannaowa/loglevel
feat: supports --log-level argument  in command line
2024-04-24 13:03:33 +05:00
liuzhenwei
2094906dcb support --log-level argument in command line
Signed-off-by: liuzhenwei <dui_zhang@163.com>
2024-04-17 17:43:00 +08:00
stakater-user
de50a0e277 [skip-ci] Update artifacts 2024-04-17 08:06:06 +00:00
Muneeb Aijaz
3754fd51af Merge pull request #595 from stakater/renovate/github.com-prometheus-client_golang-1.x
fix(deps): update module github.com/prometheus/client_golang to v1.19.0
2024-04-17 13:00:48 +05:00
renovate[bot]
3bc789dde4 fix(deps): update module github.com/prometheus/client_golang to v1.19.0 2024-04-14 17:13:05 +00:00
stakater-user
9deefc7532 [skip-ci] Update artifacts 2024-04-14 17:11:38 +00:00
looklose
8510ee2ef3 chore: fix typo in comment (#633)
Signed-off-by: looklose <shishuaiqun@yeah.net>
Co-authored-by: Karl-Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com>
2024-04-10 19:37:25 +02:00
stakater-user
2d744741ba [skip-ci] Update artifacts 2024-04-10 11:26:44 +00:00
Bharath Nallapeta
7d44e9854a Merge pull request #624 from stakater/renovate/azure-setup-helm-4.x
chore(deps): update azure/setup-helm action to v4
2024-04-10 16:37:43 +05:30
renovate[bot]
c5d8dd84ad chore(deps): update azure/setup-helm action to v4 2024-04-10 10:22:35 +00:00
stakater-user
2098c9628c [skip-ci] Update artifacts 2024-04-10 10:21:02 +00:00
Bharath Nallapeta
86bec3e20f Merge pull request #615 from stakater/renovate/golangci-golangci-lint-action-4.x
chore(deps): update golangci/golangci-lint-action action to v4
2024-04-10 15:31:37 +05:30
renovate[bot]
8f458e32ac chore(deps): update golangci/golangci-lint-action action to v4 2024-04-10 13:53:12 +05:30
Bharath Nallapeta
1f64991a6d Merge pull request #632 from stakater/renovate/stakater-vale-package-0.x
chore(deps): update dependency stakater/vale-package to v0.0.15
2024-04-10 13:52:03 +05:30
renovate[bot]
b3fea5526c chore(deps): update dependency stakater/vale-package to v0.0.15 2024-04-09 15:26:45 +00:00
stakater-user
9e7fca4c29 [skip-ci] Update artifacts 2024-04-08 06:36:45 +00:00
Muneeb Aijaz
4c426817f4 Merge pull request #604 from kichel98/issue-582-auto-annotation-with-resource-type-squashed
[#582] Allow to use auto annotation with specific resource type (configmap or secret)
2024-04-08 11:17:28 +05:00
Muneeb Aijaz
1cae7a03f2 Merge branch 'master' into issue-582-auto-annotation-with-resource-type-squashed 2024-04-08 10:57:24 +05:00
stakater-user
ae5bc2cfdf [skip-ci] Update artifacts 2024-04-08 05:17:16 +00:00
Benjamin Walterscheid
fc60755558 issue/562 - enhance documentation for Reloader Chart values.yaml (#620)
* issue/562 - enhance documentation for Reloader Chart values.yaml

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - aligned unordered list indentation

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - removed leading reloader due to QA spell check issues

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - updated failing qa / spell_check README checks

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - updated failing qa / spell_check README checks

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - updated failing qa / spell_check README checks

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/562 - changed from helm to bash where needed

Signed-off-by: Benjamin Walterscheid <52604859+fdberlking@users.noreply.github.com>

---------

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>
Signed-off-by: Benjamin Walterscheid <52604859+fdberlking@users.noreply.github.com>
Co-authored-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>
Co-authored-by: Karl-Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com>
2024-04-05 08:06:02 +02:00
stakater-user
920cf8cf21 [skip-ci] Update artifacts 2024-04-03 11:43:53 +00:00
renovate[bot]
e0341720f5 chore(deps): update dependency stakater/vale-package to v0.0.14 (#623)
* chore(deps): update dependency stakater/vale-package to v0.0.14

* update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Karl Johan Grahn <karl.johan@stakater.com>
2024-04-03 13:39:16 +02:00
stakater-user
e72c25d574 [skip-ci] Update artifacts 2024-04-03 08:49:03 +00:00
Muneeb Aijaz
03ef902a6b Merge pull request #629 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.65
2024-04-03 13:07:53 +05:00
renovate[bot]
aafbea48a9 chore(deps): update stakater/.github action to v0.0.65 2024-03-27 09:10:56 +00:00
stakater-user
9385a4a70f [skip-ci] Update artifacts 2024-03-27 09:09:55 +00:00
Muneeb Aijaz
c75f0bdc34 Merge pull request #630 from joebowbeer/patch-1
fix: Add seccompProfile type to default securityContext
2024-03-27 14:05:08 +05:00
Joe Bowbeer
69565f91c0 Update values.yaml
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2024-03-21 23:40:27 -07:00
stakater-user
f8b425a366 [skip-ci] Update artifacts 2024-03-20 10:34:38 +00:00
Muneeb Aijaz
6a6307aef4 Merge pull request #625 from bnallapeta/fix-621
Add make target to remove labels and annotations from manifests
2024-03-20 15:29:55 +05:00
Bharath Nallapeta
e61547875a Merge branch 'master' into fix-621 2024-03-20 15:20:57 +05:30
stakater-user
43d7836b2a [skip-ci] Update artifacts 2024-03-20 09:43:18 +00:00
Bharath Nallapeta
ea12d91291 Merge branch 'master' into fix-621 2024-03-20 15:04:08 +05:30
Muneeb Aijaz
920c5d2f0f Merge pull request #611 from t3mi/vpa
feat(chart): add vpa support
2024-03-20 14:24:29 +05:00
bnallapeta
352f6ff230 Update deployment.yaml with reloader-reloader labels and selector 2024-03-07 11:42:55 +05:30
bnallapeta
08b02e0797 Remove labels and annotations from Kubernetes deployment.yaml 2024-03-04 17:10:30 +05:30
bnallapeta
221369bdcd Add make target to remove labels and annotations from manifests 2024-03-01 10:13:42 +05:30
Karl-Johan Grahn
3a07584fd0 Merge branch 'master' into vpa 2024-02-28 10:08:45 +01:00
Karl-Johan Grahn
b4fe7fb185 Merge branch 'master' into issue-582-auto-annotation-with-resource-type-squashed 2024-02-28 10:08:22 +01:00
stakater-user
0aa95c968a [skip-ci] Update artifacts 2024-02-23 18:20:55 +00:00
Tanveer Alam
5a25d8ae15 Merge pull request #617 from stakater/renovate/github.com-argoproj-argo-rollouts-1.x
fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.6
2024-02-21 17:20:21 +05:30
renovate[bot]
82f01d5e79 fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.6 2024-02-21 09:58:52 +00:00
Bharath Nallapeta
9a465a433c Merge pull request #605 from yangtian9999/add_helm_chart_namespace
Add namespace field to avoid helm template failure
2024-02-21 15:28:13 +05:30
yangtian9999
cca62bd458 Add namespace field to avoid helm template failure 2024-02-21 14:58:04 +05:30
Bharath Nallapeta
b28b345dad Merge pull request #612 from fdberlking/issue/587
issue/587 - [BUG] helm labels and annotations are added to k8s manifests built with kustomize
2024-02-21 14:57:29 +05:30
Bharath Nallapeta
0398d542e4 Merge branch 'master' into issue/587 2024-02-21 14:52:21 +05:30
stakater-user
36308361d2 [skip-ci] Update artifacts 2024-02-21 09:20:50 +00:00
Bharath Nallapeta
981dda6465 Merge branch 'master' into issue/587 2024-02-21 14:50:38 +05:30
Bharath Nallapeta
2cfd29d533 Merge pull request #616 from stakater/renovate/stakater-vale-package-0.x
chore(deps): update dependency stakater/vale-package to v0.0.8
2024-02-21 14:45:22 +05:30
renovate[bot]
f9bd4526ed chore(deps): update dependency stakater/vale-package to v0.0.8 2024-02-13 09:29:32 +00:00
t3mi
c69ce749fc Merge branch 'master' into vpa 2024-02-08 19:17:30 +02:00
Benjamin Walterscheid
48e2db44be Merge branch 'master' into issue/587 2024-02-07 12:40:39 +01:00
stakater-user
35cae84a60 [skip-ci] Update artifacts 2024-02-07 09:54:40 +00:00
renovate[bot]
cdd9a09edc chore(deps): update dependency stakater/vale-package to v0.0.7 (#613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-07 10:49:45 +01:00
stakater-user
c2cbca3f3c [skip-ci] Update artifacts 2024-02-07 09:39:50 +00:00
Benjamin Walterscheid
8a6395b18c Issue/600 - [BUG] Reloader don't restart pod on secret recreation (#610)
* issue/600 - removed invalid child element from Vanilla Manifest section

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/600 - correct table formats + lists

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/600 - replaced deprecated bases with resources for Kustomize resources

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/600 - enhanced parameter tables with default values + add default description for syncAfterRestart/reloadOnCreate

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

* issue/600 - reverted item change due to markdownlint-cli issues

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>

---------

Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>
Co-authored-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>
2024-02-07 10:33:55 +01:00
Benjamin Walterscheid
dbe44e173c issue/587 - removed helm labels and annotations for Kustomize builds
Signed-off-by: Benjamin Walterscheid <benjamin.walterscheid@de.ibm.com>
2024-02-05 17:11:47 +01:00
t3mi
670b67dc55 feat(chart): add vpa support
Signed-off-by: t3mi <t3mi@users.noreply.github.com>
2024-02-05 11:51:33 +00:00
stakater-user
7acf5b88c3 [skip-ci] Update artifacts 2024-01-31 17:56:50 +00:00
Muneeb Aijaz
4d20963387 Merge pull request #609 from stakater/vale-package
Switch from submodule to Vale package for spell checking
2024-01-31 22:51:32 +05:00
Karl Johan Grahn
e9b09e7a68 update 2024-01-31 10:31:13 +01:00
Karl Johan Grahn
e78e7818d1 update 2024-01-31 10:22:00 +01:00
Karl Johan Grahn
ff12c58ee4 update 2024-01-31 10:19:35 +01:00
stakater-user
223ed538ae [skip-ci] Update artifacts 2024-01-31 09:08:33 +00:00
Muneeb Aijaz
49f8b9a612 Merge pull request #607 from stakater/renovate/github.com-argoproj-argo-rollouts-1.x
fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.5
2024-01-31 14:03:25 +05:00
Piotr Andrzejewski
989053888f Add missing condition in upgrade test 2024-01-26 12:53:43 +01:00
renovate[bot]
76ee7672c7 fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.5 2024-01-25 22:42:10 +00:00
Piotr Andrzejewski
bccefb1624 [#582] Allow to use auto annotation with specific resource type (configmap or secret) 2024-01-19 14:38:36 +01:00
stakater-user
6ccf555ee6 [skip-ci] Update artifacts 2024-01-17 09:44:01 +00:00
Bharath Nallapeta
1ff03aa764 Merge pull request #601 from stakater/renovate/golang-1.x
chore(deps): update golang docker tag to v1.21.6
2024-01-17 14:55:02 +05:30
renovate[bot]
e2b6ccd8ef chore(deps): update golang docker tag to v1.21.6 2024-01-10 14:28:33 +00:00
stakater-user
b0613884f0 [skip-ci] Update artifacts 2024-01-10 14:27:38 +00:00
Sanghamitra-PERSONAL
5551280554 Enabled the option to set user assigned affinity value (#596)
* Enabled the option to set user assigned affinity value

* Fixing the space

---------

Co-authored-by: Karl-Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com>
2024-01-10 15:22:23 +01:00
stakater-user
66ac979ea2 [skip-ci] Update artifacts 2024-01-10 14:15:07 +00:00
renovate[bot]
05f432469d chore(deps): update stakater/.github action to v0.0.62 (#602)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-10 15:10:16 +01:00
renovate[bot]
c845787c81 chore(deps): update stakater/.github action to v0.0.60 (#599)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-10 10:05:09 +01:00
stakater-user
308050e680 [skip-ci] Update artifacts 2024-01-03 11:46:52 +00:00
Bharath Nallapeta
09d6051a9a Merge pull request #598 from stakater/doc-linting
Markdownlinting update
2024-01-03 17:12:10 +05:30
Karl-Johan Grahn
0a5d1329bc Merge branch 'master' into doc-linting 2024-01-03 12:20:02 +01:00
stakater-user
6766fb47a0 [skip-ci] Update artifacts 2024-01-03 11:18:30 +00:00
Karl Johan Grahn
533b5ada08 Merge branch 'master' into doc-linting 2024-01-03 12:14:09 +01:00
renovate[bot]
479a5af9fa chore(deps): update stakater/.github action to v0.0.58 (#597)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-03 12:13:16 +01:00
Karl Johan Grahn
0b970fb10d update 2024-01-03 10:36:37 +01:00
stakater-user
1124d3614d [skip-ci] Update artifacts 2023-12-27 10:24:22 +00:00
Muneeb Aijaz
f67e5fb7e1 Merge pull request #473 from damslo/feature/ms-teams-webhook
Add MS Teams support for alerting webhook
2023-12-27 15:06:04 +05:00
Muneeb Aijaz
18bc739664 Merge branch 'master' into feature/ms-teams-webhook 2023-12-27 14:47:41 +05:00
stakater-user
f83959ffc1 [skip-ci] Update artifacts 2023-12-27 09:06:46 +00:00
Muneeb Aijaz
59ebab3b68 Merge branch 'master' into feature/ms-teams-webhook 2023-12-27 14:06:30 +05:00
Muneeb Aijaz
2218db6adf Merge pull request #592 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.54
2023-12-27 14:01:21 +05:00
renovate[bot]
86cc2fb905 chore(deps): update stakater/.github action to v0.0.54 2023-12-20 17:24:15 +00:00
stakater-user
9ef084e5cc [skip-ci] Update artifacts 2023-12-20 17:23:32 +00:00
Muneeb Aijaz
cbdf9ae077 Merge pull request #581 from stakater/renovate/golang-1.x
chore(deps): update golang docker tag to v1.21.5
2023-12-20 22:18:12 +05:00
renovate[bot]
b55929b645 chore(deps): update golang docker tag to v1.21.5 2023-12-20 09:27:32 +00:00
stakater-user
e4a7faa664 [skip-ci] Update artifacts 2023-12-20 09:26:33 +00:00
Muhammad Sheryar Butt
07ef2aaa12 Merge pull request #588 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.53
2023-12-20 14:21:55 +05:00
renovate[bot]
1d98ef0bfd chore(deps): update stakater/.github action to v0.0.53 2023-12-20 09:09:54 +00:00
Muhammad Sheryar Butt
3e0cd044ce Merge pull request #580 from stakater/renovate/github.com-argoproj-argo-rollouts-1.x
fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.4
2023-12-20 14:09:08 +05:00
renovate[bot]
eaf68d427e fix(deps): update module github.com/argoproj/argo-rollouts to v1.6.4 2023-12-13 09:34:18 +00:00
stakater-user
e1f4bf83af [skip-ci] Update artifacts 2023-12-13 09:33:21 +00:00
Muneeb Aijaz
3f0c824da5 Merge pull request #544 from gilles-gosuin/allow-arbitrary-volumes
Allow for arbitrary volumes
2023-12-13 14:28:43 +05:00
Muneeb Aijaz
b0cd335854 Merge branch 'master' into allow-arbitrary-volumes 2023-12-13 14:23:34 +05:00
stakater-user
6053e13681 [skip-ci] Update artifacts 2023-12-13 09:05:46 +00:00
Muneeb Aijaz
3201143c88 Merge pull request #583 from stakater/renovate/actions-setup-go-5.x
chore(deps): update actions/setup-go action to v5
2023-12-13 14:01:12 +05:00
renovate[bot]
376693ce02 chore(deps): update actions/setup-go action to v5 2023-12-08 13:37:44 +00:00
stakater-user
da087c27e9 [skip-ci] Update artifacts 2023-12-08 13:37:02 +00:00
Muneeb Aijaz
e29ad80772 Merge pull request #585 from stakater/fix-helm
fix push.yaml
2023-12-08 18:26:25 +05:00
Muneeb Aijaz
e41d0493b6 fix push.yaml 2023-12-08 18:21:20 +05:00
Muneeb Aijaz
d43679b5e5 Attempt to fix helm push (#584)
* Attempt to fix helm push

* Attempt to fix helm push

* update lint

* fix

* fix deletion

* change linter to latest
2023-12-08 13:56:53 +01:00
Karl-Johan Grahn
45fb35519f Merge branch 'master' into allow-arbitrary-volumes 2023-12-06 10:19:52 +01:00
Muhammad Sheryar Butt
914223ad1b Merge pull request #577 from stakater/fix-push-pipeline
updates registry path
2023-11-24 12:26:01 +05:00
Muhammad Sheryar Butt
1e07408244 Merge branch 'master' into fix-push-pipeline 2023-11-24 12:20:37 +05:00
SheryarButt
1760ac890e updates registery path 2023-11-24 12:19:10 +05:00
Muhammad Sheryar Butt
ab90b9aa93 Merge pull request #576 from stakater/fix-push-pipeline
updates helm version
2023-11-24 10:59:17 +05:00
SheryarButt
d59576425f updates helm version 2023-11-24 10:53:56 +05:00
Karl-Johan Grahn
357bc356f9 Merge branch 'master' into allow-arbitrary-volumes 2023-11-22 10:26:15 +01:00
Daniel Butler
304364f45f modify tag (#571) 2023-11-22 10:25:29 +01:00
Faizan Ahmad
8dc1eb3117 Merge pull request #569 from stakater/update-go-1.21.4 2023-11-17 13:16:29 +01:00
faizanahmad055
b835e0f6f9 Update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-11-17 12:38:57 +01:00
faizanahmad055
a7e8deb5ed Update go and dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-11-15 15:42:39 +01:00
Faizan Ahmad
5f99de48ff Merge pull request #568 from bodgit/chart-enhancements
fix: Add chart parameters for setting revisionHistoryLimit
2023-11-15 15:36:37 +01:00
Matt Dainty
985b8fca3e fix: Add chart parameters for setting revisionHistoryLimit
Signed-off-by: Matt Dainty <matt@bodgit-n-scarper.com>
2023-11-15 13:20:35 +00:00
stakater-user
4575f3975a [skip-ci] Update artifacts 2023-11-08 09:16:47 +00:00
Muhammad Sheryar Butt
8169bb6a5d Merge pull request #561 from jkroepke/oci
Publish helm chart as OCI chart
2023-11-08 14:08:30 +05:00
Jan-Otto Kröpke
fe0d3cb3df Remove permissions 2023-11-01 10:35:36 +01:00
Karl-Johan Grahn
539186f231 Merge branch 'master' into allow-arbitrary-volumes 2023-11-01 10:19:20 +01:00
Karl-Johan Grahn
4619aa5951 Merge branch 'master' into oci 2023-11-01 10:16:10 +01:00
stakater-user
27d6ae6796 [skip-ci] Update artifacts 2023-10-30 11:08:14 +00:00
Bharath Nallapeta
1bcf22fdc7 Merge pull request #563 from stakater/update-dependencies
Update dependencies
2023-10-30 11:01:09 +00:00
faizanahmad055
09f15469a3 Update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-10-30 11:48:45 +01:00
faizanahmad055
92dd2abe39 Update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-10-30 11:45:07 +01:00
stakater-user
0c33b57c0d [skip-ci] Update artifacts 2023-10-30 10:35:14 +00:00
Faizan Ahmad
e0737418af Merge pull request #556 from stakater/update-reloader-dependencies
Update go, pipeline and go dependencies
2023-10-30 11:15:42 +01:00
Jan-Otto Kröpke
3875df2cbd Publish helm chart as OCI chart 2023-10-25 20:49:53 +02:00
Muneeb Aijaz
36fda7b31e Merge branch 'master' into update-reloader-dependencies 2023-10-25 19:00:00 +05:00
stakater-user
e18113ab2a [skip-ci] Update artifacts 2023-10-25 12:57:51 +00:00
Muneeb Aijaz
c400662dcc Merge pull request #532 from fheinecke/master
Added logging to diagnose CI build failures
2023-10-25 17:32:21 +05:00
Muneeb Aijaz
be0d1dc465 Merge branch 'master' into master 2023-10-25 17:06:15 +05:00
stakater-user
f1bef883a1 [skip-ci] Update artifacts 2023-10-25 09:11:36 +00:00
Muneeb Aijaz
8a1c1f3ef0 Merge pull request #560 from stakater/fix-ubi
Fix ubi push step
2023-10-25 13:55:34 +05:00
MuneebAijaz
ccde739e0d fixes for ubi 2023-10-25 13:41:59 +05:00
Muneeb Aijaz
6df09b2539 Fix ubi push step 2023-10-25 13:32:31 +05:00
Muneeb Aijaz
26a01ae4b9 Merge branch 'master' into master 2023-10-25 13:16:58 +05:00
Muneeb Aijaz
66589960fd Merge pull request #557 from daniel-butler-irl/fix-extra-whitespace
removing extra whitespace in builder image name
2023-10-24 13:59:19 +05:00
Daniel Butler
fdcdcd8770 fix gcr to ghcr 2023-10-23 14:15:35 +01:00
Daniel Butler
5535656717 include platform in from builder image 2023-10-23 10:58:33 +01:00
Daniel Butler
7568cb3841 removing linux/arm from ubi builds 2023-10-23 10:58:04 +01:00
Daniel Butler
0377381729 removing extra whitespace in builder image name 2023-10-23 09:39:20 +01:00
faizanahmad055
ec7e199ddf Update go, pipeline and go dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-10-22 19:24:40 +02:00
Muneeb Aijaz
02210be45f Merge pull request #550 from daniel-butler-irl/add_ubi
add ubi dockerfile
2023-10-20 20:53:19 +05:00
Daniel Butler
34ecb8be2c Merge branch 'master' into add_ubi 2023-10-19 15:13:48 +01:00
Daniel Butler
eb8d215cf1 update workflows to build and publish ubi images 2023-10-19 15:12:25 +01:00
stakater-user
b5ca915dd3 [skip-ci] Update artifacts 2023-10-19 13:56:31 +00:00
Muneeb Aijaz
310b26154a Merge pull request #552 from stakater/add-issue-templates
Update issue templates
2023-10-19 18:01:48 +05:00
Muhammad Sheryar Butt
e874c644cd Merge branch 'master' into add-issue-templates 2023-10-19 17:49:26 +05:00
stakater-user
6fca0d9a6b [skip-ci] Update artifacts 2023-10-19 12:33:01 +00:00
Muneeb Aijaz
32aa65875a Merge pull request #553 from PatrickSpies/feat/helm-netpol-egress
feat(helm) add egress-rule to netpol
2023-10-19 17:24:28 +05:00
Patrick Spies
cad27649f9 fix typo 2023-10-19 09:28:34 +02:00
Patrick Spies
fd52f228ab feat(helm) add egress-rule to netpol 2023-10-19 09:26:51 +02:00
Muneeb Aijaz
d6740f694d Update issue templates 2023-10-19 00:46:20 +05:00
Daniel Butler
08a774a799 add ubi dockerfile 2023-10-18 13:13:38 +01:00
stakater-user
508038a0f1 [skip-ci] Update artifacts 2023-10-18 10:11:23 +00:00
Muneeb Aijaz
2d9e0c1eb3 Merge pull request #547 from fjsnogueira/master
bumping golang.org/x/net version. Fixes #546
2023-10-18 13:31:40 +05:00
Fernando Nogueira
ae80e6dedd bumping golang.org/x/net version to v.0.17.0 to address CVE-2023-39325 and CVE-2023-44487 2023-10-14 21:27:22 -04:00
Gilles Gosuin
54f2fdb708 Allow for arbitrary volumes 2023-10-11 14:37:36 +02:00
stakater-user
6a659dede2 [skip-ci] Update artifacts 2023-10-10 17:34:53 +00:00
Muneeb Aijaz
31402aa666 Merge pull request #538 from PatrickSpies/fix/helm-rbac-cronjob
fix(helm-chart): add missing rbac for cronjob-triggering
2023-10-10 22:13:27 +05:00
PatrickSpies
651320bbc3 Merge branch 'master' into fix/helm-rbac-cronjob 2023-10-06 08:43:31 +02:00
Patrick Spies
f33b5e9ee0 fix(helm): add missing permissions to role too 2023-10-06 08:38:33 +02:00
stakater-user
cf0fa2c244 [skip-ci] Update artifacts 2023-10-06 06:30:26 +00:00
Bharath Nallapeta
20f5f54f10 Merge pull request #539 from stakater/revert-537-fix_pipeline
Revert "Modify ghcr login to use stakater token instead of user token"
2023-10-05 07:18:57 +00:00
Muneeb Aijaz
37a4e83ffb Update push.yaml 2023-10-05 12:08:12 +05:00
Muneeb Aijaz
f9d02d76ef Revert "Modify ghcr login to use stakater token instead of user token (#537)"
This reverts commit e4e4371e60.
2023-10-05 11:42:23 +05:00
Bharath Nallapeta
e4e4371e60 Modify ghcr login to use stakater token instead of user token (#537)
Co-authored-by: Karl-Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com>
2023-10-04 17:10:25 +02:00
Patrick Spies
128612c326 fix(helm-chart): add missing rbac for cronjob-triggering 2023-10-04 16:28:50 +02:00
Bharath Nallapeta
5033d67e74 Merge pull request #486 from kvandenhoute/feature/cronjob_trigger
Add cronjob support
2023-10-04 10:49:43 +00:00
stgrace
4dfd0e514e Fix comments
Signed-off-by: stgrace <stefgraces@hotmail.com>
2023-09-29 15:42:53 +02:00
Stef Graces
697923a5df Merge branch 'master' into feature/cronjob_trigger 2023-09-29 15:39:19 +02:00
Karl-Johan Grahn
1e7507e169 Merge branch 'master' into master 2023-09-27 10:25:08 +02:00
Fred Heinecke
3ca7ec7b0d Added logging to diagnose CI build failures 2023-09-20 14:04:00 -05:00
stakater-user
f436935631 [skip-ci] Update artifacts 2023-09-20 18:37:28 +00:00
Muneeb Aijaz
f98e12a62e Merge pull request #530 from utibeabasi6/master
Add webhook-url to restart service
2023-09-20 13:09:36 +05:00
Utibeabasi Umanah
451077e5c6 feat: add webhookUrl to helm chart
Signed-off-by: Utibeabasi Umanah <utibeabasiumanah6@gmail.com>
2023-09-19 22:03:28 +01:00
Utibeabasi Umanah
6dc37baf87 feat: trigger webhook on reload
Signed-off-by: Utibeabasi Umanah <utibeabasiumanah6@gmail.com>
2023-09-19 21:51:42 +01:00
stakater-user
8ac634012c [skip-ci] Update artifacts 2023-09-06 08:13:47 +00:00
renovate[bot]
e521e9e1a6 Update actions/checkout action to v4 (#515)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-06 10:07:16 +02:00
stakater-user
dfb26d789f [skip-ci] Update artifacts 2023-08-30 08:25:29 +00:00
renovate[bot]
4b8127d8b0 Update kubernetes packages to v0.28.1 (#511)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-30 10:17:01 +02:00
stakater-user
1d7fbcc2aa [skip-ci] Update artifacts 2023-08-20 17:31:21 +00:00
Faizan Ahmad
2d3aa7f5f7 Merge pull request #512 from stakater/update-go-1.21.0 2023-08-20 19:10:24 +02:00
faizanahmad055
17d0d03bc3 Merge branch 'master' of github.com:stakater/Reloader into update-go-1.21.0 2023-08-20 17:08:31 +02:00
stakater-user
d38872e057 [skip-ci] Update artifacts 2023-08-20 14:19:04 +00:00
faizanahmad055
c0383c5bbb Merge branch 'master' of github.com:stakater/Reloader into update-go-1.21.0 2023-08-20 16:00:09 +02:00
AsfaMumtaz
663fa49119 Merge pull request #487 from itaispiegel/feature/auto-reload-all
Add --auto-reload-all flag
2023-08-20 18:58:33 +05:00
faizanahmad055
38d5a99242 Update golang version to 1.21.0 and update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-08-20 15:51:57 +02:00
Karl-Johan Grahn
b2f9300cff Merge branch 'master' into feature/auto-reload-all 2023-08-13 18:29:45 +02:00
stakater-user
dbb374d35b [skip-ci] Update artifacts 2023-08-10 11:18:36 +00:00
Bharath Nallapeta
806fab55f0 Merge pull request #492 from girolamo-giordano/master
Update the README file
2023-08-10 16:41:51 +05:30
girolamo-giordano
b8ebb0a178 Update the Compatibility section fixing the kubernetes requirements from 1.9 to 1.19 2023-08-10 16:35:09 +05:30
Muneeb Aijaz
73d239fc19 Merge pull request #510 from bnallapeta/pipelines
Updated kubernetes and kind versions in GitHub Actions
2023-08-10 15:53:20 +05:00
bnallapeta
447f2d8437 Updated kubernetes and kind versions 2023-08-10 11:01:00 +05:30
Itai Spiegel
cabe0d8ba4 Fix tests 2023-08-06 17:51:02 +03:00
Itai Spiegel
b9e24b308e Fix tests according to the updated condition 2023-08-06 15:34:13 +03:00
Itai Spiegel
3e6ccd0a45 Fix upgrade condition 2023-08-06 15:34:13 +03:00
Itai Spiegel
b5fde3876d Add tests for the new feature 2023-08-06 15:34:13 +03:00
Itai Spiegel
4295b34cb1 Fix: Handle empty reloaderEnabledValue 2023-08-06 15:34:13 +03:00
Itai Spiegel
ff1946b406 Fix the reload condition 2023-08-06 15:34:13 +03:00
itaispiegel
18d8b7e353 Fix implementation to handle pod annotations 2023-08-06 15:34:13 +03:00
itaispiegel
e9942a56f4 Add --auto-reload-all flag 2023-08-06 15:34:13 +03:00
stakater-user
a99e5383d0 [skip-ci] Update artifacts 2023-08-06 07:15:48 +00:00
Faizan Ahmad
9323d10f6d Update golang dependencies (#503) 2023-08-06 09:09:10 +02:00
stakater-user
f9f41e65fc [skip-ci] Update artifacts 2023-08-02 08:25:04 +00:00
Muhammad Sheryar Butt
3bd37441ec Merge pull request #505 from stakater/renovate/golang-1.x
chore(deps): update golang docker tag to v1.20.7
2023-08-02 13:07:42 +05:00
renovate[bot]
2bc0507298 chore(deps): update golang docker tag to v1.20.7 2023-08-02 07:03:43 +00:00
stakater-user
f7de66d67f [skip-ci] Update artifacts 2023-08-02 07:02:10 +00:00
Muhammad Shahid Hussain
a74845aab2 Merge pull request #467 from PatrickSpies/feat/chart-netpol
feat: add optional networkpolicy to helm-chart
2023-08-02 11:55:31 +05:00
Karl-Johan Grahn
3e7cc40c4a Merge branch 'master' into feature/cronjob_trigger 2023-07-26 10:07:43 +02:00
Karl-Johan Grahn
b228cb4c8b Merge branch 'master' into feat/chart-netpol 2023-07-26 10:04:30 +02:00
renovate[bot]
ffe6c6577d Update stakater/.github action to v0.0.44 (#502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-26 10:04:00 +02:00
stakater-user
6df7459937 [skip-ci] Update artifacts 2023-07-21 08:07:45 +00:00
Bharath Nallapeta
f847f2ff46 Merge pull request #501 from stakater/fix_token
Updated checkout step of push action to use our token instead of the default github token
2023-07-21 13:31:36 +05:30
bnallapeta
b29fbc9ace Updated checkout step of all actions to use our token instead of the default github token 2023-07-21 13:21:12 +05:30
Bharath Nallapeta
d9e742cf7f Merge pull request #500 from stakater/remove-persist-cred
Remove persist-credentials flag in checkout step of the actions
2023-07-21 12:55:11 +05:30
Bharath Nallapeta
ad70134967 Remove persist-credentials flag in checkout step of the actions
- Setting this to false causes the GitHub action to use the PAT of the person who pushed the changes to the repo. 
- Removing this will set the value to true by default thereby persisting inbuilt github_token across all the steps including the commit step which is currently failing.
- GitHub removes this in post-run step.
2023-07-21 12:45:38 +05:30
stakater-user
18dad59d13 [skip-ci] Update artifacts 2023-07-21 07:07:53 +00:00
Bharath Nallapeta
bef48f3cff Merge pull request #460 from stakater/renovate/golang-1.x
Update golang Docker tag to v1.20.6
2023-07-21 11:49:33 +05:30
renovate[bot]
5efcc588d2 Update golang Docker tag to v1.20.6 2023-07-19 14:18:04 +00:00
Bharath Nallapeta
0bc229fad9 Merge pull request #499 from gmodzelewski/master
#491 Readme: Add OpenShift 4.13 runAsUser unset part
2023-07-19 19:46:23 +05:30
Georg Modzelewski
ef380c480a #491 Readme: Add OpenShift 4.13 runAsUser unset part 2023-07-19 11:37:01 +02:00
Muneeb Aijaz
5e7f1302e2 Merge branch 'master' into feature/cronjob_trigger 2023-07-19 13:24:53 +05:00
stakater-user
2bdb469179 [skip-ci] Update artifacts 2023-07-17 07:08:09 +00:00
Itai Spiegel
d018bbd7d3 Change pull_request trigger to pull_request_target (#498) 2023-07-17 08:46:37 +02:00
Spies, Patrick - F0217791
e9e2647e69 fix typo 2023-07-13 09:44:49 +02:00
Spies, Patrick - F0217791
b0fa2f6b36 fix: add missing new chart-yaml 2023-07-13 09:44:49 +02:00
Spies, Patrick - F0217791
c1bec21d4d fix: do not git-ignore reloader-chart 2023-07-13 09:44:49 +02:00
Spies, Patrick - F0217791
ded69baa8b feat: add optional networkpolicy to helm-chart 2023-07-13 09:44:49 +02:00
Karel Vanden Houte
465767ce01 add cronjob support 2023-06-30 14:06:03 +02:00
stakater-user
efbbe3cb59 [skip-ci] Update artifacts 2023-06-27 14:46:58 +00:00
Karl-Johan Grahn
87ecf87af6 Helm chart unit tests (#484)
* update

* update
2023-06-27 16:39:03 +02:00
stakater-user
cd4f9487f6 [skip-ci] Update artifacts 2023-06-27 14:00:34 +00:00
Karl-Johan Grahn
6fdced56d8 Update README.md (#483) 2023-06-27 13:13:17 +02:00
Karl-Johan Grahn
29310fe3ae Enterprise version and doc QA checks (#480)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update
2023-06-26 20:32:02 +02:00
Karl-Johan Grahn
845a6d85c6 Delete dependabot.yml (#475) 2023-06-12 10:55:59 +02:00
stakater-user
11fb414965 [skip-ci] Update artifacts 2023-06-08 08:11:18 +00:00
Hussnain Ahmad
6eae8353a1 Merge pull request #447 from jkroepke/patch-1
Remove v version prefix from helm chart
2023-06-08 13:03:07 +05:00
Damian Slowinski
78995cf451 update Readme 2023-06-06 16:15:39 +02:00
Damian Slowinski
daccf7e050 add Microsoft Teams webhook support 2023-06-06 15:55:01 +02:00
Damian Slowinski
330e69f417 add Microsoft Teams webhook support 2023-06-06 15:31:54 +02:00
Jan-Otto Kröpke
12f5515197 Merge branch 'master' into patch-1 2023-05-31 11:00:55 +02:00
stakater-user
306a988ace [skip-ci] Update artifacts 2023-05-31 08:19:27 +00:00
renovate[bot]
c0067a2608 Add renovate.json (#456)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-31 10:11:51 +02:00
stakater-user
93160891f5 [skip-ci] Update artifacts 2023-05-24 08:31:42 +00:00
Moulick Aggarwal
385b3c7684 Update Go setup for GitHub Actions workflows (#444) 2023-05-24 10:10:17 +02:00
Jan-Otto Kröpke
05f84acbf8 Remove v version prefix from helm chart 2023-05-11 09:20:41 +02:00
Jan-Otto Kröpke
d08b0afe0f Remove v version prefix from helm chart 2023-05-11 09:19:34 +02:00
stakater-user
b6e6c17df4 [skip-ci] Update artifacts 2023-04-27 11:58:42 +00:00
Faizan Ahmad
123cdbdf6b Merge pull request #442 from stakater/update-golang-and-dependencies
Update golang version and dependencies
2023-04-27 13:37:36 +02:00
stakater-user
b7220dac28 [skip-ci] Update artifacts 2023-04-27 10:50:23 +00:00
Hussnain Ahmad
e156cfb167 Merge pull request #443 from stakater/readme-update
Updated broken links in readme
2023-04-27 15:41:45 +05:00
hussnain612
9ff2c349af Updated broken links in readme 2023-04-27 15:10:26 +05:00
faizanahmad055
197cd078e2 Update golang version and dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-04-27 09:27:54 +02:00
stakater-user
09e8e5a4cb [skip-ci] Update artifacts 2023-04-05 07:39:25 +00:00
Muneeb Aijaz
c84cf916be Merge pull request #430 from ctrought/feat-enhancelabelselectors
feat: Configmap/secret label selector & refactor namespace selector
2023-04-05 12:20:01 +05:00
stakater-user
c3c700a7a9 [skip-ci] Update artifacts 2023-04-05 06:40:47 +00:00
Hussnain Ahmad
1bdc540700 Merge pull request #298 from karl-johan-grahn/fix-255
fix(255): push image to ghcr instead of docker hub
2023-04-05 11:32:09 +05:00
Hussnain
ddbe3036af Merge remote-tracking branch 'upstream/master' into fix-255 2023-04-05 11:19:34 +05:00
Hussnain
aab8f66b34 Updated actions dependencies 2023-04-05 11:17:26 +05:00
Hussnain
3e88e06199 Updated image path 2023-04-05 11:04:31 +05:00
Hussnain
32ab2ada09 Updated github actions to push to ghcr and dockerHub 2023-04-05 11:04:18 +05:00
stakater-user
71a2b2347a [skip-ci] Update artifacts 2023-04-05 05:55:18 +00:00
Muneeb Aijaz
ca9715b231 Merge pull request #427 from Whisper40/master
 feat: Implement topologySpreadConstraints to improve redundancy (fix #426)
2023-04-05 10:49:14 +05:00
stakater-user
32bda1a2ed [skip-ci] Update artifacts 2023-04-05 05:44:22 +00:00
Muneeb Aijaz
7f706bc130 Merge pull request #431 from Whisper40/patch-1
 feat: Implement initialDelaySeconds for readinessProbe & livenessPr…
2023-04-05 10:36:29 +05:00
Kévin PEREZ
7d08a6a28f feat: Implement initialDelaySeconds for readinessProbe & livenessProbe (fix #429)
PR respond to this feature request : https://github.com/stakater/Reloader/issues/429
2023-04-03 16:17:41 +02:00
ctrought
9ac351c219 fix: controller label selectors as string
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 16:47:54 -04:00
ctrought
24e794bb38 fix: skip controller creation for namespace in test
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 16:47:17 -04:00
ctrought
8e8ce51313 docs: update label selector usage
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 15:48:12 -04:00
ctrought
8ed0899ff3 fix: use apimachinery labelSelector parser to align with string implementation, supports != operator
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 15:38:58 -04:00
ctrought
f00448dfbd docs: cleanup labelSelector documentation
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 15:38:56 -04:00
ctrought
2b619a9243 fix: namespace list/watch permission when using namespaceSelectors
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-04-02 01:31:53 -04:00
ctrought
27c0a9b328 feat: additional labelSelector support
* add option to configure labelSelectors on configmaps & secrets
* support all labelSelectors
* label selector tests
* legacy support for ':' delimited selectors and wildcards

Signed-off-by: Craig Trought <k8s@trought.ca>
2023-03-31 19:08:10 -04:00
ctrought
e39a8f6bcf refactor: use Namespace controller for namespaceSelector
Signed-off-by: Craig Trought <k8s@trought.ca>
2023-03-31 19:08:10 -04:00
stakater-user
3907495a42 [skip-ci] Update artifacts 2023-03-30 19:19:37 +00:00
Rasheed Amir
07889755d9 fix email address (#425) 2023-03-30 21:12:57 +02:00
Kévin PEREZ
49c8f78cff Add topologySpreadConstraints 2023-03-30 09:49:49 +02:00
stakater-user
08ceb6126c [skip-ci] Update artifacts 2023-03-30 05:48:32 +00:00
dhia-gharsallaoui
4b13852de0 fix typo (#423) 2023-03-30 07:27:33 +02:00
stakater-user
197f009fc9 [skip-ci] Update artifacts 2023-03-27 06:54:41 +00:00
Faizan Ahmad
4bc71b145e Merge pull request #421 from stakater/update-go-version-and-dependencies 2023-03-27 08:32:12 +02:00
faizanahmad055
be83553487 Update go version to 1.20.2 and update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-03-25 21:45:33 +01:00
stakater-user
b193a7b94c [skip-ci] Update artifacts 2023-03-10 23:25:51 +00:00
Faizan Ahmad
ba64c8ff4d Merge pull request #412 from jstewart612/patch-1
[helm] deployment replicas int comparison fix
2023-03-11 00:19:17 +01:00
John Stewart
1c165c86da [helm] make sure comparison for deployment replicas is always doing so against an int 2023-03-10 16:31:09 -05:00
stakater-user
6498f5a536 [skip-ci] Update artifacts 2023-03-10 17:03:18 +00:00
Faizan Ahmad
7745a1ff52 Merge pull request #410 from jordanfelle/patch-1
Fixing eval for enabling HA
2023-03-10 17:54:51 +01:00
jordanfelle
a8ee7068a5 Fixing eval for enabling HA
When set to 1.0

 <gt .Values.reloader.deployment.replicas 1.0>: error calling gt: incompatible types for comparison

But works when set to 1
2023-03-10 06:44:06 -05:00
stakater-user
8f8b95bf57 [skip-ci] Update artifacts 2023-03-10 09:13:06 +00:00
Tanveer Alam
a32789f13b Merge pull request #409 from stakater/add-sync-after-restart
Implement sync after restart
2023-03-10 14:36:44 +05:30
faizanahmad055
77b725c598 Update readme
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-03-09 23:16:50 +01:00
faizanahmad055
cf40b431a3 Implement sync after restart
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-03-09 23:02:19 +01:00
stakater-user
e0a1c25fee [skip-ci] Update artifacts 2023-03-06 14:31:59 +00:00
Usama Ahmad
a746df7a03 Merge pull request #404 from stakater/update-golang-and-dependencies
Update go version and dependencies
2023-03-06 19:10:43 +05:00
faizanahmad055
47190ec8b1 Update k8s.io dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-03-06 08:43:18 +01:00
faizanahmad055
a00f7bf83e Remove namespace from clusterrole and clusterrolebinding
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-03-05 17:59:44 +01:00
stakater-user
2b29700fa4 [skip-ci] Update artifacts 2023-03-03 22:20:53 +00:00
frits-v
84e927fd60 fix: remove cluster-scoped resources namespace (#402)
`/metadata/namespace` is invalid for cluster-scoped resources. Having it
defined results in errors in certain tooling.

```
KNV1052: cluster-scoped resources MUST NOT declare metadata.namespace
```
2023-03-03 23:12:42 +01:00
faizanahmad055
2d1af6429e Update golang version and dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-27 20:22:13 +01:00
stakater-user
80a7f1ee9f [skip-ci] Update artifacts 2023-02-26 15:15:01 +00:00
Faizan Ahmad
fdc99f8dd3 Merge pull request #398 from yu-croco/add-fullname-override-on-values
[helm] Add nameOverride and fullnameOverride explicitly on values.yaml
2023-02-26 15:55:31 +01:00
yu-croco
d660f9dbdf Merge branch 'master' into add-fullname-override-on-values 2023-02-26 22:45:11 +09:00
yu-croco
ad03e5830d chore: Add nameOverride and fullnameOverride explicitly on values.yaml
Signed-off-by: yu-croco <yu.croco@gmail.com>
2023-02-26 22:42:17 +09:00
stakater-user
032c391cb8 [skip-ci] Update artifacts 2023-02-26 12:43:03 +00:00
Faizan Ahmad
9173f446ab Merge pull request #396 from stakater/update-push-workflow
Remove outdated manifests
2023-02-26 13:23:25 +01:00
stakater-user
f795fa2aec [skip-ci] Update artifacts 2023-02-26 12:07:53 +00:00
Faizan Ahmad
34c1f389bc Merge pull request #393 from stakater/dependabot/go_modules/golang.org/x/net-0.7.0
Bump golang.org/x/net from 0.5.0 to 0.7.0
2023-02-26 12:48:16 +01:00
stakater-user
fdc8a61fc6 [skip-ci] Update artifacts 2023-02-26 11:35:45 +00:00
Faizan Ahmad
c7f507a4b9 Merge pull request #386 from d3adb5/feat/set-rootfs-ro
feat: set read-only root filesystem at container level
2023-02-26 12:16:42 +01:00
stakater-user
70aef8a871 [skip-ci] Update artifacts 2023-02-26 10:59:11 +00:00
Faizan Ahmad
54d0681340 Merge pull request #385 from d3adb5/chore/stop-listening-on-9091
chore: listen on only 9090 for /metrics and /live
2023-02-26 11:39:45 +01:00
MahnoorAsghar
b279aabae3 Remove changes from push workflow 2023-02-24 13:50:48 +05:00
MahnoorAsghar
63022fe4d0 Remove optional manifests which are outdated 2023-02-24 13:48:38 +05:00
MahnoorAsghar
8c4523db69 update push workflow to render manifests correctly 2023-02-22 16:45:43 +05:00
dependabot[bot]
646c64a326 Bump golang.org/x/net from 0.5.0 to 0.7.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-18 04:14:25 +00:00
d3adb5
5a9ccbf01f fix: properly capitalize 'filesystem' in values
Use the proper capitalization in the reference to the value
reloader.readOnlyRootFileSystem: FileSystem instead of Filesystem.
2023-02-08 14:15:28 -08:00
stakater-user
0f7403b7bf [skip-ci] Update artifacts 2023-02-07 17:35:32 +00:00
Faizan Ahmad
2bc83a26ff Merge pull request #383 from jkroepke/service-monitor
[helm] Add support for relabelings and metricRelabelings for serviceMonitor/podMonitor
2023-02-07 18:12:31 +01:00
Jan-Otto Kröpke
09babe46d9 [helm] Add support for relabelings and metricRelabelings for serviceMonitor/podMonitor 2023-02-07 11:20:29 +01:00
d3adb5
451e4f636b feat: set read-only root filesystem at container level
Change the securityContext field of the Reloader container if
reloader.readOnlyFilesystem is set to true. The change takes effect even
if not container securityContext is defined.

Closes #339.
2023-02-07 00:16:16 -08:00
d3adb5
2f8999e3cb chore: listen on only 9090 for /metrics and /live
Previously, 9091 and 9090 both led to the same web server, meaning both
/metrics and /live were reachable and fully functional through both.
This commit changes that so that only port 9090 is used for both.

Closes #381.
2023-02-07 00:15:17 -08:00
stakater-user
9463cd5fc2 [skip-ci] Update artifacts 2023-02-06 22:59:31 +00:00
Faizan Ahmad
5e2f4a0826 Merge pull request #391 from stakater/remove-depreciated-seed
Remove depreciated Seed
2023-02-06 23:37:53 +01:00
faizanahmad055
0083edb3ca Remove depreciated Seed
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 23:13:07 +01:00
Faizan Ahmad
d020c666b7 Merge pull request #390 from stakater/update-golangci-lint
Update golangci-lint version
2023-02-06 22:25:13 +01:00
faizanahmad055
3d29651267 Update golangci-lint version
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 22:22:36 +01:00
Faizan Ahmad
795aae0c78 Merge pull request #389 from stakater/update-pipeline
Update pipeline
2023-02-06 22:14:50 +01:00
faizanahmad055
364d66b90f Remove extra line
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 22:13:58 +01:00
faizanahmad055
2d8f0336dc Fix go version
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 22:13:16 +01:00
faizanahmad055
5716c1b35e Update pipeline
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 22:08:31 +01:00
Faizan Ahmad
fecd21deca Merge pull request #388 from stakater/update-github-actions
[skip-ci] Update github actions
2023-02-06 22:04:31 +01:00
faizanahmad055
5cd8b3d4ca [skip-ci] Update github actions
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-06 22:02:22 +01:00
Faizan Ahmad
991613bd13 Merge pull request #384 from stakater/update-go-1.20
Update golang version to 1.20
2023-02-05 17:17:43 +01:00
faizanahmad055
ef93197da1 Remove unused dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-05 16:10:34 +01:00
faizanahmad055
35754ccd73 Update dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-05 16:01:03 +01:00
faizanahmad055
d6d531e08e Update golang version to 1.20
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-02-05 15:11:23 +01:00
stakater-user
adff75f040 [skip-ci] Update artifacts 2023-01-30 14:39:35 +00:00
Faizan Ahmad
3e364186c9 Merge pull request #380 from Allex1/master
[helm] - Add template option to pod/servicemonitor ns/labels
2023-01-30 15:33:01 +01:00
birca
edb482d4ba remove version 2023-01-30 16:22:35 +02:00
birca
1f2d75898b [helm] - Add template option to pod/servicemonitor ns/labels 2023-01-27 13:09:47 +02:00
stakater-user
7f331907d3 [skip-ci] Update artifacts 2023-01-19 16:48:47 +00:00
Faizan Ahmad
29aa52a1c7 Merge pull request #377 from stakater/update-golang-dependencies
Update golang version and dependencies
2023-01-19 17:41:34 +01:00
faizanahmad055
ada8dbb5f3 Update golang version and dependencies
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2023-01-19 17:02:03 +01:00
Karl-Johan Grahn
cfe1754c44 Add dependabot (#371)
* Add dependabot

* update
2023-01-18 11:43:45 +01:00
Karl-Johan Grahn
2cca412425 Merge branch 'master' into fix-255 2022-06-14 09:05:26 +02:00
Karl-Johan Grahn
72ae858c14 fix(255): add back 2022-03-21 22:40:17 +01:00
Karl-Johan Grahn
77e2df9dfb fix(255): checkout does not work as expected 2022-03-21 22:34:45 +01:00
Karl-Johan Grahn
a5bb0392b1 fix(255): add registry var 2022-03-21 21:58:44 +01:00
Karl-Johan Grahn
cb39cf1a03 fix(255): update pr workflow too 2022-03-21 21:57:56 +01:00
Karl-Johan Grahn
3b94615934 fix(255): push image to ghcr instead of docker hub 2022-03-21 21:51:33 +01:00
78 changed files with 2474 additions and 1568 deletions

27
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: kind/bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment**
- Operator Version:
- Kubernetes/OpenShift Version:
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea/enhancement for this project
title: "[ENHANCE]"
labels: kind/enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

7
.github/md_config.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^(?!http).+"
}
]
}

View File

@@ -4,42 +4,64 @@ on:
pull_request_target:
branches:
- master
paths:
- '**'
- '!.markdownlint.yaml'
- '!.vale.ini'
- '!Dockerfile-docs'
- '!docs-nginx.conf'
- '!docs/**'
- '!theme_common'
- '!theme_override'
env:
DOCKER_FILE_PATH: Dockerfile
GOLANG_VERSION: 1.19.3
KUBERNETES_VERSION: "1.18.0"
KIND_VERSION: "0.10.0"
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.19.0"
KIND_VERSION: "0.17.0"
REGISTRY: ghcr.io
jobs:
qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.82
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: README.md
MD_LINT_CONFIG: .markdownlint.yaml
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
name: Build
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v3.4
uses: azure/setup-helm@v4
- name: Helm chart unit tests
uses: d3adb5/helm-unittest-action@v2
with:
charts: deployments/kubernetes/chart/reloader
- name: Set up Go
id: go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install Dependencies
run: |
make install
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2.3.0
uses: golangci/golangci-lint-action@v5
with:
version: v1.45.2
version: latest
only-new-issues: false
args: --timeout 10m
@@ -48,9 +70,6 @@ jobs:
cd deployments/kubernetes/chart/reloader
helm lint
- name: Link check
uses: gaurav-nelson/github-action-markdown-link-check@v1
- name: Install kubectl
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
@@ -69,35 +88,37 @@ jobs:
run: |
kind create cluster
kubectl cluster-info
- name: Test
run: make test
- name: Generate Tag
- name: Generate Tags
id: generate_tag
run: |
sha=${{ github.event.pull_request.head.sha }}
tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
echo "##[set-output name=GIT_TAG;]$(echo ${tag})"
ubi_tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-UBI-${sha:0:8}"
echo "GIT_TAG=$(echo ${tag})" >> $GITHUB_OUTPUT
echo "GIT_UBI_TAG=$(echo ${ubi_tag})" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
- name: Generate image repository path
- name: Generate image repository path for Docker registry
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
- name: Build and Push Docker Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -107,28 +128,87 @@ jobs:
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
cache-to: type=inline
platforms: linux/amd64,linux/arm64
tags: |
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Login to ghcr registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Generate image repository path for ghcr registry
run: |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to ghcr registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to ghcr registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
cache-to: type=inline
platforms: linux/amd64,linux/arm64
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Comment on PR
uses: mshick/add-pr-comment@v1
uses: mshick/add-pr-comment@v2
if: always()
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Image is available for testing. `docker pull ${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`'
allow-repeats: false
- name: Notify Failure
if: failure()
uses: mshick/add-pr-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
allow-repeats: false
message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
allow-repeats: true
- name: Notify Slack
uses: 8398a7/action-slack@v3

View File

@@ -0,0 +1,31 @@
name: Pull Request for Documentation Changes
on:
pull_request_target:
branches:
- master
paths:
- '.markdownlint.yaml'
- '.vale.ini'
- 'Dockerfile-docs'
- 'docs-nginx.conf'
- 'docs/**'
- 'theme_common'
- 'theme_override'
jobs:
qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.82
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: docs
MD_LINT_CONFIG: .markdownlint.yaml
build:
uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.82
with:
DOCKER_FILE_PATH: Dockerfile-docs
secrets:
CONTAINER_REGISTRY_URL: ghcr.io/stakater/docs
CONTAINER_REGISTRY_USERNAME: stakater-user
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

View File

@@ -4,13 +4,23 @@ on:
push:
branches:
- master
paths:
- '**'
- '!.markdownlint.yaml'
- '!.vale.ini'
- '!Dockerfile-docs'
- '!docs-nginx.conf'
- '!docs/**'
- '!theme_common'
- '!theme_override'
env:
DOCKER_FILE_PATH: Dockerfile
GOLANG_VERSION: 1.19.3
KUBERNETES_VERSION: "1.18.0"
KIND_VERSION: "0.10.0"
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.19.0"
KIND_VERSION: "0.17.0"
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
REGISTRY: ghcr.io
jobs:
build:
@@ -20,32 +30,35 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v3.4
uses: azure/setup-helm@v4
with:
version: v3.11.3
- name: Set up Go
id: go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install Dependencies
run: |
make install
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2.3.0
uses: golangci/golangci-lint-action@v5
with:
version: v1.45.2
version: latest
only-new-issues: false
args: --timeout 10m
- name: Install kubectl
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
@@ -70,7 +83,7 @@ jobs:
- name: Generate Tag
id: generate_tag
uses: anothrNick/github-tag-action@1.36.0
uses: anothrNick/github-tag-action@1.69.0
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
WITH_V: true
@@ -78,22 +91,23 @@ jobs:
DRY_RUN: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
- name: Generate image repository path
- name: Generate image repository path for Docker registry
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -103,12 +117,78 @@ jobs:
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
cache-to: type=inline
platforms: linux/amd64,linux/arm64
tags: |
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}-ubi
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Login to ghcr registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: stakater-user
password: ${{secrets.GITHUB_TOKEN}}
- name: Generate image repository path for ghcr registry
run: |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to ghcr registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to ghcr registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
cache-to: type=inline
platforms: linux/amd64,linux/arm64
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}-ubi
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
##############################
## Add steps to generate required artifacts for a release here(helm chart, operator manifest etc.)
##############################
@@ -116,7 +196,7 @@ jobs:
# Generate tag for operator without "v"
- name: Generate Operator Tag
id: generate_operator_tag
uses: anothrNick/github-tag-action@1.36.0
uses: anothrNick/github-tag-action@1.69.0
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
WITH_V: false
@@ -131,11 +211,29 @@ jobs:
- name: Helm Template
run: |
helm template reloader deployments/kubernetes/chart/reloader/ > deployments/kubernetes/reloader.yaml
helm template reloader deployments/kubernetes/chart/reloader/ \
--set reloader.deployment.resources.limits.cpu=150m \
--set reloader.deployment.resources.limits.memory=512Mi \
--set reloader.deployment.resources.requests.cpu=10m \
--set reloader.deployment.resources.requests.memory=128Mi > deployments/kubernetes/reloader.yaml
helm template reloader deployments/kubernetes/chart/reloader/ --output-dir deployments/kubernetes/manifests && mv deployments/kubernetes/manifests/reloader/templates/* deployments/kubernetes/manifests/ && rm -r deployments/kubernetes/manifests/reloader
- name: Remove labels and annotations from manifests
run: make remove-labels-annotations
# Publish helm chart
- name: Publish Helm chart
- name: Login to ghcr via helm
run: |
echo ${{secrets.GITHUB_TOKEN}} | helm registry login ghcr.io/stakater --username stakater-user --password-stdin
- name: Publish Helm chart to ghcr.io
run: |
helm package ./deployments/kubernetes/chart/reloader --destination ./packaged-chart
helm push ./packaged-chart/*.tgz oci://ghcr.io/stakater/charts
rm -rf ./packaged-chart
- name: Publish Helm chart to gh-pages
uses: stefanprodan/helm-gh-pages@master
with:
branch: master
@@ -148,16 +246,25 @@ jobs:
linting: on
commit_username: stakater-user
commit_email: stakater@gmail.com
# Commit back changes
- name: Log info about `.git` directory permissions
run: |
# Debug logging
echo "Disk usage: "
df -H
echo ".git files not owned by current user or current group:"
find .git ! -user $(id -u) -o ! -group $(id -g) | xargs ls -lah
- name: Commit files
run: |
git config --local user.email "stakater@gmail.com"
git config --local user.name "stakater-user"
git status
git status
git add .
git commit -m "[skip-ci] Update artifacts" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
@@ -165,7 +272,7 @@ jobs:
branch: ${{ github.ref }}
- name: Push Latest Tag
uses: anothrNick/github-tag-action@1.36.0
uses: anothrNick/github-tag-action@1.69.0
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
WITH_V: true

28
.github/workflows/push_docs.yaml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Push Documentation Changes
on:
push:
branches:
- master
paths:
- '.markdownlint.yaml'
- '.vale.ini'
- 'Dockerfile-docs'
- 'docs-nginx.conf'
- 'docs/**'
- 'README.md'
- 'theme_common'
- 'theme_override'
jobs:
push:
uses: stakater/.github/.github/workflows/push_container.yaml@v0.0.82
with:
DOCKER_FILE_PATH: Dockerfile-docs
RELEASE_BRANCH: master
secrets:
CONTAINER_REGISTRY_URL: ghcr.io/stakater/docs
CONTAINER_REGISTRY_USERNAME: stakater-user
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
GH_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}

View File

@@ -5,9 +5,6 @@ on:
tags:
- "v*"
env:
GOLANG_VERSION: 1.19.3
jobs:
build:
name: GoReleaser build
@@ -15,21 +12,22 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/
- name: Set up Go 1.x
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
id: go
go-version-file: "go.mod"
check-latest: true
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
@@ -41,4 +39,4 @@ jobs:
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

8
.gitignore vendored
View File

@@ -9,4 +9,10 @@ _gopath/
.vscode
vendor
dist
Reloader
Reloader
!**/chart/reloader
*.tgz
styles/
site/
/mkdocs.yml
yq

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "theme_common"]
path = theme_common
url = https://github.com/stakater/stakater-docs-mkdocs-theme.git

View File

@@ -10,6 +10,7 @@ builds:
- amd64
- arm
- arm64
- ppc64le
archives:
- name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
snapshot:

6
.markdownlint.yaml Normal file
View File

@@ -0,0 +1,6 @@
{
"MD007": { "indent": 4 },
"MD013": false,
"MD024": false,
"MD029": { "style": one },
}

10
.vale.ini Normal file
View File

@@ -0,0 +1,10 @@
StylesPath = styles
MinAlertLevel = warning
Packages = https://github.com/stakater/vale-package/releases/download/v0.0.27/Stakater.zip
Vocab = Stakater
# Only check MarkDown files
[*.md]
BasedOnStyles = Vale

3
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,3 @@
# Code of Conduct
Reloader follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@@ -2,7 +2,7 @@ ARG BUILDER_IMAGE
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.19.3} as builder
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.21.9} as builder
ARG TARGETOS
ARG TARGETARCH

35
Dockerfile-docs Normal file
View File

@@ -0,0 +1,35 @@
FROM python:3.12 as builder
# set workdir
RUN mkdir -p $HOME/application
WORKDIR $HOME/application
# copy the entire application
COPY --chown=1001:root . .
RUN pip3 install -r theme_common/requirements.txt
# Combine Theme Resources
RUN python theme_common/scripts/combine_theme_resources.py theme_common/resources theme_override/resources dist/_theme
# Produce mkdocs file
RUN python theme_common/scripts/combine_mkdocs_config_yaml.py theme_common/mkdocs.yml theme_override/mkdocs.yml mkdocs.yml
# build the docs
RUN mkdocs build
FROM nginxinc/nginx-unprivileged:1.27-alpine as deploy
COPY --from=builder $HOME/application/site/ /usr/share/nginx/html/reloader/
COPY docs-nginx.conf /etc/nginx/conf.d/default.conf
# set non-root user
USER 1001
LABEL name="Stakater Reloader Documentation" \
maintainer="Stakater <hello@stakater.com>" \
vendor="Stakater" \
release="1" \
summary="Documentation for Stakater Reloader"
EXPOSE 8080:8080/tcp
CMD ["nginx", "-g", "daemon off;"]

19
Dockerfile.ubi Normal file
View File

@@ -0,0 +1,19 @@
ARG BUILDER_IMAGE
ARG BASE_IMAGE
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} as SRC
FROM ${BASE_IMAGE:-registry.access.redhat.com/ubi8/ubi-minimal:latest}
WORKDIR /
COPY --from=SRC /manager .
# Update image
RUN microdnf update
USER 65532:65532
# Port for metrics and probes
EXPOSE 9090
ENTRYPOINT ["/manager"]

5
MAINTAINERS Normal file
View File

@@ -0,0 +1,5 @@
Bharath Nallapeta <bharath.nallapeta@stakater.com> (@bnallapeta)
Karl Johan Grahn <karl.johan@stakater.com> (@karl-johan-grahn)
Muhammad Sheryar Butt <sheryar@stakater.com> (@SheryarButt)
Muneeb Aijaz <muneeb@stakater.com> (@MuneebAijaz)
Tanveer Alam <tanveer.alam@stakater.com> (@tanalam2411)

View File

@@ -9,7 +9,7 @@ ALL_ARCH ?= arm64 arm amd64
BUILDER_IMAGE ?=
BASE_IMAGE ?=
BINARY ?= Reloader
DOCKER_IMAGE ?= stakater/reloader
DOCKER_IMAGE ?= ghcr.io/stakater/reloader
# Default value "dev"
VERSION ?= 0.0.1
@@ -82,7 +82,29 @@ deploy: binary-image push apply
# Bump Chart
bump-chart:
sed -i "s/^version:.*/version: v$(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/^version:.*/version: $(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: v$(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/tag:.*/tag: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml
sed -i "s/version:.*/version: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml
YQ_VERSION = v4.42.1
YQ_BIN = $(shell pwd)/yq
CURRENT_ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
YQ_DOWNLOAD_URL = "https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_linux_$(CURRENT_ARCH)"
yq-install:
@echo "Downloading yq $(YQ_VERSION) for linux/$(CURRENT_ARCH)"
@curl -sL $(YQ_DOWNLOAD_URL) -o $(YQ_BIN)
@chmod +x $(YQ_BIN)
@echo "yq $(YQ_VERSION) installed at $(YQ_BIN)"
remove-labels-annotations: yq-install
@for file in $$(find deployments/kubernetes/manifests -type f -name '*.yaml'); do \
echo "Processing $$file"; \
$(YQ_BIN) eval 'del(.metadata.labels, .metadata.annotations)' -i "$$file"; \
done
$(YQ_BIN) eval 'del(.spec.template.metadata.labels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval 'del(.spec.selector.matchLabels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.selector.matchLabels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.template.metadata.labels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml

269
README.md
View File

@@ -1,13 +1,13 @@
# ![](assets/web/reloader-round-100px.png) RELOADER
# ![Reloader-logo](assets/web/reloader-round-100px.png) Reloader
[![Go Report Card](https://goreportcard.com/badge/github.com/stakater/reloader?style=flat-square)](https://goreportcard.com/report/github.com/stakater/reloader)
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/stakater/reloader)
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/stakater/reloader)
[![Release](https://img.shields.io/github/release/stakater/reloader.svg?style=flat-square)](https://github.com/stakater/reloader/releases/latest)
[![GitHub tag](https://img.shields.io/github/tag/stakater/reloader.svg?style=flat-square)](https://github.com/stakater/reloader/releases/latest)
[![Docker Pulls](https://img.shields.io/docker/pulls/stakater/reloader.svg?style=flat-square)](https://hub.docker.com/r/stakater/reloader/)
[![Docker Stars](https://img.shields.io/docker/stars/stakater/reloader.svg?style=flat-square)](https://hub.docker.com/r/stakater/reloader/)
[![license](https://img.shields.io/github/license/stakater/reloader.svg?style=flat-square)](LICENSE)
[![Get started with Stakater](https://stakater.github.io/README/stakater-github-banner.png)](http://stakater.com/?utm_source=Reloader&utm_medium=github)
[![Get started with Stakater](https://stakater.github.io/README/stakater-github-banner.png)](https://stakater.com/?utm_source=Reloader&utm_medium=github)
## Problem
@@ -17,9 +17,21 @@ We would like to watch if some change happens in `ConfigMap` and/or `Secret`; th
Reloader can watch changes in `ConfigMap` and `Secret` and do rolling upgrades on Pods with their associated `DeploymentConfigs`, `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts`.
## Enterprise Version
Reloader is available in two different versions:
1. Open Source Version
1. Enterprise Version, which includes:
- SLA (Service Level Agreement) for support and unique requests
- Slack support
- Certified images
Contact [`sales@stakater.com`](mailto:sales@stakater.com) for info about Reloader Enterprise.
## Compatibility
Reloader is compatible with kubernetes >= 1.9
Reloader is compatible with Kubernetes >= 1.19
## How to use Reloader
@@ -37,7 +49,9 @@ spec:
This will discover deploymentconfigs/deployments/daemonsets/statefulset/rollouts automatically where `foo-configmap` or `foo-secret` is being used either via environment variable or from volume mount. And it will perform rolling upgrade on related pods when `foo-configmap` or `foo-secret`are updated.
You can restrict this discovery to only `ConfigMap` or `Secret` objects that
You can filter it by the type of monitored resource and use typed versions of `auto` annotation. If you want to discover changes only in mounted `Secret`s and ignore changes in `ConfigMap`s, add `secret.reloader.stakater.com/auto` annotation instead. Analogously, you can use `configmap.reloader.stakater.com/auto` annotation to look for changes in mounted `ConfigMap`, changes in any of mounted `Secret`s will not trigger a rolling upgrade on related pods.
You can also restrict this discovery to only `ConfigMap` or `Secret` objects that
are tagged with a special annotation. To take advantage of that, annotate
your deploymentconfigs/deployments/daemonsets/statefulset/rollouts like this:
@@ -72,8 +86,14 @@ will always restart upon a change in configmaps or secrets it uses, regardless
of whether they have the `reloader.stakater.com/match: "true"` annotation or
not.
We can also specify a specific configmap or secret which would trigger rolling upgrade only upon change in our specified configmap or secret, this way, it will not trigger rolling upgrade upon changes in all configmaps or secrets used in a deploymentconfig, deployment, daemonset, statefulset or rollout.
To do this either set the auto annotation to `"false"` (`reloader.stakater.com/auto: "false"`) or remove it altogether, and use annotations mentioned [here](#Configmap) or [here](#Secret)
Similarly, `reloader.stakater.com/auto` and its typed version (`secret.reloader.stakater.com/auto` or `configmap.reloader.stakater.com/auto`) do not work together. If you have both annotations in your deployment, then only one of them needs to be true to trigger the restart. For example, having both `reloader.stakater.com/auto: "true"` and `secret.reloader.stakater.com/auto: "false"` or both `reloader.stakater.com/auto: "false"` and `secret.reloader.stakater.com/auto: "true"` will restart upon a change in a secret it uses.
We can also specify a specific configmap or secret which would trigger rolling upgrade only upon change in our specified configmap or secret, this way, it will not trigger rolling upgrade upon changes in all configmaps or secrets used in a `deploymentconfig`, `deployment`, `daemonset`, `statefulset` or `rollout`.
To do this either set the auto annotation to `"false"` (`reloader.stakater.com/auto: "false"`) or remove it altogether, and use annotations for [Configmap](.#Configmap) or [Secret](.#Secret).
It's also possible to enable auto reloading for all resources, by setting the `--auto-reload-all` flag.
In this case, all resources that do not have the auto annotation (or its typed version) set to `"false"`, will be reloaded automatically when their ConfigMaps or Secrets are updated.
Notice that setting the auto annotation to an undefined value counts as false as-well.
### Configmap
@@ -133,33 +153,31 @@ spec:
### NOTES
- Reloader also supports [sealed-secrets](https://github.com/bitnami-labs/sealed-secrets). [Here](docs/Reloader-with-Sealed-Secrets.md) are the steps to use sealed-secrets with reloader.
- For [rollouts](https://github.com/argoproj/argo-rollouts/) reloader simply triggers a change is up to you how you configure the rollout strategy.
- Reloader also supports [sealed-secrets](https://github.com/bitnami-labs/sealed-secrets). [Here](docs/Reloader-with-Sealed-Secrets.md) are the steps to use sealed-secrets with Reloader.
- For [`rollouts`](https://github.com/argoproj/argo-rollouts/) Reloader simply triggers a change is up to you how you configure the `rollout` strategy.
- `reloader.stakater.com/auto: "true"` will only reload the pod, if the configmap or secret is used (as a volume mount or as an env) in `DeploymentConfigs/Deployment/Daemonsets/Statefulsets`
- `secret.reloader.stakater.com/reload` or `configmap.reloader.stakater.com/reload` annotation will reload the pod upon changes in specified configmap or secret, irrespective of the usage of configmap or secret.
- you may override the auto annotation with the `--auto-annotation` flag
- you may override the secret typed auto annotation with the `--secret-auto-annotation` flag
- you may override the configmap typed auto annotation with the `--configmap-auto-annotation` flag
- you may override the search annotation with the `--auto-search-annotation` flag
and the match annotation with the `--search-match-annotation` flag
- you may override the configmap annotation with the `--configmap-annotation` flag
- you may override the secret annotation with the `--secret-annotation` flag
- you may want to prevent watching certain namespaces with the `--namespaces-to-ignore` flag
- you may want to watch only a set of namespaces with certain labels by using the `--namespace-selector` flag
- you may want to watch only a set of secrets/configmaps with certain labels by using the `--resource-label-selector` flag
- you may want to prevent watching certain resources with the `--resources-to-ignore` flag
- you can configure logging in JSON format with the `--log-format=json` option
- you can configure the "reload strategy" with the `--reload-strategy=<strategy-name>` option (details below)
## Reload Strategies
Reloader supports multiple "reload" strategies for performing rolling upgrades to resources. The following list describes them:
- **env-vars**: When a tracked `configMap`/`secret` is updated, this strategy attaches a Reloader specific environment variable to any containers
referencing the changed `configMap` or `secret` on the owning resource (e.g., `Deployment`, `StatefulSet`, etc.).
This strategy can be specified with the `--reload-strategy=env-vars` argument. Note: This is the default reload strategy.
- **annotations**: When a tracked `configMap`/`secret` is updated, this strategy attaches a `reloader.stakater.com/last-reloaded-from` pod template annotation
on the owning resource (e.g., `Deployment`, `StatefulSet`, etc.). This strategy is useful when using resource syncing tools like ArgoCD, since it will not cause these tools
to detect configuration drift after a resource is reloaded. Note: Since the attached pod template annotation only tracks the last reload source, this strategy will reload any tracked resource should its
`configMap` or `secret` be deleted and recreated.
This strategy can be specified with the `--reload-strategy=annotations` argument.
Reloader supports multiple "reload" strategies for performing rolling upgrades to resources. The following list describes them:
- **env-vars**: When a tracked `configMap`/`secret` is updated, this strategy attaches a Reloader specific environment variable to any containers referencing the changed `configMap` or `secret` on the owning resource (e.g., `Deployment`, `StatefulSet`, etc.). This strategy can be specified with the `--reload-strategy=env-vars` argument. Note: This is the default reload strategy.
- **annotations**: When a tracked `configMap`/`secret` is updated, this strategy attaches a `reloader.stakater.com/last-reloaded-from` pod template annotation on the owning resource (e.g., `Deployment`, `StatefulSet`, etc.). This strategy is useful when using resource syncing tools like ArgoCD, since it will not cause these tools to detect configuration drift after a resource is reloaded. Note: Since the attached pod template annotation only tracks the last reload source, this strategy will reload any tracked resource should its `configMap` or `secret` be deleted and recreated. This strategy can be specified with the `--reload-strategy=annotations` argument.
## Deploying to Kubernetes
You can deploy Reloader by following methods:
@@ -172,37 +190,71 @@ You can apply vanilla manifests by changing `RELEASE-NAME` placeholder provided
kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml
```
By default, Reloader gets deployed in `default` namespace and watches changes `secrets` and `configmaps` in all namespaces.
By default, Reloader gets deployed in `default` namespace and watches changes `secrets` and `configmaps` in all namespaces.Additionally, in the default Reloader deployment, the following resource limits and requests are set:
Reloader can be configured to ignore the resources `secrets` and `configmaps` by passing the following args (`spec.template.spec.containers.args`) to its container :
```yaml
resources:
limits:
cpu: 150m
memory: 512Mi
requests:
cpu: 10m
memory: 128Mi
```
| Args | Description |
| -------------------------------- | -------------------- |
Reloader can be configured to ignore the resources `secrets` and `configmaps` by passing the following arguments (`spec.template.spec.containers.args`) to its container :
| Argument | Description |
|----------------------------------|----------------------|
| --resources-to-ignore=configMaps | To ignore configMaps |
| --resources-to-ignore=secrets | To ignore secrets |
`Note`: At one time only one of these resource can be ignored, trying to do it will cause error in Reloader. Workaround for ignoring both resources is by scaling down the reloader pods to `0`.
**Note:** At one time only one of these resource can be ignored, trying to do it will cause error in Reloader. Workaround for ignoring both resources is by scaling down the Reloader pods to `0`.
Reloader can be configured to watch only namespaces labeled with (one or more) labels of your choosing by using the `--namespace-selector` parameter, for example:
```
--namespace-selector=reloder:enabled,test:true
Reloader can be configured to only watch secrets/configmaps with one or more labels using the `--resource-label-selector` parameter. Supported operators are `!, in, notin, ==, =, !=`, if no operator is found the 'exists' operator is inferred (i.e. key only). Additional examples of these selectors can be found in the [Kubernetes Docs](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors).
**Note:** The old `:` delimited key value mappings are deprecated and if provided will be translated to `key=value`. Likewise, if a wildcard value is provided (e.g. `key:*`) it will be translated to the standalone `key` which checks for key existence.
These selectors can be combined, for example with:
```yaml
--resource-label-selector=reloader=enabled,key-exists,another-label in (value1,value2,value3)
```
Only namespaces labeled like the following namespace YAML will be watched:
Only configmaps or secrets labeled like the following will be watched:
```yaml
kind: ConfigMap
apiVersion: v1
metadata:
labels:
reloader: enabled
key-exists: yes
another-label: value1
```
Reloader can be configured to only watch namespaces labeled with one or more labels using the `--namespace-selector` parameter. Supported operators are `!, in, notin, ==, =, !=`, if no operator is found the 'exists' operator is inferred (i.e. key only). Additional examples of these selectors can be found in the [Kubernetes Docs](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors).
**Note:** The old `:` delimited key value mappings are deprecated and if provided will be translated to `key=value`. Likewise, if a wildcard value is provided (e.g. `key:*`) it will be translated to the standalone `key` which checks for key existence.
These selectors can be combined, for example with:
```yaml
--namespace-selector=reloader=enabled,test=true
```
Only namespaces labeled as below would be watched and eligible for reloads:
```yaml
kind: Namespace
apiVersion: v1
metadata:
...
labels:
reloder: enabled
reloader: enabled
test: true
...
```
If you want to select namespace only by the key of the label use ```*``` as the value.
For example, for ```--namespace-selector=select-this:*``` all namespaces with label-key "select-this" will be selected regardless of the labels value
### Vanilla kustomize
### Vanilla Kustomize
You can also apply the vanilla manifests by running the following command
@@ -220,7 +272,7 @@ You can write your own `kustomization.yaml` using ours as a 'base' and write pat
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
resources:
- https://github.com/stakater/Reloader/deployments/kubernetes
namespace: reloader
@@ -228,7 +280,9 @@ namespace: reloader
### Helm Charts
Alternatively if you have configured helm on your cluster, you can add reloader to helm from our public chart repository and deploy it via helm using below mentioned commands. Follow [this](docs/Helm2-to-Helm3.md) guide, in case you have trouble migrating reloader from Helm2 to Helm3
Alternatively if you have configured helm on your cluster, you can add Reloader to helm from our public chart repository and deploy it via helm using below-mentioned commands. Follow [this](docs/Helm2-to-Helm3.md) guide, in case you have trouble migrating Reloader from Helm2 to Helm3.
#### Installation
```bash
helm repo add stakater https://stakater.github.io/stakater-charts
@@ -236,48 +290,108 @@ helm repo add stakater https://stakater.github.io/stakater-charts
helm repo update
helm install stakater/reloader # For helm3 add --generate-name flag or set the release name
helm install {{RELEASE_NAME}} stakater/reloader -n {{NAMESPACE}} --set reloader.watchGlobally=false # By default, Reloader watches in all namespaces. To watch in single namespace, set watchGlobally=false
helm install stakater/reloader --set reloader.watchGlobally=false --namespace test --generate-name # Install Reloader in `test` namespace which will only watch `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts` in `test` namespace.
```
**Note:** By default reloader watches in all namespaces. To watch in single namespace, please run following command. It will install reloader in `test` namespace which will only watch `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts` in `test` namespace.
#### Uninstalling
```bash
helm install stakater/reloader --set reloader.watchGlobally=false --namespace test # For helm3 add --generate-name flag or set the release name
helm uninstall {{RELEASE_NAME}} -n {{NAMESPACE}}
```
Reloader can be configured to ignore the resources `secrets` and `configmaps` by using the following parameters of `values.yaml` file:
### Parameters
| Parameter | Description | Type |
| ---------------- | -------------------------------------------------------------- | ------- |
| ignoreSecrets | To ignore secrets. Valid value are either `true` or `false` | boolean |
| ignoreConfigMaps | To ignore configMaps. Valid value are either `true` or `false` | boolean |
#### Global Parameters
`Note`: At one time only one of these resource can be ignored, trying to do it will cause error in helm template compilation.
| Parameter | Description | Type | Default |
|---------------------------|-----------------------------------------------------------------|-------|---------|
| `global.imagePullSecrets` | Reference to one or more secrets to be used when pulling images | array | `[]` |
Reloader can be configured to watch only namespaces labeled with (one or more) labels of your choosing by using the `namespaceSelector` parameter
#### Common Parameters
| Parameter | Description | Type |
| ---------------- | -------------------------------------------------------------- | ------- |
| namespaceSelector | list of comma separated key:value namespace | string |
| Parameter | Description | Type | Default |
|--------------------|-------------------------------|--------|---------|
| `nameOverride` | replace the name of the chart | string | `""` |
| `fullnameOverride` | replace the generated name | string | `""` |
You can also set the log format of Reloader to json by setting `logFormat` to `json` in values.yaml and apply the chart
#### Core Reloader Parameters
You can enable to scrape Reloader's Prometheus metrics by setting `serviceMonitor.enabled` or `podMonitor.enabled` to `true` in values.yaml file. Service monitor will be removed in future releases of reloader in favour of Pod monitor.
| Parameter | Description | Type | Default |
|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|-------------|-----------|
| `reloader.autoReloadAll` | | boolean | `false` |
| `reloader.isArgoRollouts` | Enable Argo `Rollouts`. Valid value are either `true` or `false` | boolean | `false` |
| `reloader.isOpenshift` | Enable OpenShift DeploymentConfigs. Valid value are either `true` or `false` | boolean | `false` |
| `reloader.ignoreSecrets` | To ignore secrets. Valid value are either `true` or `false`. Either `ignoreSecrets` or `ignoreConfigMaps` can be ignored, not both at the same time | boolean | `false` |
| `reloader.ignoreConfigMaps` | To ignore configMaps. Valid value are either `true` or `false` | boolean | `false` |
| `reloader.reloadOnCreate` | Enable reload on create events. Valid value are either `true` or `false` | boolean | `false` |
| `reloader.syncAfterRestart` | Enable sync after Reloader restarts for **Add** events, works only when reloadOnCreate is `true`. Valid value are either `true` or `false` | boolean | `false` |
| `reloader.reloadStrategy` | Strategy to trigger resource restart, set to either `default`, `env-vars` or `annotations` | enumeration | `default` |
| `reloader.ignoreNamespaces` | List of comma separated namespaces to ignore, if multiple are provided, they are combined with the AND operator | string | `""` |
| `reloader.namespaceSelector` | List of comma separated namespaces to select, if multiple are provided, they are combined with the AND operator | string | `""` |
| `reloader.resourceLabelSelector` | List of comma separated label selectors, if multiple are provided they are combined with the AND operator | string | `""` |
| `reloader.logFormat` | Set type of log format. Value could be either `json` or `""` | string | `""` |
| `reloader.watchGlobally` | Allow Reloader to watch in all namespaces (`true`) or just in a single namespace (`false`) | boolean | `true` |
| `reloader.enableHA` | Enable leadership election allowing you to run multiple replicas | boolean | `false` |
| `reloader.readOnlyRootFileSystem` | Enforce readOnlyRootFilesystem | boolean | `false` |
| `reloader.legacy.rbac` | | boolean | `false` |
| `reloader.matchLabels` | Pod labels to match | map | `{}` |
**Note:** Reloading of OpenShift (DeploymentConfig) and/or Argo Rollouts has to be enabled explicitly because it might not be always possible to use it on a cluster with restricted permissions. This can be done by changing the following parameters:
#### Deployment Reloader Parameters
| Parameter | Description | Type |
| ---------------- |------------------------------------------------------------------------------| ------- |
| isOpenshift | Enable OpenShift DeploymentConfigs. Valid value are either `true` or `false` | boolean |
| isArgoRollouts | Enable Argo Rollouts. Valid value are either `true` or `false` | boolean |
| reloadOnCreate | Enable reload on create events. Valid value are either `true` or `false` | boolean |
| Parameter | Description | Type | Default |
|-------------------------------------------------|-----------------------------------------------------------------------------------------|--------|-------------------|
| `reloader.deployment.replicas` | Number of replicas, if you wish to run multiple replicas set `reloader.enableHA = true` | int | 1 |
| `reloader.deployment.revisionHistoryLimit` | Limit the number of revisions retained in the revision history | int | 2 |
| `reloader.deployment.nodeSelector` | Scheduling pod to a specific node based on set labels | map | `{}` |
| `reloader.deployment.affinity` | Set affinity rules on pod | map | `{}` |
| `reloader.deployment.securityContext` | Set pod security context | map | `{}` |
| `reloader.deployment.containerSecurityContext` | Set container security context | map | `{}` |
| `reloader.deployment.tolerations` | A list of `tolerations` to be applied to the deployment | array | `[]` |
| `reloader.deployment.topologySpreadConstraints` | Topology spread constraints for pod assignment | array | `[]` |
| `reloader.deployment.annotations` | Set deployment annotations | map | `{}` |
| `reloader.deployment.labels` | Set deployment labels, default to stakater settings | array | `see values.yaml` |
| `reloader.deployment.image` | Set container image name, tag and policy | array | `see values.yaml` |
| `reloader.deployment.env` | Support for extra environment variables | array | `[]` |
| `reloader.deployment.livenessProbe` | Set liveness probe timeout values | map | `{}` |
| `reloader.deployment.readinessProbe` | Set readiness probe timeout values | map | `{}` |
| `reloader.deployment.resources` | Set container requests and limits (e.g. CPU or memory) | map | `{}` |
| `reloader.deployment.pod.annotations` | Set annotations for pod | map | `{}` |
| `reloader.deployment.priorityClassName` | Set priority class for pod in cluster | string | `""` |
**ReloadOnCreate** reloadOnCreate controls how Reloader handles secrets being added to the cache for the first time. If reloadOnCreate is set to true:
* Configmaps/secrets being added to the cache will cause Reloader to perform a rolling update of the associated workload.
* When applications are deployed for the first time, Reloader will perform a rolling update of the associated workload.
* If you are running Reloader in HA mode all workloads will have a rolling update performed when a new leader is elected.
#### Other Reloader Parameters
If ReloadOnCreate is set to false:
* Updates to configMaps/Secrets that occur while there is no leader will not be picked up by the new leader until a subsequent update of the configmap/secret occurs. In the worst case the window in which there can be no leader is 15s as this is the LeaseDuration.
| Parameter | Description | Type | Default |
|----------------------------------------|-----------------------------------------------------------------|---------|---------|
| `reloader.service` | | map | `{}` |
| `reloader.rbac.enabled` | Specifies whether a role based access control should be created | boolean | `true` |
| `reloader.serviceAccount.create` | Specifies whether a ServiceAccount should be created | boolean | `true` |
| `reloader.custom_annotations` | Add custom annotations | map | `{}` |
| `reloader.serviceMonitor.enabled` | Enable to scrape Reloader's Prometheus metrics (legacy) | boolean | `false` |
| `reloader.podMonitor.enabled` | Enable to scrape Reloader's Prometheus metrics | boolean | `false` |
| `reloader.podDisruptionBudget.enabled` | Limit the number of pods of a replicated application | boolean | `false` |
| `reloader.netpol.enabled` | | boolean | `false` |
| `reloader.volumeMounts` | Mount volume | array | `[]` |
| `reloader.volumes` | Add volume to a pod | array | `[]` |
| `reloader.webhookUrl` | Add webhook to Reloader | string | `""` |
#### Additional Remarks
- Both `namespaceSelector` & `resourceLabelSelector` can be used together. If they are then both conditions must be met for the configmap or secret to be eligible to trigger reload events. (e.g. If a configMap matches `resourceLabelSelector` but `namespaceSelector` does not match the namespace the configmap is in, it will be ignored).
- At one time only one of the resources `ignoreConfigMaps` or `ignoreSecrets` can be ignored, trying to do both will cause error in helm template compilation
- Reloading of OpenShift (DeploymentConfig) and/or Argo `Rollouts` has to be enabled explicitly because it might not be always possible to use it on a cluster with restricted permissions
- `isOpenShift` Recent versions of OpenShift (tested on 4.13.3) require the specified user to be in an `uid` range which is dynamically assigned by the namespace. The solution is to unset the runAsUser variable via ``deployment.securityContext.runAsUser=null`` and let OpenShift assign it at install
- `reloadOnCreate` controls how Reloader handles secrets being added to the cache for the first time. If `reloadOnCreate` is set to true:
1. Configmaps/secrets being added to the cache will cause Reloader to perform a rolling update of the associated workload
1. When applications are deployed for the first time, Reloader will perform a rolling update of the associated workload
1. If you are running Reloader in HA mode all workloads will have a rolling update performed when a new leader is elected
- `serviceMonitor` will be removed in future releases of Reloader in favour of Pod monitor
- If `reloadOnCreate` is set to false:
1. Updates to configmaps/secrets that occur while there is no leader will not be picked up by the new leader until a subsequent update of the configmap/secret occurs
1. In the worst case the window in which there can be no leader is 15s as this is the LeaseDuration
- By default, `reloadOnCreate` and `syncAfterRestart` are both set to false. Both need to be enabled explicitly
## Help
@@ -287,13 +401,13 @@ You can find more documentation [here](docs)
### Have a question?
File a GitHub [issue](https://github.com/stakater/Reloader/issues), or send us an [email](mailto:stakater@gmail.com).
File a GitHub [issue](https://github.com/stakater/Reloader/issues).
### Talk to us on Slack
Join and talk to us on Slack for discussing Reloader
[![Join Slack](https://stakater.github.io/README/stakater-join-slack-btn.png)](https://slack.stakater.com/)
[![Join Slack](https://stakater.github.io/README/stakater-join-slack-btn.png)](https://stakater.slack.com/)
[![Chat](https://stakater.github.io/README/stakater-chat-btn.png)](https://stakater-community.slack.com/messages/CC5S05S12)
## Contributing
@@ -305,19 +419,19 @@ Please use the [issue tracker](https://github.com/stakater/Reloader/issues) to r
### Developing
1. Deploy Reloader.
2. Run `okteto up` to activate your development container.
3. `make build`.
4. `./Reloader`
1. Run `okteto up` to activate your development container.
1. `make build`
1. `./Reloader`
PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.
1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull request** so that we can review your changes
1. **Fork** the repo on GitHub
1. **Clone** the project to your own machine
1. **Commit** changes to your own branch
1. **Push** your work back up to your fork
1. Submit a **Pull request** so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
**NOTE:** Be sure to merge the latest from "upstream" before making a pull request!
## Changelog
@@ -325,18 +439,17 @@ View our closed [Pull Requests](https://github.com/stakater/Reloader/pulls?q=is%
## License
Apache2 © [Stakater](http://stakater.com)
Apache2 © [Stakater][website]
## About
`Reloader` is maintained by [Stakater][website]. Like it? Please let us know at <hello@stakater.com>
See [our other projects][community]
See [our other projects](https://github.com/stakater)
or contact us in case of professional services and queries on <hello@stakater.com>
[website]: http://stakater.com/
[community]: https://github.com/stakater/
[website]: https://stakater.com
## Acknowledgements
- [ConfigmapController](https://github.com/fabric8io/configmapcontroller); We documented here why we re-created [Reloader](docs/Reloader-vs-ConfigmapController.md)
- [ConfigmapController](https://github.com/fabric8io/configmapcontroller); We documented [here](docs/Reloader-vs-ConfigmapController.md) why we re-created Reloader

View File

@@ -3,8 +3,8 @@
apiVersion: v1
name: reloader
description: Reloader chart that runs on kubernetes
version: v1.0.1
appVersion: v1.0.1
version: v1.0.110
appVersion: vv1.0.110
keywords:
- Reloader
- kubernetes

View File

@@ -17,7 +17,6 @@ metadata:
{{ toYaml .Values.reloader.matchLabels | indent 4 }}
{{- end }}
name: {{ template "reloader-fullname" . }}-role
namespace: {{ .Values.namespace | default .Release.Namespace }}
rules:
- apiGroups:
- ""
@@ -38,8 +37,10 @@ rules:
resources:
- namespaces
verbs:
- get
{{- end }}
- get
- list
- watch
{{- end }}
{{- if and (.Capabilities.APIVersions.Has "apps.openshift.io/v1") (.Values.reloader.isOpenshift) }}
- apiGroups:
- "apps.openshift.io"
@@ -85,6 +86,19 @@ rules:
- get
- update
- patch
- apiGroups:
- "batch"
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- "batch"
resources:
- jobs
verbs:
- create
{{- if .Values.reloader.enableHA }}
- apiGroups:
- "coordination.k8s.io"

View File

@@ -17,7 +17,6 @@ metadata:
{{ toYaml .Values.reloader.matchLabels | indent 4 }}
{{- end }}
name: {{ template "reloader-fullname" . }}-role-binding
namespace: {{ .Values.namespace | default .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole

View File

@@ -22,7 +22,7 @@ spec:
{{- else }}
replicas: {{ .Values.reloader.deployment.replicas }}
{{- end}}
revisionHistoryLimit: 2
revisionHistoryLimit: {{ .Values.reloader.deployment.revisionHistoryLimit }}
selector:
matchLabels:
app: {{ template "reloader-fullname" . }}
@@ -57,12 +57,17 @@ spec:
affinity:
{{- if .Values.reloader.deployment.affinity }}
{{ toYaml .Values.reloader.deployment.affinity | indent 8 }}
{{- end}}
{{- else }}
{{ include "reloader-podAntiAffinity" . | indent 8 }}
{{- end }}
{{- end }}
{{- if .Values.reloader.deployment.tolerations }}
tolerations:
{{ toYaml .Values.reloader.deployment.tolerations | indent 8 }}
{{- end }}
{{- if .Values.reloader.deployment.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.reloader.deployment.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.reloader.deployment.priorityClassName }}
priorityClassName: {{ .Values.reloader.deployment.priorityClassName }}
@@ -128,8 +133,6 @@ spec:
ports:
- name: http
containerPort: 9091
- name: metrics
containerPort: 9090
livenessProbe:
httpGet:
@@ -139,25 +142,36 @@ spec:
failureThreshold: {{ .Values.reloader.deployment.livenessProbe.failureThreshold | default "5" }}
periodSeconds: {{ .Values.reloader.deployment.livenessProbe.periodSeconds | default "10" }}
successThreshold: {{ .Values.reloader.deployment.livenessProbe.successThreshold | default "1" }}
initialDelaySeconds: {{ .Values.reloader.deployment.livenessProbe.initialDelaySeconds | default "10" }}
readinessProbe:
httpGet:
path: /metrics
port: metrics
port: http
timeoutSeconds: {{ .Values.reloader.deployment.readinessProbe.timeoutSeconds | default "5" }}
failureThreshold: {{ .Values.reloader.deployment.readinessProbe.failureThreshold | default "5" }}
periodSeconds: {{ .Values.reloader.deployment.readinessProbe.periodSeconds | default "10" }}
successThreshold: {{ .Values.reloader.deployment.readinessProbe.successThreshold | default "1" }}
initialDelaySeconds: {{ .Values.reloader.deployment.readinessProbe.initialDelaySeconds | default "10" }}
{{- with .Values.reloader.deployment.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 10 }}
{{- end }}
{{- $containerSecurityContext := .Values.reloader.deployment.containerSecurityContext | default dict }}
{{- if .Values.reloader.readOnlyRootFileSystem }}
{{- $_ := set $containerSecurityContext "readOnlyRootFilesystem" true }}
{{- end }}
{{- if eq .Values.reloader.readOnlyRootFileSystem true }}
securityContext:
{{- toYaml $containerSecurityContext | nindent 10 }}
{{- if (or (.Values.reloader.deployment.volumeMounts) (eq .Values.reloader.readOnlyRootFileSystem true)) }}
volumeMounts:
{{- if eq .Values.reloader.readOnlyRootFileSystem true }}
- mountPath: /tmp/
name: tmp-volume
{{- end }}
{{- with .Values.reloader.deployment.volumeMounts }}
{{- . | toYaml | nindent 10 }}
{{- end }}
{{- end }}
{{- if or (.Values.reloader.logFormat) (.Values.reloader.ignoreSecrets) (.Values.reloader.ignoreNamespaces) (.Values.reloader.namespaceSelector) (.Values.reloader.ignoreConfigMaps) (.Values.reloader.custom_annotations) (eq .Values.reloader.isArgoRollouts true) (eq .Values.reloader.reloadOnCreate true) (ne .Values.reloader.reloadStrategy "default") (.Values.reloader.enableHA)}}
{{- if or (.Values.reloader.logFormat) (.Values.reloader.ignoreSecrets) (.Values.reloader.ignoreNamespaces) (.Values.reloader.namespaceSelector) (.Values.reloader.resourceLabelSelector) (.Values.reloader.ignoreConfigMaps) (.Values.reloader.custom_annotations) (eq .Values.reloader.isArgoRollouts true) (eq .Values.reloader.reloadOnCreate true) (ne .Values.reloader.reloadStrategy "default") (.Values.reloader.enableHA) (.Values.reloader.autoReloadAll)}}
args:
{{- if .Values.reloader.logFormat }}
- "--log-format={{ .Values.reloader.logFormat }}"
@@ -173,7 +187,10 @@ spec:
{{- end }}
{{- if .Values.reloader.namespaceSelector }}
- "--namespace-selector={{ .Values.reloader.namespaceSelector }}"
{{- end }}
{{- end }}
{{- if .Values.reloader.resourceLabelSelector }}
- "--resource-label-selector={{ .Values.reloader.resourceLabelSelector }}"
{{- end }}
{{- if .Values.reloader.custom_annotations }}
{{- if .Values.reloader.custom_annotations.configmap }}
- "--configmap-annotation"
@@ -187,6 +204,14 @@ spec:
- "--auto-annotation"
- "{{ .Values.reloader.custom_annotations.auto }}"
{{- end }}
{{- if .Values.reloader.custom_annotations.secret_auto }}
- "--secret-auto-annotation"
- "{{ .Values.reloader.custom_annotations.secret_auto }}"
{{- end }}
{{- if .Values.reloader.custom_annotations.configmap_auto }}
- "--configmap-auto-annotation"
- "{{ .Values.reloader.custom_annotations.configmap_auto }}"
{{- end }}
{{- if .Values.reloader.custom_annotations.search }}
- "--auto-search-annotation"
- "{{ .Values.reloader.custom_annotations.search }}"
@@ -195,6 +220,10 @@ spec:
- "--search-match-annotation"
- "{{ .Values.reloader.custom_annotations.match }}"
{{- end }}
{{- if .Values.reloader.webhookUrl }}
- "--webhook-url"
- "{{ .Values.reloader.webhookUrl }}"
{{- end }}
{{- end }}
{{- if eq .Values.reloader.isArgoRollouts true }}
- "--is-Argo-Rollouts={{ .Values.reloader.isArgoRollouts }}"
@@ -202,12 +231,18 @@ spec:
{{- if eq .Values.reloader.reloadOnCreate true }}
- "--reload-on-create={{ .Values.reloader.reloadOnCreate }}"
{{- end }}
{{- if eq .Values.reloader.syncAfterRestart true }}
- "--sync-after-restart={{ .Values.reloader.syncAfterRestart }}"
{{- end }}
{{- if ne .Values.reloader.reloadStrategy "default" }}
- "--reload-strategy={{ .Values.reloader.reloadStrategy }}"
{{- end }}
{{- if or (gt .Values.reloader.deployment.replicas 1.0) (.Values.reloader.enableHA) }}
{{- if or (gt (int .Values.reloader.deployment.replicas) 1) (.Values.reloader.enableHA) }}
- "--enable-ha=true"
{{- end}}
{{- if eq .Values.reloader.autoReloadAll true }}
- "--auto-reload-all=true"
{{- end -}}
{{- end }}
{{- if .Values.reloader.deployment.resources }}
resources:
@@ -220,8 +255,13 @@ spec:
{{- if hasKey .Values.reloader.deployment "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.reloader.deployment.automountServiceAccountToken }}
{{- end }}
{{- if eq .Values.reloader.readOnlyRootFileSystem true }}
{{- if (or (.Values.reloader.deployment.volumes) (eq .Values.reloader.readOnlyRootFileSystem true)) }}
volumes:
{{- if eq .Values.reloader.readOnlyRootFileSystem true }}
- emptyDir: {}
name: tmp-volume
{{- end }}
{{- with .Values.reloader.deployment.volumes }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,39 @@
{{- if and ( .Values.reloader.netpol.enabled ) }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
{{ include "reloader-helm3.annotations" . | indent 4 }}
labels:
{{ include "reloader-labels.chart" . | indent 4 }}
{{- if .Values.reloader.matchLabels }}
{{ toYaml .Values.reloader.matchLabels | indent 4 }}
{{- end }}
name: {{ template "reloader-fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
spec:
podSelector:
matchLabels:
app: {{ template "reloader-fullname" . }}
release: {{ .Release.Name | quote }}
{{- if .Values.reloader.matchLabels }}
{{ toYaml .Values.reloader.matchLabels | indent 6 }}
{{- end }}
policyTypes:
- Ingress
- Egress
ingress:
- ports:
- port: http
{{- with .Values.reloader.netpol.from}}
from:
{{- toYaml .| nindent 8 }}
{{- end }}
egress:
- ports:
- port: 443
{{- with .Values.reloader.netpol.to}}
to:
{{- toYaml .| nindent 8 }}
{{- end }}
{{- end }}

View File

@@ -3,6 +3,7 @@ apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "reloader-fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
spec:
minAvailable: {{ .Values.reloader.podDisruptionBudget.minAvailable }}
selector:

View File

@@ -2,25 +2,54 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
{{- if .Values.reloader.podMonitor.annotations }}
annotations:
{{ tpl (toYaml .Values.reloader.podMonitor.annotations) . | indent 4 }}
{{- end }}
labels:
{{ include "reloader-labels.chart" . | indent 4 }}
{{- if .Values.reloader.podMonitor.labels }}
{{ toYaml .Values.reloader.podMonitor.labels | indent 4}}
{{ tpl (toYaml .Values.reloader.podMonitor.labels) . | indent 4 }}
{{- end }}
name: {{ template "reloader-fullname" . }}
{{- if .Values.reloader.podMonitor.namespace }}
namespace: {{ .Values.reloader.podMonitor.namespace }}
namespace: {{ tpl .Values.reloader.podMonitor.namespace . }}
{{- else }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
{{- end }}
spec:
podMetricsEndpoints:
- port: http
path: "/metrics"
{{- if .Values.reloader.podMonitor.interval }}
interval: {{ .Values.reloader.podMonitor.interval }}
{{- end }}
{{- if .Values.reloader.podMonitor.timeout }}
scrapeTimeout: {{ .Values.reloader.podMonitor.timeout }}
{{- end }}
{{- with .Values.reloader.podMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.reloader.podMonitor.scheme }}
scheme: {{ . }}
{{- end }}
{{- with .Values.reloader.podMonitor.bearerTokenSecret }}
bearerTokenSecret: {{ . }}
{{- end }}
{{- with .Values.reloader.podMonitor.tlsConfig }}
tlsConfig:
{{- toYaml .| nindent 6 }}
{{- end }}
{{- with .Values.reloader.podMonitor.timeout }}
scrapeTimeout: {{ . }}
{{- end }}
honorLabels: {{ .Values.reloader.podMonitor.honorLabels }}
{{- with .Values.reloader.podMonitor.metricRelabelings }}
metricRelabelings:
{{- tpl (toYaml . | nindent 6) $ }}
{{- end }}
{{- with .Values.reloader.podMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.reloader.podMonitor.podTargetLabels }}
podTargetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
jobLabel: {{ template "reloader-fullname" . }}
namespaceSelector:
matchNames:

View File

@@ -77,6 +77,19 @@ rules:
- get
- update
- patch
- apiGroups:
- "batch"
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- "batch"
resources:
- jobs
verbs:
- create
{{- if .Values.reloader.enableHA }}
- apiGroups:
- "coordination.k8s.io"

View File

@@ -2,25 +2,54 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.reloader.serviceMonitor.annotations }}
annotations:
{{ tpl (toYaml .Values.reloader.serviceMonitor.annotations) . | indent 4 }}
{{- end }}
labels:
{{ include "reloader-labels.chart" . | indent 4 }}
{{- if .Values.reloader.serviceMonitor.labels }}
{{ toYaml .Values.reloader.serviceMonitor.labels | indent 4}}
{{ tpl (toYaml .Values.reloader.serviceMonitor.labels) . | indent 4 }}
{{- end }}
name: {{ template "reloader-fullname" . }}
{{- if .Values.reloader.serviceMonitor.namespace }}
namespace: {{ .Values.reloader.serviceMonitor.namespace }}
namespace: {{ tpl .Values.reloader.serviceMonitor.namespace . }}
{{- else }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
{{- end }}
spec:
endpoints:
- targetPort: http
path: "/metrics"
{{- if .Values.reloader.serviceMonitor.interval }}
interval: {{ .Values.reloader.serviceMonitor.interval }}
{{- end }}
{{- if .Values.reloader.serviceMonitor.timeout }}
scrapeTimeout: {{ .Values.reloader.serviceMonitor.timeout }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.scheme }}
scheme: {{ . }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.bearerTokenFile }}
bearerTokenFile: {{ . }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml .| nindent 6 }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.timeout }}
scrapeTimeout: {{ . }}
{{- end }}
honorLabels: {{ .Values.reloader.serviceMonitor.honorLabels }}
{{- with .Values.reloader.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- tpl (toYaml . | nindent 6) $ }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.reloader.serviceMonitor.targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
jobLabel: {{ template "reloader-fullname" . }}
namespaceSelector:
matchNames:

View File

@@ -0,0 +1,40 @@
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.reloader.verticalPodAutoscaler.enabled) }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ template "reloader-fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "reloader-labels.chart" . | nindent 4 }}
spec:
{{- with .Values.reloader.verticalPodAutoscaler.recommenders }}
recommenders:
{{- toYaml . | nindent 4 }}
{{- end }}
resourcePolicy:
containerPolicies:
- containerName: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.controlledValues }}
controlledValues: {{ .Values.reloader.verticalPodAutoscaler.controlledValues }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.maxAllowed }}
maxAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.maxAllowed | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.minAllowed }}
minAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.minAllowed | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,50 @@
suite: Deployment
templates:
- deployment.yaml
tests:
- it: sets readOnlyRootFilesystem in container securityContext when reloader.readOnlyRootFileSystem is true
set:
reloader:
readOnlyRootFileSystem: true
deployment:
containerSecurityContext:
readOnlyRootFilesystem: false
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem
value: true
- it: sets readOnlyRootFilesystem in container securityContext even if reloader.deployment.containerSecurityContext is null
set:
reloader:
readOnlyRootFileSystem: true
deployment:
containerSecurityContext: null
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem
value: true
- it: does not override readOnlyRootFilesystem in container securityContext based on reloader.readOnlyRootFileSystem
set:
reloader:
readOnlyRootFileSystem: false
deployment:
containerSecurityContext:
readOnlyRootFilesystem: true
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem
value: true
- it: template is still valid with no defined containerSecurityContext
set:
reloader:
readOnlyRootFileSystem: false
deployment:
containerSecurityContext: null
asserts:
- isEmpty:
path: spec.template.spec.containers[0].securityContext

View File

@@ -8,15 +8,21 @@ global:
kubernetes:
host: https://kubernetes.default
nameOverride: ""
fullnameOverride: ""
reloader:
autoReloadAll: false
isArgoRollouts: false
isOpenshift: false
ignoreSecrets: false
ignoreConfigMaps: false
reloadOnCreate: false
syncAfterRestart: false
reloadStrategy: default # Set to default, env-vars or annotations
ignoreNamespaces: "" # Comma separated list of namespaces to ignore
namespaceSelector: "" # Comma separated list of 'key:value' labels for namespaces selection
namespaceSelector: "" # Comma separated list of k8s label selectors for namespaces selection
resourceLabelSelector: "" # Comma separated list of k8s label selectors for configmap/secret selection
logFormat: "" #json
watchGlobally: true
# Set to true to enable leadership election allowing you to run multiple replicas
@@ -29,6 +35,9 @@ reloader:
deployment:
# If you wish to run multiple replicas set reloader.enableHA = true
replicas: 1
revisionHistoryLimit: 2
nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
@@ -46,6 +55,8 @@ reloader:
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
containerSecurityContext: {}
# capabilities:
@@ -62,14 +73,26 @@ reloader:
# effect: "NoSchedule"
tolerations: []
# Topology spread constraints for pod assignment
# Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
# Example:
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: zone
# whenUnsatisfiable: DoNotSchedule
# labelSelector:
# matchLabels:
# app: my-app
topologySpreadConstraints: []
annotations: {}
labels:
provider: stakater
group: com.stakater.platform
version: v1.0.1
version: vv1.0.110
image:
name: stakater/reloader
tag: v1.0.1
name: ghcr.io/stakater/reloader
tag: vv1.0.110
pullPolicy: IfNotPresent
# Support for extra environment variables.
env:
@@ -137,7 +160,7 @@ reloader:
annotations: {}
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
name:
# Optional flags to pass to the Reloader entrypoint
# Example:
# custom_annotations:
@@ -151,25 +174,148 @@ reloader:
enabled: false
# Set the namespace the ServiceMonitor should be deployed
# namespace: monitoring
# Set how frequently Prometheus should scrape
# interval: 30s
# Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator
# labels:
# Set timeout for scrape
# timeout: 10s
# Fallback to the prometheus default unless specified
# interval: 10s
## scheme: HTTP scheme to use for scraping. Can be used with `tlsConfig` for example if using istio mTLS.
# scheme: ""
## tlsConfig: TLS configuration to use when scraping the endpoint. For example if using istio mTLS.
## Of type: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfig
# tlsConfig: {}
# bearerTokenFile:
# Fallback to the prometheus default unless specified
# timeout: 30s
## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
labels: {}
## Used to pass annotations that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
annotations: {}
# Retain the job and instance labels of the metrics pushed to the Pushgateway
# [Scraping Pushgateway](https://github.com/prometheus/pushgateway#configure-the-pushgateway-as-a-target-to-scrape)
honorLabels: true
## Metric relabel configs to apply to samples before ingestion.
## [Metric Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs)
metricRelabelings: []
# - action: keep
# regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'
# sourceLabels: [__name__]
## Relabel configs to apply to samples before ingestion.
## [Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
relabelings: []
# - sourceLabels: [__meta_kubernetes_pod_node_name]
# separator: ;
# regex: ^(.*)$
# targetLabel: nodename
# replacement: $1
# action: replace
targetLabels: []
podMonitor:
enabled: false
# Set the namespace the podMonitor should be deployed
# namespace: monitoring
# Set how frequently Prometheus should scrape
# interval: 30s
# Set labels for the podMonitor, use this to define your scrape label for Prometheus Operator
# labels:
# Set timeout for scrape
# timeout: 10s
# Fallback to the prometheus default unless specified
# interval: 10s
## scheme: HTTP scheme to use for scraping. Can be used with `tlsConfig` for example if using istio mTLS.
# scheme: ""
## tlsConfig: TLS configuration to use when scraping the endpoint. For example if using istio mTLS.
## Of type: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfig
# tlsConfig: {}
# bearerTokenSecret:
# Fallback to the prometheus default unless specified
# timeout: 30s
## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
labels: {}
## Used to pass annotations that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
annotations: {}
# Retain the job and instance labels of the metrics pushed to the Pushgateway
# [Scraping Pushgateway](https://github.com/prometheus/pushgateway#configure-the-pushgateway-as-a-target-to-scrape)
honorLabels: true
## Metric relabel configs to apply to samples before ingestion.
## [Metric Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs)
metricRelabelings: []
# - action: keep
# regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'
# sourceLabels: [__name__]
## Relabel configs to apply to samples before ingestion.
## [Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
relabelings: []
# - sourceLabels: [__meta_kubernetes_pod_node_name]
# separator: ;
# regex: ^(.*)$
# targetLabel: nodename
# replacement: $1
# action: replace
podTargetLabels: []
podDisruptionBudget:
enabled: false
# Set the minimum available replicas
# minAvailable: 1
netpol:
enabled: false
from: []
# - podSelector:
# matchLabels:
# app.kubernetes.io/name: prometheus
to: []
# Enable vertical pod autoscaler
verticalPodAutoscaler:
enabled: false
# Recommender responsible for generating recommendation for the object.
# List should be empty (then the default recommender will generate the recommendation)
# or contain exactly one recommender.
# recommenders:
# - name: custom-recommender-performance
# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
controlledResources: []
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
# controlledValues: RequestsAndLimits
# Define the max allowed resources for the pod
maxAllowed: {}
# cpu: 200m
# memory: 100Mi
# Define the min allowed resources for the pod
minAllowed: {}
# cpu: 200m
# memory: 100Mi
updatePolicy:
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
# minReplicas: 1
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
updateMode: Auto
volumeMounts: []
volumes: []
webhookUrl: ""

View File

@@ -4,7 +4,5 @@ kind: Kustomization
resources:
- manifests/clusterrole.yaml
- manifests/clusterrolebinding.yaml
- manifests/role.yaml
- manifests/rolebinding.yaml
- manifests/serviceaccount.yaml
- manifests/deployment.yaml
- manifests/deployment.yaml

View File

@@ -1,20 +1,9 @@
---
# Source: reloader/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role
namespace: default
rules:
- apiGroups:
- ""
@@ -46,6 +35,19 @@ rules:
- get
- update
- patch
- apiGroups:
- "batch"
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- "batch"
resources:
- jobs
verbs:
- create
- apiGroups:
- ""
resources:

View File

@@ -1,20 +1,9 @@
---
# Source: reloader/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role-binding
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole

View File

@@ -3,18 +3,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.1
name: reloader-reloader
namespace: default
spec:
@@ -23,46 +11,40 @@ spec:
selector:
matchLabels:
app: reloader-reloader
release: "reloader"
template:
metadata:
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.1
spec:
containers:
- image: "stakater/reloader:v1.0.1"
imagePullPolicy: IfNotPresent
name: reloader-reloader
ports:
- name: http
containerPort: 9091
- name: metrics
containerPort: 9090
livenessProbe:
httpGet:
path: /live
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
readinessProbe:
httpGet:
path: /metrics
port: metrics
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
securityContext:
- image: "ghcr.io/stakater/reloader:vv1.0.110"
imagePullPolicy: IfNotPresent
name: reloader-reloader
ports:
- name: http
containerPort: 9090
livenessProbe:
httpGet:
path: /live
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: /metrics
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
securityContext: {}
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: reloader-reloader

View File

@@ -1,3 +0,0 @@
---
# Source: reloader/templates/podmonitor.yaml

View File

@@ -1,4 +0,0 @@
---
# Source: reloader/templates/role.yaml

View File

@@ -1,4 +0,0 @@
---
# Source: reloader/templates/rolebinding.yaml

View File

@@ -1,4 +0,0 @@
---
# Source: reloader/templates/service.yaml

View File

@@ -3,14 +3,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader
namespace: default

View File

@@ -1,4 +0,0 @@
---
# Source: reloader/templates/servicemonitor.yaml

View File

@@ -8,7 +8,7 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
chart: "reloader-v1.0.110"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
@@ -25,12 +25,11 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
chart: "reloader-v1.0.110"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role
namespace: default
rules:
- apiGroups:
- ""
@@ -62,6 +61,19 @@ rules:
- get
- update
- patch
- apiGroups:
- "batch"
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- "batch"
resources:
- jobs
verbs:
- create
- apiGroups:
- ""
resources:
@@ -80,12 +92,11 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
chart: "reloader-v1.0.110"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role-binding
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
@@ -104,13 +115,13 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
chart: "reloader-v1.0.110"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.1
version: vv1.0.110
name: reloader-reloader
namespace: default
spec:
@@ -124,23 +135,21 @@ spec:
metadata:
labels:
app: reloader-reloader
chart: "reloader-v1.0.1"
chart: "reloader-v1.0.110"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.1
version: vv1.0.110
spec:
containers:
- image: "stakater/reloader:v1.0.1"
- image: "ghcr.io/stakater/reloader:vv1.0.110"
imagePullPolicy: IfNotPresent
name: reloader-reloader
ports:
- name: http
containerPort: 9091
- name: metrics
containerPort: 9090
livenessProbe:
httpGet:
@@ -150,15 +159,29 @@ spec:
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: /metrics
port: metrics
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
securityContext:
{}
resources:
limits:
cpu: 150m
memory: 512Mi
requests:
cpu: 10m
memory: 128Mi
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: reloader-reloader

View File

@@ -136,3 +136,5 @@ reloader:
# labels:
# Set timeout for scrape
# timeout: 10s
webhookUrl: ""

11
docs-nginx.conf Normal file
View File

@@ -0,0 +1,11 @@
server {
listen 8080;
root /usr/share/nginx/html/;
index index.html;
error_page 403 404 /404.html;
location = /404.html {
internal;
}
# redirects issued by nginx will be relative
absolute_redirect off;
}

View File

@@ -1,12 +1,18 @@
# Alerting on Reload
Reloader can alert when it triggers a rolling upgrade on Deployments or StatefulSets. Webhook notification alert would be sent to the configured webhook server with all the required information
#### Enabling the feature
In-order to enable this feature, you need to update the reloader.env.secret section of values.yaml providing the information needed for alert.
<pre> ALERT_ON_RELOAD: [ true/false ] Default: false
ALERT_SINK: [ slack/webhook ] Default: webhook
Reloader can alert when it triggers a rolling upgrade on Deployments or StatefulSets. Webhook notification alert would be sent to the configured webhook server with all the required information.
## Enabling
In-order to enable this feature, you need to update the `reloader.env.secret` section of `values.yaml` providing the information needed for alert:
```yaml
ALERT_ON_RELOAD: [ true/false ] Default: false
ALERT_SINK: [ slack/teams/webhook ] Default: webhook
ALERT_WEBHOOK_URL: Required if ALERT_ON_RELOAD is true
ALERT_ADDITIONAL_INFO: Any additional information to be added to alert
```
#### Slack incoming-webhook creation docs
https://api.slack.com/messaging/webhooks
## Slack Incoming-Webhook Creation Docs
[Sending messages using Incoming Webhooks](https://api.slack.com/messaging/webhooks)

View File

@@ -1,41 +1,53 @@
# Container Build
> **WARNING:** As a user of Reloader there is no need to build containers, these are freely available here: https://hub.docker.com/r/stakater/reloader/
Multi-architecture approach is based on original work by @mdh02038: https://github.com/mdh02038/Reloader
> **WARNING:** As a user of Reloader there is no need to build containers, the open source version is available on [Docker Hub](https://hub.docker.com/r/stakater/reloader/).
Images tested on linux/arm, linux/arm64 and linux/amd64.
Multi-architecture approach is based on original work by [@mdh02038](https://github.com/mdh02038/Reloader).
# Install Pre-Reqs
The build environment requires the following packages (tested on Ubuntu 20.04):
* golang
* make
* qemu (for arm, arm64 etc. emulation)
Images are tested on linux/arm, linux/arm64 and linux/amd64.
## Install Pre-Reqs
The build environment requires the following packages (tested on `Ubuntu 20.04`):
* Golang
* `make`
* `qemu` (for arm, arm64 etc. emulation)
* binfmt-support
* Docker engine
## Docker
Follow instructions here: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
Follow instructions on [Install using the apt repository](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository).
Once installed, enable the experimental CLI:
```
```bash
export DOCKER_CLI_EXPERIMENTAL=enabled
```
Login, to enable publishing of packages:
```
Login to enable publishing of packages:
```bash
sudo docker login
```
## Remaining Pre-Reqs
Remaining Pre-Reqs can be installed via:
```
```bash
sudo apt install golang make qemu-user-static binfmt-support -y
```
# Publish Multi-Architecture Image
## Publish Multi-Architecture Image
To build/ publish multi-arch Docker images clone repository and execute from repository root:
```
```bash
sudo make release-all
```
# Additional Links/ Info
* *https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408
## Additional Links/Info
[Building Multi-Architecture Docker Images With `Buildx`](https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408)

View File

@@ -1,13 +1,14 @@
# Helm2 to Helm3 Migration
Follow below mentioned instructions to migrate reloader from Helm2 to Helm3
Follow below-mentioned instructions to migrate Reloader from Helm2 to Helm3
## Instrcutions:
## Instructions
There are 3 steps involved in migrating the reloader from Helm2 to Helm3.
There are 3 steps involved in migrating the Reloader from Helm2 to Helm3.
### Step 1:
Install the helm-2to3 plugin
### Step 1
Install the `helm-2to3` plugin
```bash
helm3 plugin install https://github.com/helm/helm-2to3
@@ -17,15 +18,18 @@ helm3 2to3 convert <release-name>
helm3 2to3 cleanup --release-cleanup --skip-confirmation
```
### Step 2:
Add the following Helm3 labels and annotations on reloader resources.
### Step 2
Add the following Helm3 labels and annotations on Reloader resources.
Label:
```yaml
app.kubernetes.io/managed-by=Helm
```
Annotations:
```yaml
meta.helm.sh/release-name=<release-name>
meta.helm.sh/release-namespace=<namespace>
@@ -51,12 +55,14 @@ kubectl annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE
kubectl label $KIND $NAME app.kubernetes.io/managed-by=Helm
```
### Step 3:
### Step 3
Upgrade to desired version
```bash
helm3 repo add stakater https://stakater.github.io/stakater-charts
helm3 repo update
helm3 upgrade <release-name> stakater/reloader --version=v0.0.72
```
```

View File

@@ -1,51 +1,49 @@
# How it works?
# How Does Reloader Work?
Reloader watches for `ConfigMap` and `Secret` and detects if there are changes in data of these objects. After change detection reloader performs rolling upgrade on relevant Pods via associated `Deployment`, `Daemonset` and `Statefulset`.
Reloader watches for `ConfigMap` and `Secret` and detects if there are changes in data of these objects. After change detection Reloader performs rolling upgrade on relevant Pods via associated `Deployment`, `Daemonset` and `Statefulset`.
## How change detection works
## How Does Change Detection Work?
Reloader watches changes in `configmaps` and `secrets` data. As soon as it detects a change in these. It forwards these objects to an update handler which decides if and how to perform the rolling upgrade.
## Requirements for rolling upgrade
## Requirements for Rolling Upgrade
To perform rolling upgrade a `deployment`, `daemonset` or `statefulset` must have
- support for rolling upgrade strategy
- specific annotation for `configmaps` or `secrets`
The annotation value is comma separated list of `configmaps` or `secrets`. If a change is detected in data of these `configmaps` or `secrets`, reloader will perform rolling upgrades on their associated `deployments`, `daemonsets` or `statefulsets`.
The annotation value is comma separated list of `configmaps` or `secrets`. If a change is detected in data of these `configmaps` or `secrets`, Reloader will perform rolling upgrades on their associated `deployments`, `daemonsets` or `statefulsets`.
### Annotation for Configmap
For a `Deployment` called `foo` have a `ConfigMap` called `foo`. Then add this annotation* to your `Deployment`
For a `Deployment` called `foo` have a `ConfigMap` called `foo`. Then add this annotation* to your `Deployment`, where the default annotation can be changed with the `--configmap-annotation` flag:
```yaml
metadata:
annotations:
configmap.reloader.stakater.com/reload: "foo"
```
<small>*the default annotation can be changed with the `--configmap-annotation` flag</small>
### Annotation for Secret
For a `Deployment` called `foo` have a `Secret` called `foo`. Then add this annotation* to your `Deployment`
For a `Deployment` called `foo` have a `Secret` called `foo`. Then add this annotation to your `Deployment`, where the default annotation can be changed with the `--secret-annotation` flag:
```yaml
metadata:
annotations:
secret.reloader.stakater.com/reload: "foo"
```
<small>*the default annotation can be changed with the `--secret-annotation` flag</small>
Above mentioned annotation are also work for `Daemonsets` `Statefulsets` and `Rollouts`
## How Rolling upgrade works?
## How Does Rolling Upgrade Work?
When reloader detects changes in configmap. It gets two objects of configmap. First object is an old configmap object which has a state before the latest change. Second object is new configmap object which contains latest changes. Reloader compares both objects and see whether any change in data occurred or not. If reloader finds any change in new configmap object, only then, it move forward with rolling upgrade.
When Reloader detects changes in configmap. It gets two objects of configmap. First object is an old configmap object which has a state before the latest change. Second object is new configmap object which contains latest changes. Reloader compares both objects and see whether any change in data occurred or not. If Reloader finds any change in new configmap object, only then, it moves forward with rolling upgrade.
After that, reloader gets the list of all deployments, daemonsets and statefulset and looks for above mentioned annotation for configmap. If the annotation value contains the configmap name, it then looks for an environment variable which can contain the configmap or secret data change hash.
After that, Reloader gets the list of all `deployments`, `daemonsets` and `statefulset` and looks for above mentioned annotation for configmap. If the annotation value contains the configmap name, it then looks for an environment variable which can contain the configmap or secret data change hash.
### Environment variable for Configmap
### Environment Variable for ConfigMap
If configmap name is foo then
@@ -53,7 +51,7 @@ If configmap name is foo then
STAKATER_FOO_CONFIGMAP
```
### Environment variable for Secret
### Environment Variable for Secret
If Secret name is foo then
@@ -61,22 +59,24 @@ If Secret name is foo then
STAKATER_FOO_SECRET
```
If the environment variable is found then it gets its value and compares it with new configmap hash value. If old value in environment variable is different from new hash value then reloader updates the environment variable. If the environment variable does not exist then it creates a new environment variable with latest hash value from configmap and updates the relevant `deployment`, `daemonset` or `statefulset`
If the environment variable is found then it gets its value and compares it with new configmap hash value. If old value in environment variable is different from new hash value then Reloader updates the environment variable. If the environment variable does not exist then it creates a new environment variable with latest hash value from configmap and updates the relevant `deployment`, `daemonset` or `statefulset`
Note: Rolling upgrade also works in the same way for secrets.
### Hash value Computation
### Hash Value Computation
Reloader uses SHA1 to compute hash value. SHA1 is used because it is efficient and less prone to collision.
## Monitor All Namespaces
By default reloader deploys in default namespace and monitors changes in all namespaces. To monitor changes in a specific namespace deploy the reloader in that namespace and set the `watchGlobally` flag to `false` in values file located under `deployments/kubernetes/chart/reloader`
And render manifest file using helm command
By default Reloader deploys in default namespace and monitors changes in all namespaces. To monitor changes in a specific namespace deploy the Reloader in that namespace and set the `watchGlobally` flag to `false` in values file located under `deployments/kubernetes/chart/reloader` and render manifest file using helm command:
```bash
helm --namespace {replace this with namespace name} template . > reloader.yaml
```
The output file can then be used to deploy reloader in specific namespace.
## Compatibility with helm install and upgrade
Reloader has no impact on helm deployment cycle. Reloader only injects an environment variable in `deployment`, `daemonset` or `statefulset`. The environment variable contains the SHA1 value of configmap's or secret's data. So if a deployment is created using Helm and Reloader updates the deployment, then next time you upgrade the helm release, reloader will do nothing except changing that environment variable value in `deployment` , `daemonset` or `statefulset`.
The output file can then be used to deploy Reloader in specific namespace.
## Compatibility With Helm Install and Upgrade
Reloader has no impact on helm deployment cycle. Reloader only injects an environment variable in `deployment`, `daemonset` or `statefulset`. The environment variable contains the SHA1 value of configmap's or secret's data. So if a deployment is created using Helm and Reloader updates the deployment, then next time you upgrade the helm release, Reloader will do nothing except changing that environment variable value in `deployment` , `daemonset` or `statefulset`.

View File

@@ -5,36 +5,42 @@ Reloader and k8s-trigger-controller are both built for same purpose. So there ar
## Similarities
- Both controllers support change detection in configmap and secrets
- Both controllers support deployment rollout
- Both controllers support deployment `rollout`
- Both controllers use SHA1 for hashing
- Both controllers have end to end as well as unit test cases.
## Differences
### Support for Daemonsets and Statefulsets.
### Support for `Daemonsets` and `Statefulsets`
#### k8s-trigger-controller:
k8s-trigger-controller only support for deployment rollout. It does not support daemonsets and statefulsets rollout.
#### `k8s-trigger-controller`
#### Reloader:
Reloader supports deployment rollout as well as daemonsets and statefulsets rollout.
`k8s-trigger-controller` only support for deployment `rollout`. It does not support `daemonsets` and `statefulsets` `rollout`.
### Hashing usage
#### Reloader
#### k8s-trigger-controller:
k8s-trigger-controller stores the hash value in an annotation `trigger.k8s.io/[secret|configMap]-NAME-last-hash`
Reloader supports deployment `rollout` as well as `daemonsets` and `statefulsets` `rollout`.
### Hashing Usage
#### `k8s-trigger-controller`
`k8s-trigger-controller` stores the hash value in an annotation `trigger.k8s.io/[secret|configMap]-NAME-last-hash`
#### Reloader
#### Reloader:
Reloader stores the hash value in an environment variable `STAKATER_NAME_[SECRET|CONFIGMAP]`
### Customization
#### k8s-trigger-controller:
k8s-trigger-controller restricts you to using the `trigger.k8s.io/[secret-configMap]-NAME-last-hash` annotation
#### `k8s-trigger-controller`
`k8s-trigger-controller` restricts you to using the `trigger.k8s.io/[secret-configMap]-NAME-last-hash` annotation
#### Reloader
#### Reloader:
Reloader allows you to customize the annotation to fit your needs with command line flags:
- `--auto-annotation <annotation>`
- `--configmap-annotation <annotation>`
- `--secret-annotation <annotation>`
- `--secret-annotation <annotation>`

View File

@@ -1,11 +1,14 @@
Below are the steps to use reloader with Sealed Secrets.
1. Download and install the kubeseal client from [here](https://github.com/bitnami-labs/sealed-secrets).
2. Install the controller for sealed secrets
3. Fetch the encryption certificate
4. Encrypt the secret.
5. Apply the secret.
7. Install the tool which uses that sealed secret.
8. Install Reloader.
9. Once everything is setup, update the original secret at client and encrypt it with kubeseal to see reloader working.
10. Apply the updated sealed secret.
11. Reloader will restart the pod to use that updated secret.
# Using Reloader with Sealed Secrets
Below are the steps to use Reloader with Sealed Secrets:
1. Download and install the kubeseal client from [here](https://github.com/bitnami-labs/sealed-secrets)
1. Install the controller for sealed secrets
1. Fetch the encryption certificate
1. Encrypt the secret
1. Apply the secret
1. Install the tool which uses that sealed secret
1. Install Reloader
1. Once everything is setup, update the original secret at client and encrypt it with kubeseal to see Reloader working
1. Apply the updated sealed secret
1. Reloader will restart the pod to use that updated secret

View File

@@ -2,9 +2,9 @@
Reloader's working can be verified by three ways.
## Verify from logs
## Verify From Logs
Check the logs of reloader and verify that you can see logs looks like below, if you are able to find these logs then it means reloader is working.
Check the logs of Reloader and verify that you can see logs looks like below, if you are able to find these logs then it means Reloader is working.
```text
Changes Detected in test-object of type 'SECRET' in namespace: test-reloader
@@ -14,48 +14,49 @@ Updated test-resource of type Deployment in namespace: test-reloader
Below are the details that explain these logs:
### test-object
### `test-object`
`test-object` is the name of a `secret` or a `deployment` in which change has been detected.
### SECRET
### `SECRET`
`SECRET` is the type of `test-object`. It can either be `SECRET` or `CONFIGMAP`
### test-reloader
### `test-reloader`
`test-reloader` is the name of namespace in which reloader has detected the change.
`test-reloader` is the name of namespace in which Reloader has detected the change.
### test-resource
### `test-resource`
`test-resource` is the name of resource which is going to be updated
### Deployment
### `Deployment`
`Deployment` is the type of `test-resource`. It can either be a `Deployment`, `Daemonset` or `Statefulset`
## Verify by checking the age of Pod
## Verify by Checking the Age of Pod
A pod's age can tell whether reloader is working correctly or not. If you know that a change in a `secret` or `configmap` has occurred, then check the relevant Pod's age immediately. It should be newly created few moments ago.
A pod's age can tell whether Reloader is working correctly or not. If you know that a change in a `secret` or `configmap` has occurred, then check the relevant Pod's age immediately. It should be newly created few moments ago.
### Verify from kubernetes Dashboard
### Verify from Kubernetes Dashboard
`kubernetes dashboard` can be used to verify the working of Reloader. After a change in `secret` or `configmap`, check the relevant Pod's age from dashboard. It should be newly created few moments ago.
### Verify from command line
### Verify from Command Line
After a change in `secret` or `configmap`. Run the below mentioned command and verify that the pod is newly created.
After a change in `secret` or `configmap`. Run the below-mentioned command and verify that the pod is newly created.
```bash
kubectl get pods <pod name> -n <namespace name>
```
## Verify from metrics
Some metrics are exported to prometheus endpoint `/metrics` on port `9090`.
## Verify From Metrics
When reloader is unable to reload, `reloader_reload_executed_total{success="false"}` metric gets incremented and when it reloads successfully, `reloader_reload_executed_total{success="true"}` gets incremented. You will be able to see the following metrics, with some other metrics, at `/metrics` endpoint.
Some metrics are exported to Prometheus endpoint `/metrics` on port `9090`.
```
When Reloader is unable to reload, `reloader_reload_executed_total{success="false"}` metric gets incremented and when it reloads successfully, `reloader_reload_executed_total{success="true"}` gets incremented. You will be able to see the following metrics, with some other metrics, at `/metrics` endpoint.
```text
reloader_reload_executed_total{success="false"} 15
reloader_reload_executed_total{success="true"} 12
```

View File

@@ -1,8 +0,0 @@
# Features
These are the key features of Reloader:
1. Restart pod in a deployment on change in linked/related configmap's or secret's
2. Restart pod in a daemonset on change in linked/related configmap's or secret's
3. Restart pod in a statefulset on change in linked/related configmap's or secret's
4. Restart pod in a rollout on change in linked/related configmap's or secret's

12
docs/index.md Normal file
View File

@@ -0,0 +1,12 @@
# Introduction
Reloader can watch changes in `ConfigMap` and `Secret` and do rolling upgrades on Pods with their associated `DeploymentConfigs`, `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts`.
These are the key features of Reloader:
1. Restart pod in a `deployment` on change in linked/related configmap's or secret's
1. Restart pod in a `daemonset` on change in linked/related configmap's or secret's
1. Restart pod in a `statefulset` on change in linked/related configmap's or secret's
1. Restart pod in a `rollout` on change in linked/related configmap's or secret's
This site contains more details on how Reloader works. For an overview, please see the repository's [README file](https://github.com/stakater/Reloader/blob/master/README.md).

99
go.mod
View File

@@ -1,86 +1,80 @@
module github.com/stakater/Reloader
go 1.19
go 1.21
require (
github.com/argoproj/argo-rollouts v1.3.1
github.com/openshift/api v0.0.0-20210527122704-efd9d5958e01
github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142
github.com/argoproj/argo-rollouts v1.7.0
github.com/openshift/api v3.9.0+incompatible
github.com/openshift/client-go v0.0.0-20231110140829-a6ca51f6d5ba
github.com/parnurzeal/gorequest v0.2.16
github.com/prometheus/client_golang v1.12.2
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.5.0
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
k8s.io/kubectl v0.24.2
github.com/prometheus/client_golang v1.19.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.1
k8s.io/api v0.29.3
k8s.io/apimachinery v0.29.3
k8s.io/client-go v0.29.3
k8s.io/kubectl v0.29.3
k8s.io/utils v0.0.0-20240423183400-0849a56e8f22
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.36.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 // indirect
k8s.io/utils v0.0.0-20220706174534-f6158b442e7c // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
moul.io/http2curl v1.0.0 // indirect
sigs.k8s.io/json v0.0.0-20220525155127-227cbc7cc124 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
// Replacements for argo-rollouts
replace (
github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127
github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.16.0
k8s.io/api v0.0.0 => k8s.io/api v0.24.2
k8s.io/apiextensions-apiserver v0.0.0 => k8s.io/apiextensions-apiserver v0.24.2
k8s.io/apimachinery v0.0.0 => k8s.io/apimachinery v0.21.0-alpha.0
k8s.io/apiserver v0.0.0 => k8s.io/apiserver v0.24.2
k8s.io/cli-runtime v0.0.0 => k8s.io/cli-runtime v0.24.2
k8s.io/client-go v0.0.0 => k8s.io/client-go v0.24.2
github.com/go-check/check => github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c
k8s.io/api v0.0.0 => k8s.io/api v0.28.4
k8s.io/apimachinery v0.0.0 => k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.0.0 => k8s.io/client-go v0.27.4
k8s.io/cloud-provider v0.0.0 => k8s.io/cloud-provider v0.24.2
k8s.io/cluster-bootstrap v0.0.0 => k8s.io/cluster-bootstrap v0.24.2
k8s.io/code-generator v0.0.0 => k8s.io/code-generator v0.20.5-rc.0
k8s.io/component-base v0.0.0 => k8s.io/component-base v0.24.2
k8s.io/component-helpers v0.0.0 => k8s.io/component-helpers v0.24.2
k8s.io/controller-manager v0.0.0 => k8s.io/controller-manager v0.24.2
k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.20.5-rc.0
k8s.io/csi-translation-lib v0.0.0 => k8s.io/csi-translation-lib v0.24.2
@@ -88,10 +82,9 @@ replace (
k8s.io/kube-controller-manager v0.0.0 => k8s.io/kube-controller-manager v0.24.2
k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.24.2
k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.24.2
k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.24.2
k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.27.1
k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.24.2
k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.24.2
k8s.io/metrics v0.0.0 => k8s.io/metrics v0.24.2
k8s.io/mount-utils v0.0.0 => k8s.io/mount-utils v0.20.5-rc.0
k8s.io/sample-apiserver v0.0.0 => k8s.io/sample-apiserver v0.24.2
k8s.io/sample-cli-plugin v0.0.0 => k8s.io/sample-cli-plugin v0.24.2

1015
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,8 @@ func SendWebhookAlert(msg string) {
if alert_sink == "slack" {
sendSlackAlert(webhook_url, webhook_proxy, msg)
} else if alert_sink == "teams" {
sendTeamsAlert(webhook_url, webhook_proxy, msg)
} else {
msg = strings.Replace(msg, "*", "", -1)
sendRawWebhookAlert(webhook_url, webhook_proxy, msg)
@@ -73,6 +75,29 @@ func sendSlackAlert(webhookUrl string, proxy string, msg string) []error {
return nil
}
// function to send alert to Microsoft Teams webhook
func sendTeamsAlert(webhookUrl string, proxy string, msg string) []error {
attachment := Attachment{
Text: msg,
}
request := gorequest.New().Proxy(proxy)
resp, _, err := request.
Post(webhookUrl).
RedirectPolicy(redirectPolicy).
Send(attachment).
End()
if err != nil {
return err
}
if resp.StatusCode != 200 {
return []error{fmt.Errorf("error sending msg. status: %v", resp.Status)}
}
return nil
}
// function to send alert to webhook service as text
func sendRawWebhookAlert(webhookUrl string, proxy string, msg string) []error {
request := gorequest.New().Proxy(proxy)

View File

@@ -6,6 +6,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/stakater/Reloader/pkg/kube"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -67,6 +68,26 @@ func GetDeploymentItems(clients kube.Clients, namespace string) []runtime.Object
return items
}
// GetCronJobItems returns the jobs in given namespace
func GetCronJobItems(clients kube.Clients, namespace string) []runtime.Object {
cronjobs, err := clients.KubernetesClient.BatchV1().CronJobs(namespace).List(context.TODO(), meta_v1.ListOptions{})
if err != nil {
logrus.Errorf("Failed to list cronjobs %v", err)
}
items := make([]runtime.Object, len(cronjobs.Items))
// Ensure we always have pod annotations to add to
for i, v := range cronjobs.Items {
if v.Spec.JobTemplate.Spec.Template.ObjectMeta.Annotations == nil {
annotations := make(map[string]string)
cronjobs.Items[i].Spec.JobTemplate.Spec.Template.ObjectMeta.Annotations = annotations
}
items[i] = &cronjobs.Items[i]
}
return items
}
// GetDaemonSetItems returns the daemonSets in given namespace
func GetDaemonSetItems(clients kube.Clients, namespace string) []runtime.Object {
daemonSets, err := clients.KubernetesClient.AppsV1().DaemonSets(namespace).List(context.TODO(), meta_v1.ListOptions{})
@@ -148,6 +169,11 @@ func GetDeploymentAnnotations(item runtime.Object) map[string]string {
return item.(*appsv1.Deployment).ObjectMeta.Annotations
}
// GetCronJobAnnotations returns the annotations of given cronjob
func GetCronJobAnnotations(item runtime.Object) map[string]string {
return item.(*batchv1.CronJob).ObjectMeta.Annotations
}
// GetDaemonSetAnnotations returns the annotations of given daemonSet
func GetDaemonSetAnnotations(item runtime.Object) map[string]string {
return item.(*appsv1.DaemonSet).ObjectMeta.Annotations
@@ -173,6 +199,11 @@ func GetDeploymentPodAnnotations(item runtime.Object) map[string]string {
return item.(*appsv1.Deployment).Spec.Template.ObjectMeta.Annotations
}
// GetCronJobPodAnnotations returns the pod's annotations of given cronjob
func GetCronJobPodAnnotations(item runtime.Object) map[string]string {
return item.(*batchv1.CronJob).Spec.JobTemplate.Spec.Template.ObjectMeta.Annotations
}
// GetDaemonSetPodAnnotations returns the pod's annotations of given daemonSet
func GetDaemonSetPodAnnotations(item runtime.Object) map[string]string {
return item.(*appsv1.DaemonSet).Spec.Template.ObjectMeta.Annotations
@@ -198,6 +229,11 @@ func GetDeploymentContainers(item runtime.Object) []v1.Container {
return item.(*appsv1.Deployment).Spec.Template.Spec.Containers
}
// GetCronJobContainers returns the containers of given cronjob
func GetCronJobContainers(item runtime.Object) []v1.Container {
return item.(*batchv1.CronJob).Spec.JobTemplate.Spec.Template.Spec.Containers
}
// GetDaemonSetContainers returns the containers of given daemonSet
func GetDaemonSetContainers(item runtime.Object) []v1.Container {
return item.(*appsv1.DaemonSet).Spec.Template.Spec.Containers
@@ -223,6 +259,11 @@ func GetDeploymentInitContainers(item runtime.Object) []v1.Container {
return item.(*appsv1.Deployment).Spec.Template.Spec.InitContainers
}
// GetCronJobInitContainers returns the containers of given cronjob
func GetCronJobInitContainers(item runtime.Object) []v1.Container {
return item.(*batchv1.CronJob).Spec.JobTemplate.Spec.Template.Spec.InitContainers
}
// GetDaemonSetInitContainers returns the containers of given daemonSet
func GetDaemonSetInitContainers(item runtime.Object) []v1.Container {
return item.(*appsv1.DaemonSet).Spec.Template.Spec.InitContainers
@@ -250,6 +291,18 @@ func UpdateDeployment(clients kube.Clients, namespace string, resource runtime.O
return err
}
// CreateJobFromCronjob performs rolling upgrade on cronjob
func CreateJobFromCronjob(clients kube.Clients, namespace string, resource runtime.Object) error {
cronJob := resource.(*batchv1.CronJob)
job := &batchv1.Job{
ObjectMeta: cronJob.Spec.JobTemplate.ObjectMeta,
Spec: cronJob.Spec.JobTemplate.Spec,
}
job.GenerateName = cronJob.Name + "-"
_, err := clients.KubernetesClient.BatchV1().Jobs(namespace).Create(context.TODO(), job, meta_v1.CreateOptions{FieldManager: "Reloader"})
return err
}
// UpdateDaemonSet performs rolling upgrade on daemonSet
func UpdateDaemonSet(clients kube.Clients, namespace string, resource runtime.Object) error {
daemonSet := resource.(*appsv1.DaemonSet)
@@ -286,6 +339,11 @@ func GetDeploymentVolumes(item runtime.Object) []v1.Volume {
return item.(*appsv1.Deployment).Spec.Template.Spec.Volumes
}
// GetCronJobVolumes returns the Volumes of given cronjob
func GetCronJobVolumes(item runtime.Object) []v1.Volume {
return item.(*batchv1.CronJob).Spec.JobTemplate.Spec.Template.Spec.Volumes
}
// GetDaemonSetVolumes returns the Volumes of given daemonSet
func GetDaemonSetVolumes(item runtime.Object) []v1.Volume {
return item.(*appsv1.DaemonSet).Spec.Template.Spec.Volumes

View File

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"net/http"
"os"
"strings"
@@ -12,12 +13,14 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"github.com/stakater/Reloader/internal/pkg/controller"
"github.com/stakater/Reloader/internal/pkg/metrics"
"github.com/stakater/Reloader/internal/pkg/options"
"github.com/stakater/Reloader/internal/pkg/util"
"github.com/stakater/Reloader/pkg/kube"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NewReloaderCommand starts the reloader controller
@@ -30,19 +33,26 @@ func NewReloaderCommand() *cobra.Command {
}
// options
cmd.PersistentFlags().BoolVar(&options.AutoReloadAll, "auto-reload-all", false, "Auto reload all resources")
cmd.PersistentFlags().StringVar(&options.ConfigmapUpdateOnChangeAnnotation, "configmap-annotation", "configmap.reloader.stakater.com/reload", "annotation to detect changes in configmaps, specified by name")
cmd.PersistentFlags().StringVar(&options.SecretUpdateOnChangeAnnotation, "secret-annotation", "secret.reloader.stakater.com/reload", "annotation to detect changes in secrets, specified by name")
cmd.PersistentFlags().StringVar(&options.ReloaderAutoAnnotation, "auto-annotation", "reloader.stakater.com/auto", "annotation to detect changes in secrets")
cmd.PersistentFlags().StringVar(&options.ReloaderAutoAnnotation, "auto-annotation", "reloader.stakater.com/auto", "annotation to detect changes in secrets/configmaps")
cmd.PersistentFlags().StringVar(&options.ConfigmapReloaderAutoAnnotation, "configmap-auto-annotation", "configmap.reloader.stakater.com/auto", "annotation to detect changes in configmaps")
cmd.PersistentFlags().StringVar(&options.SecretReloaderAutoAnnotation, "secret-auto-annotation", "secret.reloader.stakater.com/auto", "annotation to detect changes in secrets")
cmd.PersistentFlags().StringVar(&options.AutoSearchAnnotation, "auto-search-annotation", "reloader.stakater.com/search", "annotation to detect changes in configmaps or secrets tagged with special match annotation")
cmd.PersistentFlags().StringVar(&options.SearchMatchAnnotation, "search-match-annotation", "reloader.stakater.com/match", "annotation to mark secrets or configmapts to match the search")
cmd.PersistentFlags().StringVar(&options.LogFormat, "log-format", "", "Log format to use (empty string for text, or JSON")
cmd.PersistentFlags().StringVar(&options.SearchMatchAnnotation, "search-match-annotation", "reloader.stakater.com/match", "annotation to mark secrets or configmaps to match the search")
cmd.PersistentFlags().StringVar(&options.LogFormat, "log-format", "", "Log format to use (empty string for text, or JSON)")
cmd.PersistentFlags().StringVar(&options.LogLevel, "log-level", "info", "Log level to use (trace, debug, info, warning, error, fatal and panic)")
cmd.PersistentFlags().StringVar(&options.WebhookUrl, "webhook-url", "", "webhook to trigger instead of performing a reload")
cmd.PersistentFlags().StringSlice("resources-to-ignore", []string{}, "list of resources to ignore (valid options 'configMaps' or 'secrets')")
cmd.PersistentFlags().StringSlice("namespaces-to-ignore", []string{}, "list of namespaces to ignore")
cmd.PersistentFlags().StringSlice("namespace-selector", []string{}, "list of key:vaule namespace labels to include")
cmd.PersistentFlags().StringSlice("namespace-selector", []string{}, "list of key:value labels to filter on for namespaces")
cmd.PersistentFlags().StringSlice("resource-label-selector", []string{}, "list of key:value labels to filter on for configmaps and secrets")
cmd.PersistentFlags().StringVar(&options.IsArgoRollouts, "is-Argo-Rollouts", "false", "Add support for argo rollouts")
cmd.PersistentFlags().StringVar(&options.ReloadStrategy, constants.ReloadStrategyFlag, constants.EnvVarsReloadStrategy, "Specifies the desired reload strategy")
cmd.PersistentFlags().StringVar(&options.ReloadOnCreate, "reload-on-create", "false", "Add support to watch create events")
cmd.PersistentFlags().BoolVar(&options.EnableHA, "enable-ha", false, "Adds support for running multiple replicas via leadership election")
cmd.PersistentFlags().BoolVar(&options.SyncAfterRestart, "sync-after-restart", false, "Sync add events after reloader restarts")
return cmd
}
@@ -72,7 +82,7 @@ func validateFlags(*cobra.Command, []string) error {
return nil
}
func configureLogging(logFormat string) error {
func configureLogging(logFormat, logLevel string) error {
switch logFormat {
case "json":
logrus.SetFormatter(&logrus.JSONFormatter{})
@@ -82,6 +92,12 @@ func configureLogging(logFormat string) error {
return fmt.Errorf("unsupported logging formatter: %q", logFormat)
}
}
// set log level
level, err := logrus.ParseLevel(logLevel)
if err != nil {
return err
}
logrus.SetLevel(level)
return nil
}
@@ -105,7 +121,7 @@ func getHAEnvs() (string, string) {
}
func startReloader(cmd *cobra.Command, args []string) {
err := configureLogging(options.LogFormat)
err := configureLogging(options.LogFormat, options.LogLevel)
if err != nil {
logrus.Warn(err)
}
@@ -138,19 +154,32 @@ func startReloader(cmd *cobra.Command, args []string) {
logrus.Fatal(err)
}
resourceLabelSelector, err := getResourceLabelSelector(cmd)
if err != nil {
logrus.Fatal(err)
}
if len(namespaceLabelSelector) > 0 {
logrus.Warnf("namespace-selector is set, will detect changes in namespaces with these labels: %s.", namespaceLabelSelector)
logrus.Warnf("namespace-selector is set, will only detect changes in namespaces with these labels: %s.", namespaceLabelSelector)
}
if len(resourceLabelSelector) > 0 {
logrus.Warnf("resource-label-selector is set, will only detect changes on resources with these labels: %s.", resourceLabelSelector)
}
if options.WebhookUrl != "" {
logrus.Warnf("webhook-url is set, will only send webhook, no resources will be reloaded")
}
collectors := metrics.SetupPrometheusEndpoint()
var controllers []*controller.Controller
for k := range kube.ResourceMap {
if ignoredResourcesList.Contains(k) {
if ignoredResourcesList.Contains(k) || (len(namespaceLabelSelector) == 0 && k == "namespaces") {
continue
}
c, err := controller.NewController(clientset, k, currentNamespace, ignoredNamespacesList, namespaceLabelSelector, collectors)
c, err := controller.NewController(clientset, k, currentNamespace, ignoredNamespacesList, namespaceLabelSelector, resourceLabelSelector, collectors)
if err != nil {
logrus.Fatalf("%s", err)
}
@@ -177,26 +206,80 @@ func startReloader(cmd *cobra.Command, args []string) {
go leadership.RunLeaderElection(lock, ctx, cancel, podName, controllers)
}
logrus.Fatal(leadership.Healthz())
leadership.SetupLivenessEndpoint()
logrus.Fatal(http.ListenAndServe(constants.DefaultHttpListenAddr, nil))
}
func getIgnoredNamespacesList(cmd *cobra.Command) (util.List, error) {
return getStringSliceFromFlags(cmd, "namespaces-to-ignore")
}
func getNamespaceLabelSelector(cmd *cobra.Command) (util.Map, error) {
func getNamespaceLabelSelector(cmd *cobra.Command) (string, error) {
slice, err := getStringSliceFromFlags(cmd, "namespace-selector")
if err != nil {
logrus.Fatal(err)
}
var namespaceSelectorMap util.Map = make(util.Map)
for _, kv := range slice {
split := strings.Split(kv, ":")
namespaceSelectorMap[split[0]] = split[1]
for i, kv := range slice {
// Legacy support for ":" as a delimiter and "*" for wildcard.
if strings.Contains(kv, ":") {
split := strings.Split(kv, ":")
if split[1] == "*" {
slice[i] = split[0]
} else {
slice[i] = split[0] + "=" + split[1]
}
}
// Convert wildcard to valid apimachinery operator
if strings.Contains(kv, "=") {
split := strings.Split(kv, "=")
if split[1] == "*" {
slice[i] = split[0]
}
}
}
return namespaceSelectorMap, nil
namespaceLabelSelector := strings.Join(slice[:], ",")
_, err = labels.Parse(namespaceLabelSelector)
if err != nil {
logrus.Fatal(err)
}
return namespaceLabelSelector, nil
}
func getResourceLabelSelector(cmd *cobra.Command) (string, error) {
slice, err := getStringSliceFromFlags(cmd, "resource-label-selector")
if err != nil {
logrus.Fatal(err)
}
for i, kv := range slice {
// Legacy support for ":" as a delimiter and "*" for wildcard.
if strings.Contains(kv, ":") {
split := strings.Split(kv, ":")
if split[1] == "*" {
slice[i] = split[0]
} else {
slice[i] = split[0] + "=" + split[1]
}
}
// Convert wildcard to valid apimachinery operator
if strings.Contains(kv, "=") {
split := strings.Split(kv, "=")
if split[1] == "*" {
slice[i] = split[0]
}
}
}
resourceLabelSelector := strings.Join(slice[:], ",")
_, err = labels.Parse(resourceLabelSelector)
if err != nil {
logrus.Fatal(err)
}
return resourceLabelSelector, nil
}
func getStringSliceFromFlags(cmd *cobra.Command, flag string) ([]string, error) {

View File

@@ -1,6 +1,9 @@
package constants
const (
// DefaultHttpListenAddr is the default listening address for global http server
DefaultHttpListenAddr = ":9090"
// ConfigmapEnvVarPostfix is a postfix for configmap envVar
ConfigmapEnvVarPostfix = "CONFIGMAP"
// SecretEnvVarPostfix is a postfix for secret envVar

View File

@@ -1,7 +1,6 @@
package controller
import (
"context"
"fmt"
"time"
@@ -22,6 +21,7 @@ import (
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
"k8s.io/kubectl/pkg/scheme"
"k8s.io/utils/strings/slices"
)
// Controller for checking events
@@ -31,24 +31,35 @@ type Controller struct {
queue workqueue.RateLimitingInterface
informer cache.Controller
namespace string
resource string
ignoredNamespaces util.List
collectors metrics.Collectors
recorder record.EventRecorder
namespaceSelector map[string]string
namespaceSelector string
resourceSelector string
}
// controllerInitialized flag determines whether controlled is being initialized
var controllerInitialized bool = false
var secretControllerInitialized bool = false
var configmapControllerInitialized bool = false
var selectedNamespacesCache []string
// NewController for initializing a Controller
func NewController(
client kubernetes.Interface, resource string, namespace string, ignoredNamespaces []string, namespaceLabelSelector map[string]string, collectors metrics.Collectors) (*Controller, error) {
client kubernetes.Interface, resource string, namespace string, ignoredNamespaces []string, namespaceLabelSelector string, resourceLabelSelector string, collectors metrics.Collectors) (*Controller, error) {
if options.SyncAfterRestart {
secretControllerInitialized = true
configmapControllerInitialized = true
}
c := Controller{
client: client,
namespace: namespace,
ignoredNamespaces: ignoredNamespaces,
namespaceSelector: namespaceLabelSelector,
resourceSelector: resourceLabelSelector,
resource: resource,
}
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{
@@ -57,7 +68,18 @@ func NewController(
recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: fmt.Sprintf("reloader-%s", resource)})
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
listWatcher := cache.NewListWatchFromClient(client.CoreV1().RESTClient(), resource, namespace, fields.Everything())
optionsModifier := func(options *metav1.ListOptions) {
if resource == "namespaces" {
options.LabelSelector = c.namespaceSelector
} else if len(c.resourceSelector) > 0 {
options.LabelSelector = c.resourceSelector
} else {
options.FieldSelector = fields.Everything().String()
}
}
listWatcher := cache.NewFilteredListWatchFromClient(client.CoreV1().RESTClient(), resource, namespace, optionsModifier)
indexer, informer := cache.NewIndexerInformer(listWatcher, kube.ResourceMap[resource], 0, cache.ResourceEventHandlerFuncs{
AddFunc: c.Add,
@@ -76,8 +98,15 @@ func NewController(
// Add function to add a new object to the queue in case of creating a resource
func (c *Controller) Add(obj interface{}) {
switch object := obj.(type) {
case *v1.Namespace:
c.addSelectedNamespaceToCache(*object)
return
}
if options.ReloadOnCreate == "true" {
if !c.resourceInIgnoredNamespace(obj) && c.resourceInNamespaceSelector(obj) && controllerInitialized {
if !c.resourceInIgnoredNamespace(obj) && c.resourceInSelectedNamespaces(obj) && secretControllerInitialized && configmapControllerInitialized {
c.queue.Add(handler.ResourceCreatedHandler{
Resource: obj,
Collectors: c.collectors,
@@ -97,45 +126,47 @@ func (c *Controller) resourceInIgnoredNamespace(raw interface{}) bool {
return false
}
func (c *Controller) resourceInNamespaceSelector(raw interface{}) bool {
func (c *Controller) resourceInSelectedNamespaces(raw interface{}) bool {
if len(c.namespaceSelector) == 0 {
return true
}
switch object := raw.(type) {
case *v1.ConfigMap:
return c.matchLabels(object.ObjectMeta.Namespace)
if slices.Contains(selectedNamespacesCache, object.GetNamespace()) {
return true
}
case *v1.Secret:
return c.matchLabels(object.ObjectMeta.Namespace)
if slices.Contains(selectedNamespacesCache, object.GetNamespace()) {
return true
}
}
return true
return false
}
func (c *Controller) matchLabels(resourceNamespace string) bool {
namespace, err := c.client.CoreV1().Namespaces().Get(context.Background(), resourceNamespace, metav1.GetOptions{})
if err != nil {
logrus.Warn(err)
return false
}
func (c *Controller) addSelectedNamespaceToCache(namespace v1.Namespace) {
selectedNamespacesCache = append(selectedNamespacesCache, namespace.GetName())
logrus.Infof("added namespace to be watched: %s", namespace.GetName())
}
for selectorKey, selectorVal := range c.namespaceSelector {
namespaceLabelVal, namespaceLabelKeyExists := namespace.ObjectMeta.Labels[selectorKey]
if namespaceLabelKeyExists && selectorVal == "*" {
continue
}
if !namespaceLabelKeyExists || selectorVal != namespaceLabelVal {
return false
func (c *Controller) removeSelectedNamespaceFromCache(namespace v1.Namespace) {
for i, v := range selectedNamespacesCache {
if v == namespace.GetName() {
selectedNamespacesCache = append(selectedNamespacesCache[:i], selectedNamespacesCache[i+1:]...)
logrus.Infof("removed namespace from watch: %s", namespace.GetName())
return
}
}
return true
}
// Update function to add an old object and a new object to the queue in case of updating a resource
func (c *Controller) Update(old interface{}, new interface{}) {
if !c.resourceInIgnoredNamespace(new) && c.resourceInNamespaceSelector(new) {
switch new.(type) {
case *v1.Namespace:
return
}
if !c.resourceInIgnoredNamespace(new) && c.resourceInSelectedNamespaces(new) {
c.queue.Add(handler.ResourceUpdatedHandler{
Resource: new,
OldResource: old,
@@ -147,6 +178,12 @@ func (c *Controller) Update(old interface{}, new interface{}) {
// Delete function to add an object to the queue in case of deleting a resource
func (c *Controller) Delete(old interface{}) {
switch object := old.(type) {
case *v1.Namespace:
c.removeSelectedNamespaceFromCache(*object)
return
}
// Todo: Any future delete event can be handled here
}
@@ -175,7 +212,11 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
func (c *Controller) runWorker() {
// At this point the controller is fully initialized and we can start processing the resources
controllerInitialized = true
if c.resource == "secrets" {
secretControllerInitialized = true
} else if c.resource == "configMaps" {
configmapControllerInitialized = true
}
for c.processNextItem() {
}

View File

@@ -45,7 +45,10 @@ func TestMain(m *testing.M) {
logrus.Infof("Creating controller")
for k := range kube.ResourceMap {
c, err := NewController(clients.KubernetesClient, k, namespace, []string{}, map[string]string{}, collectors)
if k == "namespaces" {
continue
}
c, err := NewController(clients.KubernetesClient, k, namespace, []string{}, "", "", collectors)
if err != nil {
logrus.Fatalf("%s", err)
}
@@ -2291,7 +2294,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
queue workqueue.RateLimitingInterface
informer cache.Controller
namespace v1.Namespace
namespaceSelector util.Map
namespaceSelector string
}
type args struct {
raw interface{}
@@ -2305,10 +2308,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
{
name: "TestConfigMapResourceInNamespaceSelector",
fields: fields{
namespaceSelector: util.Map{
"select": "this",
"select2": "this2",
},
namespaceSelector: "select=this,select2=this2",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
@@ -2326,10 +2326,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
}, {
name: "TestConfigMapResourceNotInNamespaceSelector",
fields: fields{
namespaceSelector: util.Map{
"select": "this",
"select2": "this2",
},
namespaceSelector: "select=this,select2=this2",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "not-selected-namespace",
@@ -2345,10 +2342,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
{
name: "TestSecretResourceInNamespaceSelector",
fields: fields{
namespaceSelector: util.Map{
"select": "this",
"select2": "this2",
},
namespaceSelector: "select=this,select2=this2",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
@@ -2366,10 +2360,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
}, {
name: "TestSecretResourceNotInNamespaceSelector",
fields: fields{
namespaceSelector: util.Map{
"select": "this",
"select2": "this2",
},
namespaceSelector: "select=this,select2=this2",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "not-selected-namespace",
@@ -2382,11 +2373,9 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
},
want: false,
}, {
name: "TestSecretResourceInNamespaceSelectorWiledcardValue",
name: "TestSecretResourceInNamespaceSelectorKeyExists",
fields: fields{
namespaceSelector: util.Map{
"select": "*",
},
namespaceSelector: "select",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
@@ -2400,6 +2389,59 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
raw: testutil.GetSecret("selected-namespace", "secret", "test"),
},
want: true,
}, {
name: "TestSecretResourceInNamespaceSelectorValueIn",
fields: fields{
namespaceSelector: "select in (select1, select2, select3)",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
Labels: map[string]string{
"select": "select2",
},
},
},
},
args: args{
raw: testutil.GetSecret("selected-namespace", "secret", "test"),
},
want: true,
}, {
name: "TestSecretResourceInNamespaceSelectorKeyDoesNotExist",
fields: fields{
namespaceSelector: "!select2",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
Labels: map[string]string{
"select": "this",
},
},
},
},
args: args{
raw: testutil.GetSecret("selected-namespace", "secret", "test"),
},
want: true,
}, {
name: "TestSecretResourceInNamespaceSelectorMultipleConditions",
fields: fields{
namespaceSelector: "select,select2=this2,select3!=this4",
namespace: v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "selected-namespace",
Labels: map[string]string{
"select": "this",
"select2": "this2",
"select3": "this3",
},
},
},
},
args: args{
raw: testutil.GetSecret("selected-namespace", "secret", "test"),
},
want: true,
},
}
@@ -2407,7 +2449,7 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
fakeClient := fake.NewSimpleClientset()
namespace, _ := fakeClient.CoreV1().Namespaces().Create(context.Background(), &tt.fields.namespace, metav1.CreateOptions{})
logrus.Infof("created fakeClient namesapce for testing = %s", namespace.Name)
logrus.Infof("created fakeClient namespace for testing = %s", namespace.Name)
c := &Controller{
client: fakeClient,
@@ -2418,9 +2460,21 @@ func TestController_resourceInNamespaceSelector(t *testing.T) {
namespaceSelector: tt.fields.namespaceSelector,
}
if got := c.resourceInNamespaceSelector(tt.args.raw); got != tt.want {
listOptions := metav1.ListOptions{}
listOptions.LabelSelector = tt.fields.namespaceSelector
namespaces, _ := fakeClient.CoreV1().Namespaces().List(context.Background(), listOptions)
for _, ns := range namespaces.Items {
c.addSelectedNamespaceToCache(ns)
}
if got := c.resourceInSelectedNamespaces(tt.args.raw); got != tt.want {
t.Errorf("Controller.resourceInNamespaceSelector() = %v, want %v", got, tt.want)
}
for _, ns := range namespaces.Items {
c.removeSelectedNamespaceFromCache(ns)
}
})
}
}

View File

@@ -3,6 +3,7 @@ package handler
import (
"github.com/sirupsen/logrus"
"github.com/stakater/Reloader/internal/pkg/metrics"
"github.com/stakater/Reloader/internal/pkg/options"
"github.com/stakater/Reloader/internal/pkg/util"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/record"
@@ -21,6 +22,10 @@ func (r ResourceCreatedHandler) Handle() error {
logrus.Errorf("Resource creation handler received nil resource")
} else {
config, _ := r.GetConfig()
// Send webhook
if options.WebhookUrl != "" {
return sendUpgradeWebhook(config, options.WebhookUrl)
}
// process resource based on its type
return doRollingUpgrade(config, r.Collectors, r.Recorder)
}

View File

@@ -3,6 +3,7 @@ package handler
import (
"github.com/sirupsen/logrus"
"github.com/stakater/Reloader/internal/pkg/metrics"
"github.com/stakater/Reloader/internal/pkg/options"
"github.com/stakater/Reloader/internal/pkg/util"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/record"
@@ -23,6 +24,10 @@ func (r ResourceUpdatedHandler) Handle() error {
} else {
config, oldSHAData := r.GetConfig()
if config.SHAValue != oldSHAData {
// Send a webhook if update
if options.WebhookUrl != "" {
return sendUpgradeWebhook(config, options.WebhookUrl)
}
// process resource based on its type
return doRollingUpgrade(config, r.Collectors, r.Recorder)
}

View File

@@ -1,14 +1,17 @@
package handler
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"os"
"regexp"
"strconv"
"strings"
"github.com/parnurzeal/gorequest"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
alert "github.com/stakater/Reloader/internal/pkg/alerts"
@@ -38,6 +41,20 @@ func GetDeploymentRollingUpgradeFuncs() callbacks.RollingUpgradeFuncs {
}
}
// GetDeploymentRollingUpgradeFuncs returns all callback funcs for a cronjob
func GetCronJobCreateJobFuncs() callbacks.RollingUpgradeFuncs {
return callbacks.RollingUpgradeFuncs{
ItemsFunc: callbacks.GetCronJobItems,
AnnotationsFunc: callbacks.GetCronJobAnnotations,
PodAnnotationsFunc: callbacks.GetCronJobPodAnnotations,
ContainersFunc: callbacks.GetCronJobContainers,
InitContainersFunc: callbacks.GetCronJobInitContainers,
UpdateFunc: callbacks.CreateJobFromCronjob,
VolumesFunc: callbacks.GetCronJobVolumes,
ResourceType: "CronJob",
}
}
// GetDaemonSetRollingUpgradeFuncs returns all callback funcs for a daemonset
func GetDaemonSetRollingUpgradeFuncs() callbacks.RollingUpgradeFuncs {
return callbacks.RollingUpgradeFuncs{
@@ -94,6 +111,37 @@ func GetArgoRolloutRollingUpgradeFuncs() callbacks.RollingUpgradeFuncs {
}
}
func sendUpgradeWebhook(config util.Config, webhookUrl string) error {
message := fmt.Sprintf("Changes detected in '%s' of type '%s' in namespace '%s'", config.ResourceName, config.Type, config.Namespace)
message += fmt.Sprintf(", Sending webhook to '%s'", webhookUrl)
logrus.Infof(message)
body, errs := sendWebhook(webhookUrl)
if errs != nil {
// return the first error
return errs[0]
} else {
logrus.Info(body)
}
return nil
}
func sendWebhook(url string) (string, []error) {
request := gorequest.New()
resp, _, err := request.Post(url).Send(`{"webhook":"update successful"}`).End()
if err != nil {
// the reloader seems to retry automatically so no retry logic added
return "", err
}
defer resp.Body.Close()
var buffer bytes.Buffer
_, bufferErr := io.Copy(&buffer, resp.Body)
if bufferErr != nil {
logrus.Error(bufferErr)
}
return buffer.String(), nil
}
func doRollingUpgrade(config util.Config, collectors metrics.Collectors, recorder record.EventRecorder) error {
clients := kube.GetClients()
@@ -101,6 +149,10 @@ func doRollingUpgrade(config util.Config, collectors metrics.Collectors, recorde
if err != nil {
return err
}
err = rollingUpgrade(clients, config, GetCronJobCreateJobFuncs(), collectors, recorder)
if err != nil {
return err
}
err = rollingUpgrade(clients, config, GetDaemonSetRollingUpgradeFuncs(), collectors, recorder)
if err != nil {
return err
@@ -146,15 +198,18 @@ func PerformRollingUpgrade(clients kube.Clients, config util.Config, upgradeFunc
annotationValue, found := annotations[config.Annotation]
searchAnnotationValue, foundSearchAnn := annotations[options.AutoSearchAnnotation]
reloaderEnabledValue, foundAuto := annotations[options.ReloaderAutoAnnotation]
if !found && !foundAuto && !foundSearchAnn {
typedAutoAnnotationEnabledValue, foundTypedAuto := annotations[config.TypedAutoAnnotation]
if !found && !foundAuto && !foundTypedAuto && !foundSearchAnn {
annotations = upgradeFuncs.PodAnnotationsFunc(i)
annotationValue = annotations[config.Annotation]
searchAnnotationValue = annotations[options.AutoSearchAnnotation]
reloaderEnabledValue = annotations[options.ReloaderAutoAnnotation]
typedAutoAnnotationEnabledValue = annotations[config.TypedAutoAnnotation]
}
result := constants.NotUpdated
reloaderEnabled, err := strconv.ParseBool(reloaderEnabledValue)
if err == nil && reloaderEnabled {
reloaderEnabled, _ := strconv.ParseBool(reloaderEnabledValue)
typedAutoAnnotationEnabled, _ := strconv.ParseBool(typedAutoAnnotationEnabledValue)
if reloaderEnabled || typedAutoAnnotationEnabled || reloaderEnabledValue == "" && typedAutoAnnotationEnabledValue == "" && options.AutoReloadAll {
result = invokeReloadStrategy(upgradeFuncs, i, config, true)
}

View File

@@ -25,43 +25,48 @@ import (
var (
clients = kube.Clients{KubernetesClient: testclient.NewSimpleClientset()}
arsNamespace = "test-handler-" + testutil.RandSeq(5)
arsConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
arsSecretName = "testsecret-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
arsProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
arsConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
arsSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
arsProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
arsConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
arsSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
arsSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
arsSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
arsConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
arsNamespace = "test-handler-" + testutil.RandSeq(5)
arsConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
arsSecretName = "testsecret-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
arsProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
arsConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
arsSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
arsProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
arsConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
arsSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
arsSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
arsSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
arsConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
arsConfigMapWithNonAnnotatedDeployment = "testconfigmapNonAnnotatedDeployment-handler-" + testutil.RandSeq(5)
arsSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
arsConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersNamespace = "test-handler-" + testutil.RandSeq(5)
ersConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
ersSecretName = "testsecret-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
ersProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
ersConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
ersSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
ersProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
ersConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
ersSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
ersSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
ersSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
ersConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
ersNamespace = "test-handler-" + testutil.RandSeq(5)
ersConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
ersSecretName = "testsecret-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
ersProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
ersConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
ersSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
ersProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
ersConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
ersSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
ersSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
ersSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
ersConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
ersSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
)
func TestMain(m *testing.M) {
@@ -70,17 +75,17 @@ func TestMain(m *testing.M) {
testutil.CreateNamespace(arsNamespace, clients.KubernetesClient)
testutil.CreateNamespace(ersNamespace, clients.KubernetesClient)
logrus.Infof("Setting up the env-var reload strategy test resources")
setupArs()
logrus.Infof("Setting up the annotation reload strategy test resources")
setupArs()
logrus.Infof("Setting up the env-var reload strategy test resources")
setupErs()
logrus.Infof("Running Testcases")
retCode := m.Run()
logrus.Infof("tearing down the env-var reload strategy test resources")
teardownArs()
logrus.Infof("tearing down the annotation reload strategy test resources")
teardownArs()
logrus.Infof("tearing down the env-var reload strategy test resources")
teardownErs()
os.Exit(retCode)
@@ -173,6 +178,23 @@ func setupArs() {
logrus.Errorf("Error in configmap creation: %v", err)
}
_, err = testutil.CreateConfigMap(clients.KubernetesClient, arsNamespace, arsConfigMapWithNonAnnotatedDeployment, "www.google.com")
if err != nil {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating secret used with secret auto annotation
_, err = testutil.CreateSecret(clients.KubernetesClient, arsNamespace, arsSecretWithSecretAutoAnnotation, data)
if err != nil {
logrus.Errorf("Error in secret creation: %v", err)
}
// Creating configmap used with configmap auto annotation
_, err = testutil.CreateConfigMap(clients.KubernetesClient, arsNamespace, arsConfigmapWithConfigMapAutoAnnotation, "www.google.com")
if err != nil {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating Deployment with configmap
_, err = testutil.CreateDeployment(clients.KubernetesClient, arsConfigmapName, arsNamespace, true)
if err != nil {
@@ -268,6 +290,24 @@ func setupArs() {
logrus.Errorf("Error in Deployment with secret configmap as envFrom source creation: %v", err)
}
// Creating Deployment with configmap and without annotations
_, err = testutil.CreateDeploymentWithEnvVarSourceAndAnnotations(clients.KubernetesClient, arsConfigMapWithNonAnnotatedDeployment, arsNamespace, map[string]string{})
if err != nil {
logrus.Errorf("Error in Deployment with configmap and without annotation creation: %v", err)
}
// Creating Deployment with secret and with secret auto annotation
_, err = testutil.CreateDeploymentWithTypedAutoAnnotation(clients.KubernetesClient, arsSecretWithSecretAutoAnnotation, arsNamespace, testutil.SecretResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with secret and with secret auto annotation: %v", err)
}
// Creating Deployment with secret and with secret auto annotation
_, err = testutil.CreateDeploymentWithTypedAutoAnnotation(clients.KubernetesClient, arsConfigmapWithConfigMapAutoAnnotation, arsNamespace, testutil.ConfigmapResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with configmap and with configmap auto annotation: %v", err)
}
// Creating DaemonSet with configmap
_, err = testutil.CreateDaemonSet(clients.KubernetesClient, arsConfigmapName, arsNamespace, true)
if err != nil {
@@ -348,6 +388,7 @@ func setupArs() {
// Creating Deployment with both annotations
_, err = testutil.CreateDeploymentWithPodAnnotations(clients.KubernetesClient, arsConfigmapWithBothAnnotations, arsNamespace, true)
if err != nil {
logrus.Errorf("Error in Deployment with both annotations: %v", err)
}
@@ -456,6 +497,18 @@ func teardownArs() {
logrus.Errorf("Error while deleting deployment with search annotation %v", deploymentError)
}
// Deleting Deployment with secret and secret auto annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, arsNamespace, arsSecretWithSecretAutoAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with secret auto annotation %v", deploymentError)
}
// Deleting Deployment with configmap and configmap auto annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, arsNamespace, arsConfigmapWithConfigMapAutoAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with configmap auto annotation %v", deploymentError)
}
// Deleting DaemonSet with configmap
daemonSetError := testutil.DeleteDaemonSet(clients.KubernetesClient, arsNamespace, arsConfigmapName)
if daemonSetError != nil {
@@ -617,6 +670,18 @@ func teardownArs() {
logrus.Errorf("Error while deleting the configmap used with pod annotations: %v", err)
}
// Deleting Secret used with secret auto annotation
err = testutil.DeleteSecret(clients.KubernetesClient, arsNamespace, arsSecretWithSecretAutoAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the secret used with secret auto annotations: %v", err)
}
// Deleting ConfigMap used with configmap auto annotation
err = testutil.DeleteConfigMap(clients.KubernetesClient, arsNamespace, arsConfigmapWithConfigMapAutoAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the configmap used with configmap auto annotations: %v", err)
}
// Deleting namespace
testutil.DeleteNamespace(arsNamespace, clients.KubernetesClient)
@@ -709,6 +774,18 @@ func setupErs() {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating secret used with secret auto annotation
_, err = testutil.CreateSecret(clients.KubernetesClient, ersNamespace, ersSecretWithSecretAutoAnnotation, data)
if err != nil {
logrus.Errorf("Error in secret creation: %v", err)
}
// Creating configmap used with configmap auto annotation
_, err = testutil.CreateConfigMap(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapAutoAnnotation, "www.google.com")
if err != nil {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating Deployment with configmap
_, err = testutil.CreateDeployment(clients.KubernetesClient, ersConfigmapName, ersNamespace, true)
if err != nil {
@@ -804,6 +881,18 @@ func setupErs() {
logrus.Errorf("Error in Deployment with secret configmap as envFrom source creation: %v", err)
}
// Creating Deployment with secret and with secret auto annotation
_, err = testutil.CreateDeploymentWithTypedAutoAnnotation(clients.KubernetesClient, ersSecretWithSecretAutoAnnotation, ersNamespace, testutil.SecretResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with secret and with secret auto annotation: %v", err)
}
// Creating Deployment with secret and with secret auto annotation
_, err = testutil.CreateDeploymentWithTypedAutoAnnotation(clients.KubernetesClient, ersConfigmapWithConfigMapAutoAnnotation, ersNamespace, testutil.ConfigmapResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with configmap and with configmap auto annotation: %v", err)
}
// Creating DaemonSet with configmap
_, err = testutil.CreateDaemonSet(clients.KubernetesClient, ersConfigmapName, ersNamespace, true)
if err != nil {
@@ -992,6 +1081,18 @@ func teardownErs() {
logrus.Errorf("Error while deleting deployment with search annotation %v", deploymentError)
}
// Deleting Deployment with secret and secret auto annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, ersNamespace, ersSecretWithSecretAutoAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with secret auto annotation %v", deploymentError)
}
// Deleting Deployment with configmap and configmap auto annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapAutoAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with configmap auto annotation %v", deploymentError)
}
// Deleting DaemonSet with configmap
daemonSetError := testutil.DeleteDaemonSet(clients.KubernetesClient, ersNamespace, ersConfigmapName)
if daemonSetError != nil {
@@ -1153,23 +1254,36 @@ func teardownErs() {
logrus.Errorf("Error while deleting the configmap used with pod annotations: %v", err)
}
// Deleting Secret used with secret auto annotation
err = testutil.DeleteSecret(clients.KubernetesClient, ersNamespace, ersSecretWithSecretAutoAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the secret used with secret auto annotation: %v", err)
}
// Deleting ConfigMap used with configmap auto annotation
err = testutil.DeleteConfigMap(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapAutoAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the configmap used with configmap auto annotation: %v", err)
}
// Deleting namespace
testutil.DeleteNamespace(ersNamespace, clients.KubernetesClient)
}
func getConfigWithAnnotations(resourceType string, name string, shaData string, annotation string) util.Config {
func getConfigWithAnnotations(resourceType string, name string, shaData string, annotation string, typedAutoAnnotation string) util.Config {
ns := ersNamespace
if options.ReloadStrategy == constants.AnnotationsReloadStrategy {
ns = arsNamespace
}
return util.Config{
Namespace: ns,
ResourceName: name,
SHAValue: shaData,
Annotation: annotation,
Type: resourceType,
Namespace: ns,
ResourceName: name,
SHAValue: shaData,
Annotation: annotation,
TypedAutoAnnotation: typedAutoAnnotation,
Type: resourceType,
}
}
@@ -1184,7 +1298,59 @@ func TestRollingUpgradeForDeploymentWithConfigmapUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with Configmap")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if !updated {
t.Errorf("Deployment was not updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
}
func TestRollingUpgradeForDeploymentWithConfigmapWithoutReloadAnnotationAndWithoutAutoReloadAllNoTriggersUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigMapWithNonAnnotatedDeployment, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigMapWithNonAnnotatedDeployment, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with Configmap")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if updated {
t.Errorf("Deployment was updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) > 0 {
t.Errorf("Counter was increased")
}
}
func TestRollingUpgradeForDeploymentWithConfigmapWithoutReloadAnnotationButWithAutoReloadAllUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
options.AutoReloadAll = true
defer func() { options.AutoReloadAll = false }()
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigMapWithNonAnnotatedDeployment, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigMapWithNonAnnotatedDeployment, shaData, "", options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1209,7 +1375,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectedVolumeUsingArs(t *te
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsProjectedConfigMapName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1233,7 +1399,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingArs(t *
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "true"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1258,7 +1424,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNoTriggersUs
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "false"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1298,7 +1464,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNotMappedUsi
// defer clients.KubernetesClient.AppsV1().Deployments(namespace).Delete(deployment.Name, &v1.DeleteOptions{})
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "false"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1323,7 +1489,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInInitContainerUsingArs(t *test
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithInitContainer, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1348,7 +1514,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectVolumeInInitContainerU
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsProjectedConfigMapWithInitContainer, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1373,7 +1539,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarUsingArs(t *testing.T)
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithEnvName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1398,7 +1564,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarInInitContainerUsingArs
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithInitEnv, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithInitEnv, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithInitEnv, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1423,7 +1589,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarFromUsingArs(t *testing
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithEnvFromName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvFromName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvFromName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1448,7 +1614,7 @@ func TestRollingUpgradeForDeploymentWithSecretUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1473,7 +1639,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeUsingArs(t *testi
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsProjectedSecretName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1498,7 +1664,7 @@ func TestRollingUpgradeForDeploymentWithSecretinInitContainerUsingArs(t *testing
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithInitContainer, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1523,7 +1689,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUs
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsProjectedSecretWithInitContainer, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1548,7 +1714,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithEnvName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithEnvName, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1573,7 +1739,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarFromUsingArs(t *testing.T)
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithEnvFromName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithEnvFromName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithEnvFromName, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1598,7 +1764,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingArs(t
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithInitEnv, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithInitEnv, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithInitEnv, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1619,11 +1785,61 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingArs(t
}
}
func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithSecretAutoAnnotation, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretWithSecretAutoAnnotation, shaData, "", options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with Secret")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if !updated {
t.Errorf("Deployment was not updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
}
func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithConfigMapAutoAnnotation, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithConfigMapAutoAnnotation, shaData, "", options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with ConfigMap")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if !updated {
t.Errorf("Deployment was not updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
}
func TestRollingUpgradeForDaemonSetWithConfigmapUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1648,7 +1864,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingArs(t *tes
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsProjectedConfigMapName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1673,7 +1889,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapAsEnvVarUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithEnvName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1698,7 +1914,7 @@ func TestRollingUpgradeForDaemonSetWithSecretUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretName, "d3d3LmZhY2Vib29rLmNvbQ==")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1723,7 +1939,7 @@ func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingArs(t *testin
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsProjectedSecretName, "d3d3LmZhY2Vib29rLmNvbQ==")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1748,7 +1964,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapName, "www.twitter.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1773,7 +1989,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingArs(t *t
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsProjectedConfigMapName, "www.twitter.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1798,7 +2014,7 @@ func TestRollingUpgradeForStatefulSetWithSecretUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretName, "d3d3LnR3aXR0ZXIuY29t")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1823,7 +2039,7 @@ func TestRollingUpgradeForStatefulSetWithSecretInProjectedVolumeUsingArs(t *test
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsProjectedSecretName, "d3d3LnR3aXR0ZXIuY29t")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, arsProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1848,7 +2064,7 @@ func TestRollingUpgradeForDeploymentWithPodAnnotationsUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithPodAnnotations, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithPodAnnotations, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapWithPodAnnotations, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1900,7 +2116,7 @@ func TestFailedRollingUpgradeUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapName, "fail.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
deploymentFuncs.UpdateFunc = func(_ kube.Clients, _ string, _ runtime.Object) error {
return fmt.Errorf("error")
@@ -1918,7 +2134,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1943,7 +2159,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectedVolumeUsingErs(t *te
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersProjectedConfigMapName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1967,7 +2183,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingErs(t *
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "true"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -1992,7 +2208,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNoTriggersUs
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "false"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2032,7 +2248,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNotMappedUsi
// defer clients.KubernetesClient.AppsV1().Deployments(namespace).Delete(deployment.Name, &v1.DeleteOptions{})
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapAnnotated, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapAnnotated, shaData, "", options.ConfigmapReloaderAutoAnnotation)
config.ResourceAnnotations = map[string]string{"reloader.stakater.com/match": "false"}
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2057,7 +2273,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInInitContainerUsingErs(t *test
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithInitContainer, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2082,7 +2298,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectVolumeInInitContainerU
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersProjectedConfigMapWithInitContainer, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapWithInitContainer, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2107,7 +2323,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarUsingErs(t *testing.T)
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithEnvName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2132,7 +2348,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarInInitContainerUsingErs
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithInitEnv, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithInitEnv, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithInitEnv, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2157,7 +2373,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarFromUsingErs(t *testing
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithEnvFromName, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvFromName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvFromName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2182,7 +2398,7 @@ func TestRollingUpgradeForDeploymentWithSecretUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2207,7 +2423,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeUsingErs(t *testi
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersProjectedSecretName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2232,7 +2448,7 @@ func TestRollingUpgradeForDeploymentWithSecretinInitContainerUsingErs(t *testing
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithInitContainer, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2257,7 +2473,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUs
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersProjectedSecretWithInitContainer, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretWithInitContainer, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2282,7 +2498,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithEnvName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithEnvName, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2307,7 +2523,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarFromUsingErs(t *testing.T)
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithEnvFromName, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithEnvFromName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithEnvFromName, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2332,7 +2548,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingErs(t
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithInitEnv, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithInitEnv, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithInitEnv, shaData, options.ReloaderAutoAnnotation, options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2353,11 +2569,61 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingErs(t
}
}
func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithSecretAutoAnnotation, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretWithSecretAutoAnnotation, shaData, "", options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with Secret")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceEnvVarUpdate(clients, config, constants.SecretEnvVarPostfix, deploymentFuncs)
if !updated {
t.Errorf("Deployment was not updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
}
func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithConfigMapAutoAnnotation, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithConfigMapAutoAnnotation, shaData, "", options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformRollingUpgrade(clients, config, deploymentFuncs, collectors, nil)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with ConfigMap")
}
logrus.Infof("Verifying deployment update")
updated := testutil.VerifyResourceEnvVarUpdate(clients, config, constants.ConfigmapEnvVarPostfix, deploymentFuncs)
if !updated {
t.Errorf("Deployment was not updated")
}
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
}
func TestRollingUpgradeForDaemonSetWithConfigmapUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2382,7 +2648,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingErs(t *tes
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersProjectedConfigMapName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2407,7 +2673,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapAsEnvVarUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithEnvName, "www.facebook.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithEnvName, shaData, options.ReloaderAutoAnnotation, options.ConfigmapReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2432,7 +2698,7 @@ func TestRollingUpgradeForDaemonSetWithSecretUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretName, "d3d3LmZhY2Vib29rLmNvbQ==")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2457,7 +2723,7 @@ func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingErs(t *testin
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersProjectedSecretName, "d3d3LmZhY2Vib29rLmNvbQ==")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2482,7 +2748,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapName, "www.twitter.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2507,7 +2773,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingErs(t *t
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersProjectedConfigMapName, "www.twitter.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersProjectedConfigMapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2532,7 +2798,7 @@ func TestRollingUpgradeForStatefulSetWithSecretUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretName, "d3d3LnR3aXR0ZXIuY29t")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2557,7 +2823,7 @@ func TestRollingUpgradeForStatefulSetWithSecretInProjectedVolumeUsingErs(t *test
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersProjectedSecretName, "d3d3LnR3aXR0ZXIuY29t")
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.SecretEnvVarPostfix, ersProjectedSecretName, shaData, options.SecretUpdateOnChangeAnnotation, options.SecretReloaderAutoAnnotation)
statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2582,7 +2848,7 @@ func TestRollingUpgradeForDeploymentWithPodAnnotationsUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithPodAnnotations, "www.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithPodAnnotations, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapWithPodAnnotations, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
@@ -2635,7 +2901,7 @@ func TestFailedRollingUpgradeUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapName, "fail.stakater.com")
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation)
config := getConfigWithAnnotations(constants.ConfigmapEnvVarPostfix, ersConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
deploymentFuncs.UpdateFunc = func(_ kube.Clients, _ string, _ runtime.Object) error {
return fmt.Errorf("error")

View File

@@ -15,8 +15,6 @@ import (
coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
)
const healthPort string = ":9091"
var (
// Used for liveness probe
m sync.Mutex
@@ -88,12 +86,11 @@ func stopControllers(stopChannels []chan struct{}) {
}
}
// Healthz serves the liveness probe endpoint. If leadership election is
// Healthz sets up the liveness probe endpoint. If leadership election is
// enabled and a replica stops leading the liveness probe will fail and the
// kubelet will restart the container.
func Healthz() error {
func SetupLivenessEndpoint() {
http.HandleFunc("/live", healthz)
return http.ListenAndServe(healthPort, nil)
}
func healthz(w http.ResponseWriter, req *http.Request) {

View File

@@ -113,13 +113,13 @@ func TestRunLeaderElection(t *testing.T) {
}
// TestRunLeaderElectionWithControllers tests that leadership election works
// wiht real controllers and that on context cancellation the controllers stop
// with real controllers and that on context cancellation the controllers stop
// running.
func TestRunLeaderElectionWithControllers(t *testing.T) {
t.Logf("Creating controller")
var controllers []*controller.Controller
for k := range kube.ResourceMap {
c, err := controller.NewController(testutil.Clients.KubernetesClient, k, testutil.Namespace, []string{}, map[string]string{}, metrics.NewCollectors())
c, err := controller.NewController(testutil.Clients.KubernetesClient, k, testutil.Namespace, []string{}, "", "", metrics.NewCollectors())
if err != nil {
logrus.Fatalf("%s", err)
}

View File

@@ -3,7 +3,6 @@ package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
"net/http"
)
@@ -33,11 +32,7 @@ func NewCollectors() Collectors {
func SetupPrometheusEndpoint() Collectors {
collectors := NewCollectors()
prometheus.MustRegister(collectors.Reloaded)
go func() {
http.Handle("/metrics", promhttp.Handler())
logrus.Fatal(http.ListenAndServe(":9090", nil))
}()
http.Handle("/metrics", promhttp.Handler())
return collectors
}

View File

@@ -3,14 +3,20 @@ package options
import "github.com/stakater/Reloader/internal/pkg/constants"
var (
// Auto reload all resources when their corresponding configmaps/secrets are updated
AutoReloadAll = false
// ConfigmapUpdateOnChangeAnnotation is an annotation to detect changes in
// configmaps specified by name
ConfigmapUpdateOnChangeAnnotation = "configmap.reloader.stakater.com/reload"
// SecretUpdateOnChangeAnnotation is an annotation to detect changes in
// secrets specified by name
SecretUpdateOnChangeAnnotation = "secret.reloader.stakater.com/reload"
// ReloaderAutoAnnotation is an annotation to detect changes in secrets
// ReloaderAutoAnnotation is an annotation to detect changes in secrets/configmaps
ReloaderAutoAnnotation = "reloader.stakater.com/auto"
// ConfigmapReloaderAutoAnnotation is an annotation to detect changes in configmaps
ConfigmapReloaderAutoAnnotation = "configmap.reloader.stakater.com/auto"
// SecretReloaderAutoAnnotation is an annotation to detect changes in secrets
SecretReloaderAutoAnnotation = "secret.reloader.stakater.com/auto"
// AutoSearchAnnotation is an annotation to detect changes in
// configmaps or triggers with the SearchMatchAnnotation
AutoSearchAnnotation = "reloader.stakater.com/search"
@@ -19,12 +25,17 @@ var (
SearchMatchAnnotation = "reloader.stakater.com/match"
// LogFormat is the log format to use (json, or empty string for default)
LogFormat = ""
// LogLevel is the log level to use (trace, debug, info, warning, error, fatal and panic)
LogLevel = ""
// IsArgoRollouts Adds support for argo rollouts
IsArgoRollouts = "false"
// ReloadStrategy Specify the update strategy
ReloadStrategy = constants.EnvVarsReloadStrategy
// ReloadOnCreate Adds support to watch create events
ReloadOnCreate = "false"
ReloadOnCreate = "false"
SyncAfterRestart = false
// EnableHA adds support for running multiple replicas via leadership election
EnableHA = false
// Url to send a request to instead of triggering a reload
WebhookUrl = ""
)

View File

@@ -69,24 +69,34 @@ func DeleteNamespace(namespace string, client kubernetes.Interface) {
}
}
func getObjectMeta(namespace string, name string, autoReload bool) metav1.ObjectMeta {
func getObjectMeta(namespace string, name string, autoReload bool, secretAutoReload bool, configmapAutoReload bool) metav1.ObjectMeta {
return metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: map[string]string{"firstLabel": "temp"},
Annotations: getAnnotations(name, autoReload),
Annotations: getAnnotations(name, autoReload, secretAutoReload, configmapAutoReload),
}
}
func getAnnotations(name string, autoReload bool) map[string]string {
func getAnnotations(name string, autoReload bool, secretAutoReload bool, configmapAutoReload bool) map[string]string {
annotations := make(map[string]string)
if autoReload {
return map[string]string{
options.ReloaderAutoAnnotation: "true"}
annotations[options.ReloaderAutoAnnotation] = "true"
}
if secretAutoReload {
annotations[options.SecretReloaderAutoAnnotation] = "true"
}
if configmapAutoReload {
annotations[options.ConfigmapReloaderAutoAnnotation] = "true"
}
return map[string]string{
options.ConfigmapUpdateOnChangeAnnotation: name,
options.SecretUpdateOnChangeAnnotation: name}
if len(annotations) > 0 {
return annotations
} else {
return map[string]string{
options.ConfigmapUpdateOnChangeAnnotation: name,
options.SecretUpdateOnChangeAnnotation: name}
}
}
func getEnvVarSources(name string) []v1.EnvFromSource {
@@ -332,7 +342,7 @@ func getPodTemplateSpecWithInitContainerAndEnv(name string) v1.PodTemplateSpec {
func GetDeployment(namespace string, deploymentName string) *appsv1.Deployment {
replicaset := int32(1)
return &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -351,7 +361,7 @@ func GetDeploymentConfig(namespace string, deploymentConfigName string) *openshi
replicaset := int32(1)
podTemplateSpecWithVolume := getPodTemplateSpecWithVolumes(deploymentConfigName)
return &openshiftv1.DeploymentConfig{
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false),
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false, false, false),
Spec: openshiftv1.DeploymentConfigSpec{
Replicas: replicaset,
Strategy: openshiftv1.DeploymentStrategy{
@@ -366,7 +376,7 @@ func GetDeploymentConfig(namespace string, deploymentConfigName string) *openshi
func GetDeploymentWithInitContainer(namespace string, deploymentName string) *appsv1.Deployment {
replicaset := int32(1)
return &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -384,7 +394,7 @@ func GetDeploymentWithInitContainer(namespace string, deploymentName string) *ap
func GetDeploymentWithInitContainerAndEnv(namespace string, deploymentName string) *appsv1.Deployment {
replicaset := int32(1)
return &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -401,7 +411,7 @@ func GetDeploymentWithInitContainerAndEnv(namespace string, deploymentName strin
func GetDeploymentWithEnvVars(namespace string, deploymentName string) *appsv1.Deployment {
replicaset := int32(1)
return &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -419,7 +429,7 @@ func GetDeploymentConfigWithEnvVars(namespace string, deploymentConfigName strin
replicaset := int32(1)
podTemplateSpecWithEnvVars := getPodTemplateSpecWithEnvVars(deploymentConfigName)
return &openshiftv1.DeploymentConfig{
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false),
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false, false, false),
Spec: openshiftv1.DeploymentConfigSpec{
Replicas: replicaset,
Strategy: openshiftv1.DeploymentStrategy{
@@ -433,7 +443,7 @@ func GetDeploymentConfigWithEnvVars(namespace string, deploymentConfigName strin
func GetDeploymentWithEnvVarSources(namespace string, deploymentName string) *appsv1.Deployment {
replicaset := int32(1)
return &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -450,7 +460,7 @@ func GetDeploymentWithEnvVarSources(namespace string, deploymentName string) *ap
func GetDeploymentWithPodAnnotations(namespace string, deploymentName string, both bool) *appsv1.Deployment {
replicaset := int32(1)
deployment := &appsv1.Deployment{
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -465,14 +475,38 @@ func GetDeploymentWithPodAnnotations(namespace string, deploymentName string, bo
if !both {
deployment.ObjectMeta.Annotations = nil
}
deployment.Spec.Template.ObjectMeta.Annotations = getAnnotations(deploymentName, true)
deployment.Spec.Template.ObjectMeta.Annotations = getAnnotations(deploymentName, true, false, false)
return deployment
}
func GetDeploymentWithTypedAutoAnnotation(namespace string, deploymentName string, resourceType string) *appsv1.Deployment {
replicaset := int32(1)
var objectMeta metav1.ObjectMeta
if resourceType == SecretResourceType {
objectMeta = getObjectMeta(namespace, deploymentName, false, true, false)
} else if resourceType == ConfigmapResourceType {
objectMeta = getObjectMeta(namespace, deploymentName, false, false, true)
}
return &appsv1.Deployment{
ObjectMeta: objectMeta,
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
},
Replicas: &replicaset,
Strategy: appsv1.DeploymentStrategy{
Type: appsv1.RollingUpdateDeploymentStrategyType,
},
Template: getPodTemplateSpecWithVolumes(deploymentName),
},
}
}
// GetDaemonSet provides daemonset for testing
func GetDaemonSet(namespace string, daemonsetName string) *appsv1.DaemonSet {
return &appsv1.DaemonSet{
ObjectMeta: getObjectMeta(namespace, daemonsetName, false),
ObjectMeta: getObjectMeta(namespace, daemonsetName, false, false, false),
Spec: appsv1.DaemonSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -487,7 +521,7 @@ func GetDaemonSet(namespace string, daemonsetName string) *appsv1.DaemonSet {
func GetDaemonSetWithEnvVars(namespace string, daemonSetName string) *appsv1.DaemonSet {
return &appsv1.DaemonSet{
ObjectMeta: getObjectMeta(namespace, daemonSetName, true),
ObjectMeta: getObjectMeta(namespace, daemonSetName, true, false, false),
Spec: appsv1.DaemonSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -503,7 +537,7 @@ func GetDaemonSetWithEnvVars(namespace string, daemonSetName string) *appsv1.Dae
// GetStatefulSet provides statefulset for testing
func GetStatefulSet(namespace string, statefulsetName string) *appsv1.StatefulSet {
return &appsv1.StatefulSet{
ObjectMeta: getObjectMeta(namespace, statefulsetName, false),
ObjectMeta: getObjectMeta(namespace, statefulsetName, false, false, false),
Spec: appsv1.StatefulSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -519,7 +553,7 @@ func GetStatefulSet(namespace string, statefulsetName string) *appsv1.StatefulSe
// GetStatefulSet provides statefulset for testing
func GetStatefulSetWithEnvVar(namespace string, statefulsetName string) *appsv1.StatefulSet {
return &appsv1.StatefulSet{
ObjectMeta: getObjectMeta(namespace, statefulsetName, true),
ObjectMeta: getObjectMeta(namespace, statefulsetName, true, false, false),
Spec: appsv1.StatefulSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -729,6 +763,16 @@ func CreateDeploymentWithEnvVarSourceAndAnnotations(client kubernetes.Interface,
return deployment, err
}
// CreateDeploymentWithTypedAutoAnnotation creates a deployment in given namespace and returns the Deployment with typed auto annotation
func CreateDeploymentWithTypedAutoAnnotation(client kubernetes.Interface, deploymentName string, namespace string, resourceType string) (*appsv1.Deployment, error) {
logrus.Infof("Creating Deployment")
deploymentClient := client.AppsV1().Deployments(namespace)
deploymentObj := GetDeploymentWithTypedAutoAnnotation(namespace, deploymentName, resourceType)
deployment, err := deploymentClient.Create(context.TODO(), deploymentObj, metav1.CreateOptions{})
time.Sleep(3 * time.Second)
return deployment, err
}
// CreateDaemonSet creates a deployment in given namespace and returns the DaemonSet
func CreateDaemonSet(client kubernetes.Interface, daemonsetName string, namespace string, volumeMount bool) (*appsv1.DaemonSet, error) {
logrus.Infof("Creating DaemonSet")
@@ -837,7 +881,6 @@ func DeleteSecret(client kubernetes.Interface, namespace string, secretName stri
// RandSeq generates a random sequence
func RandSeq(n int) string {
rand.Seed(time.Now().UnixNano())
b := make([]rune, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
@@ -859,9 +902,11 @@ func VerifyResourceEnvVarUpdate(clients kube.Clients, config util.Config, envVar
annotationValue := annotations[config.Annotation]
searchAnnotationValue := annotations[options.AutoSearchAnnotation]
reloaderEnabledValue := annotations[options.ReloaderAutoAnnotation]
typedAutoAnnotationEnabledValue := annotations[config.TypedAutoAnnotation]
reloaderEnabled, err := strconv.ParseBool(reloaderEnabledValue)
typedAutoAnnotationEnabled, errTyped := strconv.ParseBool(typedAutoAnnotationEnabledValue)
matches := false
if err == nil && reloaderEnabled {
if err == nil && reloaderEnabled || errTyped == nil && typedAutoAnnotationEnabled {
matches = true
} else if annotationValue != "" {
values := strings.Split(annotationValue, ",")
@@ -903,9 +948,11 @@ func VerifyResourceAnnotationUpdate(clients kube.Clients, config util.Config, up
annotationValue := annotations[config.Annotation]
searchAnnotationValue := annotations[options.AutoSearchAnnotation]
reloaderEnabledValue := annotations[options.ReloaderAutoAnnotation]
reloaderEnabled, err := strconv.ParseBool(reloaderEnabledValue)
typedAutoAnnotationEnabledValue := annotations[config.TypedAutoAnnotation]
reloaderEnabled, _ := strconv.ParseBool(reloaderEnabledValue)
typedAutoAnnotationEnabled, _ := strconv.ParseBool(typedAutoAnnotationEnabledValue)
matches := false
if err == nil && reloaderEnabled {
if reloaderEnabled || typedAutoAnnotationEnabled || reloaderEnabledValue == "" && typedAutoAnnotationEnabledValue == "" && options.AutoReloadAll {
matches = true
} else if annotationValue != "" {
values := strings.Split(annotationValue, ",")

View File

@@ -12,6 +12,7 @@ type Config struct {
ResourceName string
ResourceAnnotations map[string]string
Annotation string
TypedAutoAnnotation string
SHAValue string
Type string
}
@@ -23,6 +24,7 @@ func GetConfigmapConfig(configmap *v1.ConfigMap) Config {
ResourceName: configmap.Name,
ResourceAnnotations: configmap.Annotations,
Annotation: options.ConfigmapUpdateOnChangeAnnotation,
TypedAutoAnnotation: options.ConfigmapReloaderAutoAnnotation,
SHAValue: GetSHAfromConfigmap(configmap),
Type: constants.ConfigmapEnvVarPostfix,
}
@@ -35,6 +37,7 @@ func GetSecretConfig(secret *v1.Secret) Config {
ResourceName: secret.Name,
ResourceAnnotations: secret.Annotations,
Annotation: options.SecretUpdateOnChangeAnnotation,
TypedAutoAnnotation: options.SecretReloaderAutoAnnotation,
SHAValue: GetSHAfromSecret(secret.Data),
Type: constants.SecretEnvVarPostfix,
}

View File

@@ -9,4 +9,5 @@ import (
var ResourceMap = map[string]runtime.Object{
"configMaps": &v1.ConfigMap{},
"secrets": &v1.Secret{},
"namespaces": &v1.Namespace{},
}

21
renovate.json Normal file
View File

@@ -0,0 +1,21 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"labels": [
"dependencies"
],
"customManagers": [
{
"customType": "regex",
"fileMatch": [
".vale.ini"
],
"matchStrings": [
"https:\/\/github\\.com\/(?<depName>.*)\/releases\/download\/(?<currentValue>.*)\/.*\\.zip"
],
"datasourceTemplate": "github-releases"
}
]
}

1
theme_common Submodule

Submodule theme_common added at f63139f84a

22
theme_override/mkdocs.yml Normal file
View File

@@ -0,0 +1,22 @@
site_name: Stakater Reloader
docs_dir: docs
site_url: https://docs.stakater.com/reloader/
repo_url: https://github.com/stakater/reloader
edit_uri: blob/master/docs/
theme:
favicon: assets/images/favicon.svg
nav:
- index.md
- How-to Guides:
- Verify-Reloader-Working.md
- Alerting.md
- Reloader-with-Sealed-Secrets.md
- Helm2-to-Helm3.md
- References:
- How-it-works.md
- Container Build.md
- Comparisons with similar tools:
- Reloader-vs-ConfigmapController.md
- Reloader-vs-k8s-trigger-controller.md

0
theme_override/resources/.gitignore vendored Normal file
View File

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 10 KiB