Skip to content

Commit 8a6395b

Browse files
fdberlkingBenjamin Walterscheid
and
Benjamin Walterscheid
authoredFeb 7, 2024
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>
1 parent 7acf5b8 commit 8a6395b

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed
 

‎README.md

+25-28
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ By default, Reloader gets deployed in `default` namespace and watches changes `s
189189
Reloader can be configured to ignore the resources `secrets` and `configmaps` by passing the following arguments (`spec.template.spec.containers.args`) to its container :
190190

191191
| Argument | Description |
192-
| -------------------------------- | -------------------- |
192+
|----------------------------------|----------------------|
193193
| --resources-to-ignore=configMaps | To ignore configMaps |
194194
| --resources-to-ignore=secrets | To ignore secrets |
195195

@@ -199,7 +199,7 @@ Reloader can be configured to only watch secrets/configmaps with one or more lab
199199

200200
**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.
201201

202-
These selectors can be combined together, for example with:
202+
These selectors can be combined, for example with:
203203

204204
```yaml
205205
--resource-label-selector=reloader=enabled,key-exists,another-label in (value1,value2,value3)
@@ -211,20 +211,17 @@ Only configmaps or secrets labeled like the following will be watched:
211211
kind: ConfigMap
212212
apiVersion: v1
213213
metadata:
214-
...
215214
labels:
216215
reloader: enabled
217216
key-exists: yes
218217
another-label: value1
219-
220-
...
221218
```
222219

223220
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).
224221

225222
**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.
226223

227-
These selectors can be combined together, for example with:
224+
These selectors can be combined, for example with:
228225

229226
```yaml
230227
--namespace-selector=reloader=enabled,test=true
@@ -236,11 +233,9 @@ Only namespaces labeled as below would be watched and eligible for reloads:
236233
kind: Namespace
237234
apiVersion: v1
238235
metadata:
239-
...
240236
labels:
241237
reloader: enabled
242238
test: true
243-
...
244239
```
245240

246241
### Vanilla Kustomize
@@ -261,7 +256,7 @@ You can write your own `kustomization.yaml` using ours as a 'base' and write pat
261256
apiVersion: kustomize.config.k8s.io/v1beta1
262257
kind: Kustomization
263258
264-
bases:
259+
resources:
265260
- https://github.com/stakater/Reloader/deployments/kubernetes
266261
267262
namespace: reloader
@@ -287,24 +282,24 @@ helm install stakater/reloader --set reloader.watchGlobally=false --namespace te
287282

288283
Reloader can be configured to ignore the resources `secrets` and `configmaps` by using the following parameters of `values.yaml` file:
289284

290-
| Parameter | Description | Type |
291-
| ---------------- | -------------------------------------------------------------- | ------- |
292-
| ignoreSecrets | To ignore secrets. Valid value are either `true` or `false` | boolean |
293-
| ignoreConfigMaps | To ignore configMaps. Valid value are either `true` or `false` | boolean |
285+
| Parameter | Description | Type | Default |
286+
|------------------|----------------------------------------------------------------|---------|---------|
287+
| ignoreSecrets | To ignore secrets. Valid value are either `true` or `false` | boolean | false |
288+
| ignoreConfigMaps | To ignore configMaps. Valid value are either `true` or `false` | boolean | false |
294289

295290
**Note:** At one time only one of these resource can be ignored, trying to do it will cause error in helm template compilation.
296291

297292
Reloader can be configured to only watch namespaces labeled with one or more labels using the `namespaceSelector` parameter
298293

299-
| Parameter | Description | Type |
300-
| ---------------- | ---------------------------------------------------------------------------------- | ------- |
301-
| namespaceSelector | list of comma separated label selectors, if multiple are provided they are combined with the AND operator | string |
294+
| Parameter | Description | Type | Default |
295+
|-------------------|-----------------------------------------------------------------------------------------------------------|--------|---------|
296+
| namespaceSelector | list of comma separated label selectors, if multiple are provided they are combined with the AND operator | string | "" |
302297

303298
Reloader can be configured to only watch configmaps/secrets labeled with one or more labels using the `resourceLabelSelector` parameter
304299

305-
| Parameter | Description | Type |
306-
| ---------------------- | ---------------------------------------------------------------------------------- | ------- |
307-
| resourceLabelSelector | list of comma separated label selectors, if multiple are provided they are combined with the AND operator | string |
300+
| Parameter | Description | Type | Default |
301+
|-----------------------|-----------------------------------------------------------------------------------------------------------|--------|---------|
302+
| resourceLabelSelector | list of comma separated label selectors, if multiple are provided they are combined with the AND operator | string | "" |
308303

309304
**Note:** 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).
310305

@@ -314,25 +309,27 @@ You can enable to scrape Reloader's Prometheus metrics by setting `serviceMonito
314309

315310
**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:
316311

317-
| Parameter | Description | Type |
318-
|------------------|------------------------------------------------------------------------------------------------------------------------------------------| ------- |
319-
| isOpenshift | Enable OpenShift DeploymentConfigs. Valid value are either `true` or `false` | boolean |
320-
| isArgoRollouts | Enable Argo `Rollouts`. Valid value are either `true` or `false` | boolean |
321-
| reloadOnCreate | Enable reload on create events. Valid value are either `true` or `false` | boolean |
322-
| syncAfterRestart | Enable sync after Reloader restarts for **Add** events, works only when reloadOnCreate is `true`. Valid value are either `true` or `false` | boolean |
312+
| Parameter | Description | Type | Default |
313+
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------|---------|---------|
314+
| isOpenshift | Enable OpenShift DeploymentConfigs. Valid value are either `true` or `false` | boolean | false |
315+
| isArgoRollouts | Enable Argo `Rollouts`. Valid value are either `true` or `false` | boolean | false |
316+
| reloadOnCreate | Enable reload on create events. Valid value are either `true` or `false` | boolean | false |
317+
| syncAfterRestart | Enable sync after Reloader restarts for **Add** events, works only when reloadOnCreate is `true`. Valid value are either `true` or `false` | boolean | false |
323318

324319
**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.
325320

326-
**ReloadOnCreate** reloadOnCreate controls how Reloader handles secrets being added to the cache for the first time. If reloadOnCreate is set to true:
321+
**reloadOnCreate** controls how Reloader handles secrets being added to the cache for the first time. If reloadOnCreate is set to true:
327322

328323
- Configmaps/secrets being added to the cache will cause Reloader to perform a rolling update of the associated workload.
329324
- When applications are deployed for the first time, Reloader will perform a rolling update of the associated workload.
330325
- If you are running Reloader in HA mode all workloads will have a rolling update performed when a new leader is elected.
331326

332-
If ReloadOnCreate is set to false:
327+
If reloadOnCreate is set to false:
333328

334329
- 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.
335330

331+
**Note:** By default, **reloadOnCreate** and **syncAfterRestart** are both set to false. Both need to be enabled explicitly.
332+
336333
## Help
337334

338335
### Documentation
@@ -360,7 +357,7 @@ Please use the [issue tracker](https://github.com/stakater/Reloader/issues) to r
360357

361358
1. Deploy Reloader.
362359
1. Run `okteto up` to activate your development container.
363-
1. `make build`.
360+
1. `make build`
364361
1. `./Reloader`
365362

366363
PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.

0 commit comments

Comments
 (0)
Please sign in to comment.