Skip to content

Commit 0c74be4

Browse files
docs: Updated readme for 4.18 chart for winter soldier. (#3673)
* Update README.md for winter soldier * Update README.md for winter-soldier * Update README.md for deployment * Update README.md for winter soldier * Update deployment.md for winter soldier * Update rollout-deployment.md for winter soldier
1 parent 379cf71 commit 0c74be4

File tree

5 files changed

+151
-15
lines changed

5 files changed

+151
-15
lines changed

docs/user-guide/creating-application/deployment-template/deployment.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,73 @@ kedaAutoscaling:
762762
authenticationRef:
763763
name: keda-trigger-auth-kafka-credential
764764
```
765+
### Winter-Soldier
766+
Winter Soldier can be used to
767+
- cleans up (delete) Kubernetes resources
768+
- reduce workload pods to 0
769+
770+
**_NOTE:_** After deploying this we can create the Hibernator object and provide the custom configuration by which workloads going to delete, sleep and many more. for more information check [the main repo](https://github.com/devtron-labs/winter-soldier)
771+
772+
Given below is template values you can give in winter-soldier:
773+
```yaml
774+
winterSoldier:
775+
enabled: false
776+
apiVersion: pincher.devtron.ai/v1alpha1
777+
action: sleep
778+
timeRangesWithZone:
779+
timeZone: "Asia/Kolkata"
780+
timeRanges: []
781+
targetReplicas: []
782+
fieldSelector: []
783+
```
784+
Here,
785+
| Key | values | Description |
786+
| :--- | :--- | :--- |
787+
| `enabled` | `fasle`,`true` | decide the enabling factor |
788+
| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version |
789+
| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. |
790+
| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
791+
| `timeRangesWithZone`:`timeRanges` | array of [ `timeFrom`, `timeTo`, `weekdayFrom`, `weekdayTo`] | It use to define time period/range on which the user need to perform the specified action. you can have multiple timeRanges. <br /> These settings will take `action` on Sat and Sun from 00:00 to 23:59:59, |
792+
| `targetReplicas` | `[n]` : n - number of replicas to scale. | These is mandatory field when the `action` is `scale` <br /> Defalut value is `[]`. |
793+
| `fieldSelector` | `- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) ` | These value will take a list of methods to select the resources on which we perform specified `action` . |
794+
795+
796+
here is an example,
797+
```yaml
798+
winterSoldier:
799+
apiVersion: pincher.devtron.ai/v1alpha1
800+
enabled: true
801+
annotations: {}
802+
labels: {}
803+
timeRangesWithZone:
804+
timeZone: "Asia/Kolkata"
805+
timeRanges:
806+
- timeFrom: 00:00
807+
timeTo: 23:59:59
808+
weekdayFrom: Sat
809+
weekdayTo: Sun
810+
- timeFrom: 00:00
811+
timeTo: 08:00
812+
weekdayFrom: Mon
813+
weekdayTo: Fri
814+
- timeFrom: 20:00
815+
timeTo: 23:59:59
816+
weekdayFrom: Mon
817+
weekdayTo: Fri
818+
action: scale
819+
targetReplicas: [1,1,1]
820+
fieldSelector:
821+
- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '10h'), Now())
822+
```
823+
Above settings will take action on `Sat` and `Sun` from 00:00 to 23:59:59, and on `Mon`-`Fri` from 00:00 to 08:00 and 20:00 to 23:59:59. If `action:sleep` then runs hibernate at timeFrom and unhibernate at `timeTo`. If `action: delete` then it will delete workloads at `timeFrom` and `timeTo`. Here the `action:scale` thus it scale the number of resource replicas to `targetReplicas: [1,1,1]`. Here each element of `targetReplicas` array is mapped with the corresponding elments of array `timeRangesWithZone/timeRanges`. Thus make sure the length of both array is equal, otherwise the cnages cannot be observed.
824+
825+
The above example will select the application objects which have been created 10 hours ago across all namespaces excluding application's namespace. Winter soldier exposes following functions to handle time, cpu and memory.
826+
827+
- ParseTime - This function can be used to parse time. For eg to parse creationTimestamp use ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z')
828+
- AddTime - This can be used to add time. For eg AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '-10h') ll add 10h to the time. Use d for day, h for hour, m for minutes and s for seconds. Use negative number to get earlier time.
829+
- Now - This can be used to get current time.
830+
- CpuToNumber - This can be used to compare CPU. For eg any({{spec.containers.#.resources.requests}}, { MemoryToNumber(.memory) < MemoryToNumber('60Mi')}) will check if any resource.requests is less than 60Mi.
831+
765832

766833
### Security Context
767834
A security context defines privilege and access control settings for a Pod or Container.

docs/user-guide/creating-application/deployment-template/rollout-deployment.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,75 @@ kedaAutoscaling:
866866
name: keda-trigger-auth-kafka-credential
867867
```
868868
869+
### Winter-Soldier
870+
Winter Soldier can be used to
871+
- cleans up (delete) Kubernetes resources
872+
- reduce workload pods to 0
873+
874+
**_NOTE:_** After deploying this we can create the Hibernator object and provide the custom configuration by which workloads going to delete, sleep and many more. for more information check [the main repo](https://github.com/devtron-labs/winter-soldier)
875+
876+
Given below is template values you can give in winter-soldier:
877+
```yaml
878+
winterSoldier:
879+
enabled: false
880+
apiVersion: pincher.devtron.ai/v1alpha1
881+
action: sleep
882+
timeRangesWithZone:
883+
timeZone: "Asia/Kolkata"
884+
timeRanges: []
885+
targetReplicas: []
886+
fieldSelector: []
887+
```
888+
Here,
889+
| Key | values | Description |
890+
| :--- | :--- | :--- |
891+
| `enabled` | `fasle`,`true` | decide the enabling factor |
892+
| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version |
893+
| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. |
894+
| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
895+
| `timeRangesWithZone`:`timeRanges` | array of [ `timeFrom`, `timeTo`, `weekdayFrom`, `weekdayTo`] | It use to define time period/range on which the user need to perform the specified action. you can have multiple timeRanges. <br /> These settings will take `action` on Sat and Sun from 00:00 to 23:59:59, |
896+
| `targetReplicas` | `[n]` : n - number of replicas to scale. | These is mandatory field when the `action` is `scale` <br /> Defalut value is `[]`. |
897+
| `fieldSelector` | `- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) ` | These value will take a list of methods to select the resources on which we perform specified `action` . |
898+
899+
900+
here is an example,
901+
```yaml
902+
winterSoldier:
903+
apiVersion: pincher.devtron.ai/v1alpha1
904+
enabled: true
905+
annotations: {}
906+
labels: {}
907+
timeRangesWithZone:
908+
timeZone: "Asia/Kolkata"
909+
timeRanges:
910+
- timeFrom: 00:00
911+
timeTo: 23:59:59
912+
weekdayFrom: Sat
913+
weekdayTo: Sun
914+
- timeFrom: 00:00
915+
timeTo: 08:00
916+
weekdayFrom: Mon
917+
weekdayTo: Fri
918+
- timeFrom: 20:00
919+
timeTo: 23:59:59
920+
weekdayFrom: Mon
921+
weekdayTo: Fri
922+
action: scale
923+
targetReplicas: [1,1,1]
924+
fieldSelector:
925+
- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '10h'), Now())
926+
```
927+
Above settings will take action on `Sat` and `Sun` from 00:00 to 23:59:59, and on `Mon`-`Fri` from 00:00 to 08:00 and 20:00 to 23:59:59. If `action:sleep` then runs hibernate at timeFrom and unhibernate at `timeTo`. If `action: delete` then it will delete workloads at `timeFrom` and `timeTo`. Here the `action:scale` thus it scale the number of resource replicas to `targetReplicas: [1,1,1]`. Here each element of `targetReplicas` array is mapped with the corresponding elments of array `timeRangesWithZone/timeRanges`. Thus make sure the length of both array is equal, otherwise the cnages cannot be observed.
928+
929+
The above example will select the application objects which have been created 10 hours ago across all namespaces excluding application's namespace. Winter soldier exposes following functions to handle time, cpu and memory.
930+
931+
- ParseTime - This function can be used to parse time. For eg to parse creationTimestamp use ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z')
932+
- AddTime - This can be used to add time. For eg AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '-10h') ll add 10h to the time. Use d for day, h for hour, m for minutes and s for seconds. Use negative number to get earlier time.
933+
- Now - This can be used to get current time.
934+
- CpuToNumber - This can be used to compare CPU. For eg any({{spec.containers.#.resources.requests}}, { MemoryToNumber(.memory) < MemoryToNumber('60Mi')}) will check if any resource.requests is less than 60Mi.
935+
936+
937+
869938
### Security Context
870939
A security context defines privilege and access control settings for a Pod or Container.
871940

scripts/devtron-reference-helm-charts/deployment-chart_4-18-0/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ Winter Soldier can be used to
769769

770770
Given below is template values you can give in winter-soldier:
771771
```yaml
772-
winterSoilder:
773-
enable: false
772+
winterSoldier:
773+
enabled: false
774774
apiVersion: pincher.devtron.ai/v1alpha1
775775
action: sleep
776776
timeRangesWithZone:
@@ -782,7 +782,7 @@ winterSoilder:
782782
Here,
783783
| Key | values | Description |
784784
| :--- | :--- | :--- |
785-
| `enable` | `fasle`,`true` | decide the enabling factor |
785+
| `enabled` | `fasle`,`true` | decide the enabling factor |
786786
| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version |
787787
| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. |
788788
| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
@@ -793,9 +793,9 @@ Here,
793793

794794
here is an example,
795795
```yaml
796-
winterSoilder:
796+
winterSoldier:
797797
apiVersion: pincher.devtron.ai/v1alpha1
798-
enable: true
798+
enabled: true
799799
annotations: {}
800800
labels: {}
801801
timeRangesWithZone:

scripts/devtron-reference-helm-charts/reference-chart_4-18-0/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ Winter Soldier can be used to
395395

396396
Given below is template values you can give in winter-soldier:
397397
```yaml
398-
winterSoilder:
399-
enable: false
398+
winterSoldier:
399+
enabled: false
400400
apiVersion: pincher.devtron.ai/v1alpha1
401401
action: sleep
402402
timeRangesWithZone:
@@ -408,7 +408,7 @@ winterSoilder:
408408
Here,
409409
| Key | values | Description |
410410
| :--- | :--- | :--- |
411-
| `enable` | `fasle`,`true` | decide the enabling factor |
411+
| `enabled` | `fasle`,`true` | decide the enabling factor |
412412
| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version |
413413
| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. |
414414
| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
@@ -419,9 +419,9 @@ Here,
419419

420420
here is an example,
421421
```yaml
422-
winterSoilder:
422+
winterSoldier:
423423
apiVersion: pincher.devtron.ai/v1alpha1
424-
enable: true
424+
enabled: true
425425
annotations: {}
426426
labels: {}
427427
timeRangesWithZone:

scripts/devtron-reference-helm-charts/statefulset-chart_4-18-0/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ Winter Soldier can be used to
814814

815815
Given below is template values you can give in winter-soldier:
816816
```yaml
817-
winterSoilder:
818-
enable: false
817+
winterSoldier:
818+
enabled: false
819819
apiVersion: pincher.devtron.ai/v1alpha1
820820
action: sleep
821821
timeRangesWithZone:
@@ -827,7 +827,7 @@ winterSoilder:
827827
Here,
828828
| Key | values | Description |
829829
| :--- | :--- | :--- |
830-
| `enable` | `fasle`,`true` | decide the enabling factor |
830+
| `enabled` | `fasle`,`true` | decide the enabling factor |
831831
| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version |
832832
| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. |
833833
| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
@@ -838,9 +838,9 @@ Here,
838838

839839
here is an example,
840840
```yaml
841-
winterSoilder:
841+
winterSoldier:
842842
apiVersion: pincher.devtron.ai/v1alpha1
843-
enable: true
843+
enabled: true
844844
annotations: {}
845845
labels: {}
846846
timeRangesWithZone:

0 commit comments

Comments
 (0)