-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from chifu1234/master
[manifests] #15 Adding daemonset Manifest
- Loading branch information
Showing
5 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{/* | ||
Copyright © 2020 Oliver Baehler | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/}} | ||
{{- define "bedag-lib.manifest.daemonset.values" -}} | ||
{{- include "lib.utils.strings.template" (dict "value" (include "bedag-lib.utils.common.mergedValues" (dict "type" "daemonset" "root" .)) "context" .context) }} | ||
{{- end }} | ||
|
||
{{- define "bedag-lib.manifest.daemonset" -}} | ||
{{- if .context -}} | ||
{{- $context := .context -}} | ||
{{- $daemonset := (fromYaml (include "bedag-lib.manifest.daemonset.values" .)) -}} | ||
kind: DaemonSet | ||
{{- if $daemonset.apiVersion }} | ||
apiVersion: {{ $daemonset.apiVersion }} | ||
{{- else }} | ||
apiVersion: apps/v1 | ||
{{- end }} | ||
metadata: | ||
name: {{ include "bedag-lib.utils.common.fullname" . }} | ||
labels: {{- include "lib.utils.common.labels" (dict "labels" $daemonset.labels "context" $context)| nindent 4 }} | ||
spec: | ||
minReadySeconds: {{ default 0 $daemonset.minReadySeconds }} | ||
revisionHistoryLimit: {{ default 10 $daemonset.revisionHistoryLimit }} | ||
selector: | ||
matchLabels: {{- include "lib.utils.strings.template" (dict "value" (default (include "lib.utils.common.selectorLabels" $context) $daemonset.selectorLabels) "context" $context) | indent 6 }} | ||
template: {{- include "bedag-lib.template.pod" (set . "pod" $daemonset) | nindent 4 }} | ||
updateStrategy: | ||
{{- $updateStrategy := (default "RollingUpdate" $daemonset.updateStrategy) }} | ||
type: {{ $updateStrategy | quote }} | ||
{{- if (eq "OnDelete" $updateStrategy) }} | ||
rollingUpdate: null | ||
{{- else if $daemonset.rollingUpdatemaxUnavailable }} | ||
rollingUpdate: | ||
maxUnavailable: {{ $daemonset.rollingUpdatemaxUnavailable }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
charts/manifests/templates/values/manifests/_daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- define "bedag-lib.values.daemonset" -}} | ||
{{- $context := (default $ .context) }} | ||
{{- $_ := dict "parentKey" (default "daemonset" .key) "path" (cat (default "" (default $context.path .path)) (default "daemonset" .key) "." | nospace) "context" $context "data" (default dict .data) "minimal" (default false .minimal) }} | ||
# | ||
## - DaemonSet | ||
## Reference: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ | ||
## | ||
{{ $_.parentKey }}: | ||
|
||
## DaemonSet API version | ||
# {{ $_.path }}apiVersion -- Configure the api version used for the DaemonSet resource | ||
apiVersion: "" | ||
|
||
## DaemonSet Labels | ||
# {{ $_.path }}labels -- Merges given labels with common labels | ||
labels: {} | ||
|
||
## DaemonSet Selector Labels | ||
# {{ $_.path }}selectorLabels -- Define SelectorLabels for the Pod Template | ||
selectorLabels: {} | ||
|
||
## DaemonSet minReadySeconds | ||
# {{ $_.path }}minReadySeconds -- DaemonSet [Min Ready in Seconds](https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#performing-a-rolling-update). **DaemonSet only** | ||
minReadySeconds: "" | ||
|
||
## DaemonSet, can be set to RollingUpdate or OnDelete by default. | ||
# {{ $_.path }}updateStrategy -- DaemonSet [Update Strategy](https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#performing-a-rolling-update). **DaemonSet only** | ||
updateStrategy: RollingUpdate | ||
|
||
## maxUnavailable update strategy | ||
# {{ $_.path }}rollingUpdatePartition -- DaemonSet [Update Pratition](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#pod-management-policies). **DaemonSet only** | ||
rollingUpdatemaxUnavailable: "" | ||
|
||
## Pod Configuration | ||
## {{ include "bedag-lib.utils.intern.docLink" $_ }}#pod-template | ||
{{- if $_.minimal }} | ||
## Supports all the values from the referenced template. Find all available values in the link above. | ||
{{- else }} | ||
## Full Configuration | ||
|
||
{{- include "bedag-lib.values.template.pod" $_ | nindent 2 }} | ||
{{- end }} | ||
{{- end -}} |