This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
[stable/kured] Add initial chart #6470
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
652f715
[incubator/kured] Add initial chart
plumdog c228478
[incubator/kured] CR: Add home and maintainers to Chart.yaml
plumdog 9cdd256
[incubator/kured] CR: Add sources to Chart.yaml
plumdog af9008a
[incubator/kured] CR: Fix apiVersion for DaemonSet
plumdog a5ec389
[incubator/kured] CR: wrap ServiceAccount in rbac.create
plumdog 3bb847b
[incubator/kured] Exlicitly set .spec.selector for the DaemonSet
plumdog 8fe5bc9
[stable/kured] Move from incubator to stable
plumdog 017aa47
[stable/kured] CR: Update for RBAC/ServiceAccount best practices
plumdog 924de0d
CR: linting, remove extra space
plumdog e19730c
CR: allow tolerations for daemonset
plumdog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
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,11 @@ | ||
apiVersion: v1 | ||
appVersion: "master-c42fff3" | ||
description: A Helm chart for kured | ||
name: kured | ||
version: 0.1.0 | ||
home: https://github.com/weaveworks/kured | ||
maintainers: | ||
- name: plumdog | ||
email: plummer574@gmail.com | ||
sources: | ||
- https://github.com/weaveworks/kured |
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,21 @@ | ||
# Kured (KUbernetes REboot Daemon) | ||
|
||
See https://github.com/weaveworks/kured | ||
|
||
| Config | Description | Default | | ||
| ------ | ----------- | ------- | | ||
| `image.repository` | Image repository | `quay.io/weaveworks/kured` | | ||
| `image.tag` | Image tag | `master-c42fff3` | | ||
| `image.pullPolicy` | Image pull policy | `IfNotPresent` | | ||
| `extraArgs` | Extra arguments to pass to `/usr/bin/kured`. See below. | `{}` | | ||
| `rbac.create` | Create RBAC roles | `true` | | ||
| `rbac.serviceAccountName` | Service account name to create (or use if `rbac.create` is false) | `kured` | | ||
| `updateStrategy` | Daemonset update strategy | `OnDelete` | | ||
|
||
See https://github.com/weaveworks/kured#configuration for values for `extraArgs`. Note that | ||
```yaml | ||
extraArgs: | ||
foo: 1 | ||
bar-baz: 2 | ||
``` | ||
becomes `/usr/bin/kured ... --foo=1 --bar-baz=2`. |
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,3 @@ | ||
Kured will check for /var/run/reboot-required, and reboot nodes when needed. | ||
|
||
See https://github.com/weaveworks/kured/ for details. |
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,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kured.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kured.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "kured.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ template "kured.fullname" . }} | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
chart: {{ template "kured.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
rules: | ||
# Allow kured to read spec.unschedulable | ||
# Allow kubectl to drain/uncordon | ||
# | ||
# NB: These permissions are tightly coupled to the bundled version of kubectl; the ones below | ||
# match https://github.com/kubernetes/kubernetes/blob/v1.9.6/pkg/kubectl/cmd/drain.go | ||
# | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["get", "patch"] | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["list"] | ||
- apiGroups: [""] | ||
resources: ["replicationcontrollers"] | ||
verbs: ["get"] | ||
- apiGroups: ["apps"] | ||
resources: ["statefulsets"] | ||
verbs: ["get"] | ||
- apiGroups: ["extensions"] | ||
resources: ["daemonsets", "replicasets"] | ||
verbs: ["get"] | ||
- apiGroups: ["batch"] | ||
resources: ["jobs"] | ||
verbs: ["get"] | ||
- apiGroups: [""] | ||
resources: ["pods/eviction"] | ||
verbs: ["create"] | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ template "kured.fullname" . }} | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
chart: {{ template "kured.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ template "kured.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Values.rbac.serviceAccountName }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ template "kured.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
chart: {{ template "kured.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
|
||
spec: | ||
updateStrategy: | ||
type: {{ .Values.updateStrategy }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "kured.name" . }} | ||
release: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
serviceAccountName: {{ .Values.rbac.serviceAccountName }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
command: | ||
- /usr/bin/kured | ||
args: | ||
- --ds-name={{ template "kured.fullname" . }} | ||
- --ds-namespace={{ .Release.Namespace }} | ||
{{- range $key, $value := .Values.extraArgs }} | ||
{{- if $value }} | ||
- --{{ $key }}={{ $value }} | ||
{{- else }} | ||
- --{{ $key }} | ||
{{- end }} | ||
{{- end }} | ||
env: | ||
# Pass in the name of the node on which this pod is scheduled | ||
# for use with drain/uncordon operations and lock acquisition | ||
- name: KURED_NODE_ID | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
volumeMounts: | ||
# Needed for two purposes: | ||
# * Testing for the existence of /var/run/reboot-required | ||
# * Accessing /var/run/dbus/system_bus_socket to effect reboot | ||
- name: hostrun | ||
mountPath: /var/run | ||
restartPolicy: Always | ||
volumes: | ||
- name: hostrun | ||
hostPath: | ||
path: /var/run |
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,18 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kured.fullname" . }} | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
chart: {{ template "kured.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
rules: | ||
# Allow kured to lock/unlock itself | ||
- apiGroups: ["extensions"] | ||
resources: ["daemonsets"] | ||
resourceNames: ["kured"] | ||
verbs: ["update"] | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kured.fullname" . }} | ||
labels: | ||
app: {{ template "kured.name" . }} | ||
chart: {{ template "kured.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ .Values.rbac.serviceAccountName }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ template "kured.fullname" . }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Values.rbac.serviceAccountName }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
image: | ||
repository: quay.io/weaveworks/kured | ||
# Appears to be without numbered numbered tags, so using this instead | ||
tag: master-c42fff3 | ||
pullPolicy: IfNotPresent | ||
|
||
extraArgs: {} | ||
|
||
rbac: | ||
create: true | ||
serviceAccountName: kured | ||
|
||
updateStrategy: OnDelete |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there an optional use of tolerations in order to be able to run on master too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Fixed in e19730c.