Compare commits

...

155 Commits

Author SHA1 Message Date
Daniel Holbach
ca56c02e2e Merge pull request #646 from evrardjp/clarify_for_redirected_users
Display new URL for redirected users
2022-09-20 15:01:59 +02:00
Jean-Philippe Evrard
c0092171f4 Display new URL for redirected users
To add clarity, we should publish, on our old page, the
information about how to use the new helm charts.

Signed-off-by: Jean-Philippe Evrard <open-source@a.spamming.party>
2022-09-20 14:59:34 +02:00
dholbach
9f0583ba71 Publish kured-3.0.1.tgz 2022-08-20 09:11:27 +00:00
ckotzbauer
c3cca29970 Publish kured-3.0.0.tgz 2022-07-31 13:51:38 +00:00
ckotzbauer
08ba855e41 Publish kured-2.17.0.tgz 2022-07-01 15:44:53 +00:00
jackfrancis
c5d21d4e03 Publish kured-2.16.0.tgz 2022-06-29 12:50:23 +00:00
ckotzbauer
f0815759b2 Publish kured-2.15.0.tgz 2022-06-08 17:32:33 +00:00
ckotzbauer
8b983e2507 Publish kured-2.14.2.tgz 2022-05-25 04:51:50 +00:00
ckotzbauer
090b33b726 Publish kured-2.14.1.tgz 2022-05-12 06:57:59 +00:00
jackfrancis
1bc4d46483 Publish kured-2.14.0.tgz 2022-05-06 19:42:06 +00:00
ckotzbauer
14636ee333 Publish kured-2.13.0.tgz 2022-04-02 15:26:54 +00:00
ckotzbauer
aba74cb73b Publish kured-2.12.1.tgz 2022-03-29 10:07:10 +00:00
ckotzbauer
40c99fbd76 Publish kured-2.12.0.tgz 2022-03-16 10:49:00 +00:00
ckotzbauer
18e4566504 Publish kured-2.11.2.tgz 2022-01-12 06:25:36 +00:00
ckotzbauer
55c66a4751 Publish kured-2.11.1.tgz 2022-01-06 18:13:28 +00:00
ckotzbauer
fdcc8438ac Publish kured-2.11.0.tgz 2021-12-17 13:15:05 +00:00
dholbach
09c6ac3a13 Publish kured-2.10.2.tgz 2021-12-06 14:04:27 +00:00
evrardjp
bd5fd3312a Publish kured-2.10.1.tgz 2021-11-27 10:19:18 +00:00
ckotzbauer
20f61e3a13 Publish kured-2.10.0.tgz 2021-10-08 14:02:19 +00:00
ckotzbauer
dc746f5f88 Publish kured-2.9.1.tgz 2021-09-15 16:46:01 +00:00
ckotzbauer
ec79ea66d9 Publish kured-2.9.0.tgz 2021-08-06 07:39:04 +00:00
ckotzbauer
72913ee233 Publish kured-2.8.0.tgz 2021-07-26 11:19:41 +00:00
dholbach
4b1506e15d Publish kured-2.7.1.tgz 2021-07-16 07:55:58 +00:00
ckotzbauer
6f7abae29b Publish kured-2.7.0.tgz 2021-06-17 16:14:33 +00:00
ckotzbauer
9db0ef7a38 Publish kured-2.6.0.tgz 2021-05-20 11:56:16 +00:00
ckotzbauer
f13943b929 Publish kured-2.5.0.tgz 2021-05-19 17:10:18 +00:00
dholbach
db4510d21a Publish kured-2.4.3.tgz 2021-04-14 08:11:51 +00:00
dholbach
cccf89601c Publish kured-2.4.2.tgz 2021-04-06 13:01:16 +00:00
evrardjp
606cc3b935 Publish kured-2.4.1.tgz 2021-04-02 08:06:31 +00:00
dholbach
491b55acb1 Publish kured-2.4.0.tgz 2021-03-11 11:05:05 +00:00
dholbach
091028f331 Publish kured-2.3.2.tgz 2021-02-08 15:05:49 +00:00
dholbach
df0d58e3ae Publish kured-2.3.1.tgz 2021-01-11 15:39:49 +00:00
dholbach
54dfa59722 Publish kured-2.3.0.tgz 2021-01-11 14:19:17 +00:00
dholbach
5fae235d6a Publish kured-2.2.4.tgz 2021-01-11 13:54:21 +00:00
Daniel Holbach
20bc76497d Merge pull request #265 from evrardjp/remove-circle-ci
Remove circle ci configuration from gh pages
2020-12-07 16:41:41 +01:00
Jean-Philippe Evrard
ed9e8f2b35 Remove circle ci configuration from gh pages
We removed Circle CI from this repo, as we can do everything
from github actions. There is no point in keeping this
configuration here. Removing.
2020-12-07 16:37:43 +01:00
dholbach
a59b47e75f Publish kured-2.2.1.tgz 2020-11-24 14:40:37 +00:00
dholbach
feaf366ac0 Publish kured-2.2.0.tgz 2020-09-01 13:54:50 +00:00
dholbach
972bab5e60 Publish kured-2.1.1.tgz 2020-08-05 09:35:40 +00:00
dholbach
2575ab4bed Publish kured-2.0.3.tgz 2020-07-01 09:30:45 +00:00
dholbach
250e1f0f58 Publish kured-2.0.1.tgz 2020-06-30 16:32:52 +00:00
Daniel Holbach
554cf53b7b Merge pull request #160 from dholbach/add-gh-page-readme
add README explaining how to install kured from chart
2020-06-30 17:37:43 +02:00
Daniel Holbach
a415ae856f add README explaining how to install kured from chart 2020-06-30 17:37:09 +02:00
Daniel Holbach
622c1c6082 Merge pull request #159 from dholbach/filter-out-gh-pages
Don't run Circle CI on gh-pages branch
2020-06-30 13:27:17 +02:00
Daniel Holbach
8ed3e7991d Don't run Circle CI on gh-pages branch
Follow the lead of
	https://github.com/weaveworks/flagger/blob/gh-pages/.circleci/config.yml
2020-06-30 11:28:14 +02:00
Daniel Holbach
18e1a4537d add a README.md file 2020-06-30 11:17:11 +02:00
dholbach
c4287dc22b Publish kured-2.0.0.tgz 2020-06-30 08:48:58 +00:00
Daniel Holbach
bc43dacf4a Create empty gh-pages branch
We will use Github pages for publishing our helm chart via
	https://github.com/stefanprodan/helm-gh-pages
2020-06-17 12:11:14 +02:00
Daniel Holbach
edeefcd2b9 Merge pull request #139 from dholbach/move-to-1.18
replay changes from #127
2020-05-11 16:36:51 +02:00
Daniel Holbach
72a31030db replay changes from #127 2020-05-01 09:07:16 +02:00
Daniel Holbach
f2a0f8e20d Merge pull request #138 from dholbach/check-links
add Github Action to check links
2020-04-30 18:07:30 +02:00
Daniel Holbach
c571a775df add Github Action to check links 2020-04-30 08:50:33 +02:00
Daniel Holbach
92ca18ff6e Merge pull request #133 from dholbach/prep-1.4.0-release
Update for 1.4.0 release
2020-04-29 18:59:39 +02:00
Daniel Holbach
4c66c69b77 Merge pull request #135 from dholbach/go-back-to-1.17
Revert parts of #127, move to client-go/kubectl 1.17
2020-04-29 18:56:38 +02:00
Daniel Holbach
779a9e27d4 update compatibility matrix re: #135 2020-04-29 15:22:54 +02:00
Daniel Holbach
ecd73fc68f Update for 1.4.0 release
Tested on minikube with k8s 1.16.8, 1.17.4, 1.18.1
2020-04-29 15:21:10 +02:00
Daniel Holbach
8e73cf224d Revert parts of #127, move to client-go/kubectl 1.17
After the release of kured 1.4.0 we should be able to go back.

	This was decided in our meeting
(https://docs.google.com/document/d/1bsHTjHhqaaZ7yJnXF6W8c89UB_yn-OoSZEmDnIP34n8/edit#heading=h.8cgszb6vuhza)

	Let's go with supporting 1.1[678] in this release.
2020-04-22 18:32:25 +02:00
Daniel Holbach
3fbc98ed57 Merge pull request #134 from crgarcia12/crgar/send-telemetry-before-rebooting
print the node id when commanding a reboot
2020-04-20 11:31:55 +02:00
Carlos Garcia Lalicata
800e9e19fb pring node id when commanding reboot, so that any monitoring tool can catch it and act on it 2020-04-20 10:58:35 +02:00
Daniel Holbach
a2c5eb7b57 Merge pull request #131 from evrardjp/build-with-1.14
Unpin base docker image
2020-04-08 18:30:30 +02:00
Jean-Philippe Evrard
bdd20c963c Unpin base docker images
The upside is that image building will always use the latest
stable version of the alpine OS, which might include security fixes.
The downside is that it's less reproducible, because the full
version isn't given.

While this commit isn't necessary per se, it's nice to have
an image that will be up to date, when we'll build it.
2020-04-08 18:17:58 +02:00
Daniel Holbach
ff73068789 Merge pull request #130 from weaveworks/fix-129
Update Go version to 1.13
2020-04-08 18:06:06 +02:00
Daniel Holbach
d6e7a42c0d Update Go version to 1.13
New Go image is recommended in https://circleci.com/docs/2.0/circleci-images/

	fixes: #129
2020-04-08 18:01:24 +02:00
Daniel Holbach
2392170b8e Merge pull request #127 from dholbach/fix-123
Update to match k8s 1.18.0
2020-04-08 17:38:07 +02:00
Daniel Holbach
0a419d0d34 update to 1.18.0 API
confirmed by running https://github.com/kubernetes-sigs/clientgofix

	closes: #123
2020-03-30 10:11:30 +02:00
Daniel Holbach
b75aec87d7 update urls to match k8s 1.18 release 2020-03-30 10:11:30 +02:00
Daniel Holbach
7ef25be46c Update client-go to 1.18
go get k8s.io/client-go@kubernetes-1.18.0
	go mod tidy
2020-03-30 10:11:30 +02:00
Daniel Holbach
67499fbdf2 Merge pull request #126 from dholbach/document-meetings
add information about monthly meetings
2020-03-30 10:10:24 +02:00
Daniel Holbach
c1fd783913 add information about monthly meetings 2020-03-27 11:08:53 +01:00
Daniel Holbach
834e7d191d Merge pull request #118 from dholbach/document-slack
point to kured Slack
2020-03-09 15:57:16 +01:00
Daniel Holbach
b1d0571298 point to kured Slack 2020-03-09 12:52:46 +01:00
Daniel Holbach
63b523e71d Merge pull request #114 from pgroene/patch-2
Keeping alpine fresh
2020-02-27 12:29:48 +01:00
Peter Groenewegen
7e7430f7df Keeping alpine fresh
Updating alpine to the latest version.
Tested this version of alpine and running fine, keeping versions of dependencies up to date.
2020-02-25 11:09:28 -08:00
Daniel Holbach
2a0ad5384d Merge pull request #113 from dholbach/prep-1.3.0
Prepare 1.3.0 release
2020-02-25 11:22:03 +01:00
Daniel Holbach
43737e35d5 Prepare 1.3.0 release
Also point out how to create the dockerhub.yaml file,
	update other release related instructions.

	closes: #97
2020-02-25 11:20:39 +01:00
Daniel Holbach
b337c9d6be Merge pull request #111 from pgroene/patch-1
Use newer version of k8s client tools
2020-02-21 18:45:14 +01:00
Daniel Holbach
95ec750a31 Merge pull request #112 from dholbach/add-release-docs
add development docs
2020-02-21 18:39:31 +01:00
Peter Groenewegen
fdc960b84d Merge pull request #1 from weaveworks/attempt-k8s-1.15
update to client-go as well
2020-02-21 09:22:43 -08:00
Daniel Holbach
72a35388a6 add development docs 2020-02-21 18:03:57 +01:00
Daniel Holbach
5dd0de8f78 update compability matrix 2020-02-21 17:03:30 +01:00
Daniel Holbach
37a5ece356 update client-go, run 'go mod tidy' 2020-02-21 16:11:44 +01:00
Daniel Holbach
7975a78025 update to latest kubectl 1.15 2020-02-21 16:11:10 +01:00
Peter Groenewegen
f86514c1e6 Use newer version of k8s client tools
The version of k8s has security vulnerabilities, updating to a newer version

Tested this this version to on our clusters
2020-02-19 07:55:03 -08:00
Bryan Boreham
f6e4062e13 Merge pull request #86 from weaveworks/tidy-modules
Update go.mod and go.sum after 'go mod vendor'
2019-11-26 17:35:54 +00:00
Praveen Adusumilli
f2ae01120a Upgrading to latest alpine (#100)
* Upgrading to latest alpine 3.10.3
2019-11-26 16:53:43 +00:00
Bryan Boreham
db7b42f5ee Merge pull request #87 from Nighthawk22/master
Added slack channel name configuration
2019-11-26 16:50:24 +00:00
Nighthawk22
5c21206bdb Merge branch 'master' into master 2019-10-28 10:56:13 +01:00
leigh capili
4beddb5338 Reboot only within time window specified on commandline (#66)
Reboot only within time window specified on commandline
2019-10-23 22:23:51 -06:00
Maximilian Zollneritsch
7944fd2639 Updated readme and daemonset with slack channel parameter 2019-09-11 14:03:13 +02:00
Maximilian Zollneritsch
d1315c691e Added slack channel name configuration 2019-09-11 13:59:09 +02:00
Bryan Boreham
57ef32d2d1 Update go.mod and go.sum after 'go mod vendor' 2019-09-05 12:28:27 +00:00
Adam Harrison
4d2b8763d3 Merge pull request #75 from weaveworks/support-k8s-1.14
Support k8s 1.14
2019-05-22 15:46:50 +01:00
Adam Harrison
b4fc6bac27 Update daemonsetlock to use AppsV1 2019-05-17 10:15:23 +01:00
Adam Harrison
423f4afc9c Update compatibility matrix 2019-05-16 17:07:17 +01:00
Adam Harrison
8d809333b3 Update embedded kubectl to v1.14.1 2019-05-16 17:07:17 +01:00
Adam Harrison
6a65a535c0 Update client-go, api, apimachinery to 1.14.x
go get k8s.io/client-go@v11.0.0
    go get k8s.io/apimachinery@release-1.14
    go get k8s.io/api@release-1.14
2019-05-16 16:15:30 +01:00
Adam Harrison
26e1ab8678 Merge pull request #74 from weaveworks/go-modules
Build with golang 1.12 and modules
2019-05-16 16:07:34 +01:00
Adam Harrison
b16c3278b3 Document how to build inside/outside GOPATH 2019-05-16 15:55:44 +01:00
Adam Harrison
ddfb4119b7 Update build instructions for go modules 2019-05-16 15:16:00 +01:00
Adam Harrison
a5a0435e41 Remove go clean
This fails with an error in module mode.
2019-05-16 15:15:32 +01:00
Adam Harrison
f41b121b14 Upgrade to go 1.12 with modules 2019-05-16 14:35:11 +01:00
Adam Harrison
97e4963583 Update docs for 1.2.0 release 2019-05-16 13:53:21 +01:00
Adam Harrison
fc94716ffe Update install instructions to use alternative dockerhub yaml 2019-05-16 11:29:26 +01:00
Adam Harrison
c20c9e987b Merge pull request #73 from weaveworks/remove-spurious-go-get
Remove spurious `go get` from Makefile
2019-05-16 11:04:13 +01:00
Adam Harrison
10443c5178 Remove spurious go get from Makefile 2019-05-16 11:00:21 +01:00
Adam Harrison
1b3d84d360 Correct master kubectl version in README 2019-05-16 10:56:41 +01:00
Adam Harrison
50136cd865 Merge pull request #57 from weaveworks/support-k8s-1.13
Support k8s 1.13
2019-05-16 10:55:59 +01:00
Adam Harrison
69b509f246 Add master to compatibility matrix 2019-05-16 10:51:51 +01:00
Adam Harrison
556789e6c7 Update embedded kubectl to v1.13.6 2019-05-16 10:51:51 +01:00
Adam Harrison
0127675514 Update client-go and transitive dependencies 2019-05-16 10:51:46 +01:00
JJ Jordan
7249f1c573 Reduce silliness 2019-04-18 18:02:13 -07:00
JJ Jordan
357687b053 Fix seconds format in parser, address (an unimportant) corner case 2019-04-18 18:00:29 -07:00
Hidde Beydals
b1370be8f3 Merge pull request #69 from weaveworks/switch-docker-hub
Move image to Docker Hub
2019-04-18 09:51:34 +02:00
Hidde Beydals
de3593799f Move image to Docker Hub 2019-04-17 13:43:47 +02:00
JJ Jordan
3a89e3e058 Add documentation section, params to daemonset, tzdata to docker container 2019-04-09 18:02:11 -07:00
JJ Jordan
972ef4240b Comment 2019-04-04 01:06:03 -07:00
JJ Jordan
334437cdc0 Improve help strings (?) 2019-04-04 01:04:39 -07:00
JJ Jordan
7d85e85db0 weekdays to use a bitmap, add (minimal) tests 2019-04-04 01:02:27 -07:00
JJ Jordan
3f6713fa65 More forgiving inputs 2019-04-02 01:28:59 -07:00
JJ Jordan
170a3a4bac Use time window 2019-04-02 01:23:33 -07:00
Matthias Radestock
521e15cc73 Merge pull request #58 from dholbach/drop-email
weave-users mailing list is closed
2019-01-08 11:58:35 +00:00
Daniel Holbach
84be7929d1 weave-users mailing list is closed: https://groups.google.com/a/weave.works/forum/#!topic/weave-users/0QXWGOPdBfY
Signed-off-by: Daniel Holbach <daniel@weave.works>
2019-01-08 08:18:21 +05:30
Adam Harrison
06b22bc3ad Merge pull request #46 from weaveworks/labelled-pods-can-block-reboots
Allow selected pods to prevent reboots
2019-01-03 11:54:43 +00:00
Adam Harrison
f6f9e7492c Allow selected pods to prevent reboots 2018-11-21 15:03:29 +00:00
Adam Harrison
114c34950b Merge pull request #41 from weaveworks/doc-compat-matrix
Document embedded kubectl/client-go versions
2018-10-30 17:06:54 +00:00
Adam Harrison
048bba446f Document embedded kubectl/client-go versions 2018-10-30 17:04:10 +00:00
Adam Harrison
dcddbfffdc Merge pull request #40 from weaveworks/1.1.0-doc-udpates
Update docs for 1.1.0 release
2018-10-30 15:17:32 +00:00
Adam Harrison
8f8cda2e74 Update docs for 1.1.0 release 2018-10-30 15:15:51 +00:00
Adam Harrison
c8bb178fb9 Merge pull request #39 from weaveworks/nsenter-host-mount-namepace
Enter host mount namespace
2018-10-30 14:40:18 +00:00
Adam Harrison
0cd450b7bc Enter host mount namespace
Use the tools installed in the host to effect reboots, and allow
the execution of commands such as `needs-restart` to determine if
reboots are required.
2018-10-30 11:58:22 +00:00
Adam Harrison
3caedb0ab8 Merge pull request #38 from weaveworks/automate-release-process
Enable CI builds on tags
2018-10-30 11:55:10 +00:00
Adam Harrison
8ed1b575d9 Enable CI builds on tags
So that creating a GitHub release triggers an appropriately versioned
build.
2018-10-30 11:31:14 +00:00
Adam Harrison
56cd1f0a49 Merge pull request #37 from weaveworks/tolerate-master-node-role
Tolerate master node-role NoSchedule taint
2018-10-26 16:12:16 +01:00
Adam Harrison
028109d203 Tolerate master node-role NoSchedule taint 2018-10-26 16:09:24 +01:00
Adam Harrison
97c58c775e Merge pull request #36 from weaveworks/support-k8s-1.12
Support k8s 1.12
2018-10-26 15:41:56 +01:00
Adam Harrison
12cd5cda87 CI build with go 1.11 2018-10-26 15:39:58 +01:00
Adam Harrison
4322c3212a Update embedded kubectl to v1.12.1 2018-10-26 12:50:08 +01:00
Adam Harrison
02d9b54125 Update client-go and transitive dependencies 2018-10-25 18:06:22 +01:00
Marcus Cobden
549be7711f Merge pull request #29 from weaveworks/drain-notify
Notify slack before draining a node
2018-09-24 10:43:10 +01:00
Marcus Cobden
ebf0fb5119 Notify slack before draining a node
Fixes #12
2018-09-04 14:37:34 +01:00
Adam Harrison
5731b98a8a Add warning to Dockerfile re: upgrading kubectl 2018-06-05 18:00:02 +01:00
Adam Harrison
efbb0c3e0d Document version compatibility in release notes 2018-06-05 17:27:26 +01:00
Adam Harrison
908998a70b Update RBAC permissions for kubectl v1.10.3 2018-06-05 17:20:57 +01:00
Adam Harrison
bc3f28d112 Move deployment manifest to apps/v1 2018-06-05 17:06:17 +01:00
Adam Harrison
826fcd2998 Bundle latest v1.10.x kubectl 2018-06-05 17:06:17 +01:00
Adam Harrison
b3f9ddf402 Bump client-go for optimum k8s 1.10 compatibility 2018-06-05 17:06:17 +01:00
Adam Harrison
c42fff3005 Create a :latest tag on build to push to minikube 2018-06-05 17:05:43 +01:00
Adam Harrison
aefc4ea498 Merge pull request #8 from weaveworks/build-on-osx
Don't call `sudo docker` when building on macOS
2018-06-05 16:28:54 +01:00
Adam Harrison
fd752b834a Merge pull request #6 from 3dinfluence/rbac_support
Update provided manifests to support a service account and RBAC
2018-06-05 16:20:28 +01:00
Adam Harrison
b2aa608294 Update permissions for kubectl 1.9.6
The permissions required by `kubectl drain` vary from version
to version; this change brings them into line with the one currently
bundled.
2018-06-05 16:16:46 +01:00
Adam Harrison
170f2ed2fb Restrict update permissions on daemonsets
Kured only needs update permissions on its own daeemonset.
2018-06-05 16:16:28 +01:00
Adam Harrison
152534fcc8 Convert to compact representation 2018-06-05 15:16:45 +01:00
Adam Harrison
741b27cd35 Revert documentation change
The manifest on master is for development, normal users should use a
released version. I'll do a release with RBAC shortly.
2018-06-05 15:14:10 +01:00
Sam Broughton
0e75f74ca8 Don't call sudo docker when building on macOS 2017-12-05 17:12:18 +00:00
David Miller
11780f008a Update provided manifests to support a service account and RBAC
- Added kured service account
- Added kured clusterrole
- Added kured clusterrolebinding
- Updated README.md documentation to include deploying with RBAC support
2017-11-23 11:48:14 -05:00
57 changed files with 699 additions and 1535 deletions

View File

@@ -1,20 +0,0 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/weaveworks/kured
docker:
- image: circleci/golang:1.8
steps:
- checkout
- setup_remote_docker
- run: go get github.com/golang/dep/cmd/dep
- run: dep ensure
- run: make
- deploy:
name: Maybe push master images
command: |
if [ -z "${CIRCLE_TAG}" -a "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" quay.io
make publish-image
fi

4
.gitignore vendored
View File

@@ -1,4 +0,0 @@
cmd/kured/kured
cmd/prom-active-alerts/prom-active-alerts
vendor
build

431
Gopkg.lock generated
View File

@@ -1,431 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/PuerkitoBio/purell"
packages = ["."]
revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/PuerkitoBio/urlesc"
packages = ["."]
revision = "bbf7a2afc14f93e1e0a5c06df524fbd75e5031e5"
[[projects]]
name = "github.com/asaskevich/govalidator"
packages = ["."]
revision = "73945b6115bfbbcc57d89b7316e28109364124e1"
version = "v7"
[[projects]]
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
[[projects]]
branch = "master"
name = "github.com/cloudfoundry-incubator/candiedyaml"
packages = ["."]
revision = "99c3df83b51532e3615f851d8c2dbb638f5313bf"
[[projects]]
branch = "master"
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "5215b55f46b2b919f50a1df0eaa5886afe4e3b3d"
[[projects]]
branch = "master"
name = "github.com/docker/distribution"
packages = [
"digest",
"reference"
]
revision = "7365003236ca58bd7fa17ef1459328d13301d7d5"
[[projects]]
branch = "master"
name = "github.com/emicklei/go-restful"
packages = [
".",
"log"
]
revision = "b14c3a95fc27c52959d2eddc85066da3c14bf269"
[[projects]]
name = "github.com/emicklei/go-restful-swagger12"
packages = ["."]
revision = "dcef7f55730566d41eae5db10e7d6981829720f6"
version = "1.0.1"
[[projects]]
branch = "master"
name = "github.com/ghodss/yaml"
packages = ["."]
revision = "aa0c862057666179de291b67d9f093d12b5a8473"
[[projects]]
branch = "master"
name = "github.com/go-openapi/analysis"
packages = ["."]
revision = "8ed83f2ea9f00f945516462951a288eaa68bf0d6"
[[projects]]
branch = "master"
name = "github.com/go-openapi/errors"
packages = ["."]
revision = "03cfca65330da08a5a440053faf994a3c682b5bf"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonpointer"
packages = ["."]
revision = "779f45308c19820f1a69e9a4cd965f496e0da10f"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonreference"
packages = ["."]
revision = "36d33bfe519efae5632669801b180bf1a245da3b"
[[projects]]
branch = "master"
name = "github.com/go-openapi/loads"
packages = ["."]
revision = "a80dea3052f00e5f032e860dd7355cd0cc67e24d"
[[projects]]
branch = "master"
name = "github.com/go-openapi/spec"
packages = ["."]
revision = "e51c28f07047ad90caff03f6450908720d337e0c"
[[projects]]
branch = "master"
name = "github.com/go-openapi/strfmt"
packages = ["."]
revision = "610b6cacdcde6852f4de68998bd20ce1dac85b22"
[[projects]]
branch = "master"
name = "github.com/go-openapi/swag"
packages = ["."]
revision = "24ebf76d720bab64f62824d76bced3184a65490d"
[[projects]]
branch = "master"
name = "github.com/gogo/protobuf"
packages = [
"proto",
"sortkeys"
]
revision = "e33835a643a970c11ac74f6333f5f6866387a101"
[[projects]]
branch = "master"
name = "github.com/golang/glog"
packages = ["."]
revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "2bba0603135d7d7f5cb73b2125beeda19c09f4ef"
[[projects]]
branch = "master"
name = "github.com/google/gofuzz"
packages = ["."]
revision = "fd52762d25a41827db7ef64c43756fd4b9f7e382"
[[projects]]
branch = "master"
name = "github.com/inconshreveable/mousetrap"
packages = ["."]
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
[[projects]]
branch = "master"
name = "github.com/juju/ratelimit"
packages = ["."]
revision = "5b9ff866471762aa2ab2dced63c9fb6f53921342"
[[projects]]
branch = "master"
name = "github.com/mailru/easyjson"
packages = [
"buffer",
"jlexer",
"jwriter"
]
revision = "2af9a745a611440bab0528e5ac19b2805a1c50eb"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
revision = "3247c84500bff8d9fb6d579d800f20b3e091582c"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/mitchellh/mapstructure"
packages = ["."]
revision = "d0303fe809921458f417bcf828397a65db30a7e4"
[[projects]]
branch = "master"
name = "github.com/prometheus/client_golang"
packages = [
"api/prometheus",
"prometheus",
"prometheus/promhttp"
]
revision = "5636dc67ae776adf5590da7349e70fbb9559972d"
[[projects]]
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
revision = "6f3806018612930941127f2a7c6c453ba2c527d2"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model"
]
revision = "ebdfc6da46522d58825777cf1f90490a5b1ef1d8"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [
".",
"xfs"
]
revision = "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
version = "v1.0.5"
[[projects]]
branch = "master"
name = "github.com/spf13/cobra"
packages = ["."]
revision = "b24564e919247d7c870fe0ed3738c98d8741aca4"
[[projects]]
branch = "master"
name = "github.com/spf13/pflag"
packages = ["."]
revision = "367864438f1b1a3c7db4da06a2f55b144e6784e0"
[[projects]]
branch = "master"
name = "github.com/ugorji/go"
packages = ["codec"]
revision = "3487a5545b3d480987dfb0492035299077fab33a"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
revision = "beb2a9779c3b677077c41673505f150149fce895"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
"context/ctxhttp",
"http2",
"http2/hpack",
"idna"
]
revision = "2a35e686583654a1b89ca79c4ac78cb3d6529ca3"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = [
"unix",
"windows"
]
revision = "3b87a42e500a6dc65dae1a55d0b641295971163e"
[[projects]]
branch = "master"
name = "golang.org/x/text"
packages = [
"internal/gen",
"internal/triegen",
"internal/ucd",
"transform",
"unicode/cldr",
"unicode/norm",
"width"
]
revision = "a9a820217f98f7c8a207ec1e45a874e1fe12c478"
[[projects]]
branch = "master"
name = "gopkg.in/inf.v0"
packages = ["."]
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
[[projects]]
branch = "v2"
name = "gopkg.in/mgo.v2"
packages = [
"bson",
"internal/json"
]
revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655"
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b"
[[projects]]
branch = "release-1.7"
name = "k8s.io/apimachinery"
packages = [
"pkg/api/equality",
"pkg/api/errors",
"pkg/api/meta",
"pkg/api/resource",
"pkg/apimachinery",
"pkg/apimachinery/announced",
"pkg/apimachinery/registered",
"pkg/apis/meta/v1",
"pkg/apis/meta/v1/unstructured",
"pkg/apis/meta/v1alpha1",
"pkg/conversion",
"pkg/conversion/queryparams",
"pkg/conversion/unstructured",
"pkg/fields",
"pkg/labels",
"pkg/openapi",
"pkg/runtime",
"pkg/runtime/schema",
"pkg/runtime/serializer",
"pkg/runtime/serializer/json",
"pkg/runtime/serializer/protobuf",
"pkg/runtime/serializer/recognizer",
"pkg/runtime/serializer/streaming",
"pkg/runtime/serializer/versioning",
"pkg/selection",
"pkg/types",
"pkg/util/clock",
"pkg/util/diff",
"pkg/util/errors",
"pkg/util/framer",
"pkg/util/intstr",
"pkg/util/json",
"pkg/util/net",
"pkg/util/rand",
"pkg/util/runtime",
"pkg/util/sets",
"pkg/util/validation",
"pkg/util/validation/field",
"pkg/util/wait",
"pkg/util/yaml",
"pkg/version",
"pkg/watch",
"third_party/forked/golang/reflect"
]
revision = "8ab5f3d8a330c2e9baaf84e39042db8d49034ae2"
[[projects]]
name = "k8s.io/client-go"
packages = [
"discovery",
"kubernetes",
"kubernetes/scheme",
"kubernetes/typed/admissionregistration/v1alpha1",
"kubernetes/typed/apps/v1beta1",
"kubernetes/typed/authentication/v1",
"kubernetes/typed/authentication/v1beta1",
"kubernetes/typed/authorization/v1",
"kubernetes/typed/authorization/v1beta1",
"kubernetes/typed/autoscaling/v1",
"kubernetes/typed/autoscaling/v2alpha1",
"kubernetes/typed/batch/v1",
"kubernetes/typed/batch/v2alpha1",
"kubernetes/typed/certificates/v1beta1",
"kubernetes/typed/core/v1",
"kubernetes/typed/extensions/v1beta1",
"kubernetes/typed/networking/v1",
"kubernetes/typed/policy/v1beta1",
"kubernetes/typed/rbac/v1alpha1",
"kubernetes/typed/rbac/v1beta1",
"kubernetes/typed/settings/v1alpha1",
"kubernetes/typed/storage/v1",
"kubernetes/typed/storage/v1beta1",
"pkg/api",
"pkg/api/v1",
"pkg/api/v1/ref",
"pkg/apis/admissionregistration",
"pkg/apis/admissionregistration/v1alpha1",
"pkg/apis/apps",
"pkg/apis/apps/v1beta1",
"pkg/apis/authentication",
"pkg/apis/authentication/v1",
"pkg/apis/authentication/v1beta1",
"pkg/apis/authorization",
"pkg/apis/authorization/v1",
"pkg/apis/authorization/v1beta1",
"pkg/apis/autoscaling",
"pkg/apis/autoscaling/v1",
"pkg/apis/autoscaling/v2alpha1",
"pkg/apis/batch",
"pkg/apis/batch/v1",
"pkg/apis/batch/v2alpha1",
"pkg/apis/certificates",
"pkg/apis/certificates/v1beta1",
"pkg/apis/extensions",
"pkg/apis/extensions/v1beta1",
"pkg/apis/networking",
"pkg/apis/networking/v1",
"pkg/apis/policy",
"pkg/apis/policy/v1beta1",
"pkg/apis/rbac",
"pkg/apis/rbac/v1alpha1",
"pkg/apis/rbac/v1beta1",
"pkg/apis/settings",
"pkg/apis/settings/v1alpha1",
"pkg/apis/storage",
"pkg/apis/storage/v1",
"pkg/apis/storage/v1beta1",
"pkg/util",
"pkg/util/parsers",
"pkg/version",
"rest",
"rest/watch",
"tools/clientcmd/api",
"tools/metrics",
"transport",
"util/cert",
"util/flowcontrol",
"util/integer"
]
revision = "d92e8497f71b7b4e0494e5bd204b48d34bd6f254"
version = "v4.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "029e6d2251ccbf5acdfc3bc0c36f340dc3a98511b0d7338c3e9bb167e412a155"
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -1,24 +0,0 @@
[[constraint]]
name = "github.com/sirupsen/logrus"
version = "v1.0.5"
[[constraint]]
branch = "master"
name = "github.com/prometheus/client_golang"
[[constraint]]
branch = "master"
name = "github.com/prometheus/common"
[[constraint]]
branch = "master"
name = "github.com/spf13/cobra"
[[constraint]]
name = "k8s.io/client-go"
version = "v4.0.0"
[[constraint]]
name = "k8s.io/apimachinery"
branch = "release-1.7"

191
LICENSE
View File

@@ -1,191 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2017 Weaveworks Ltd.
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.

View File

@@ -1,34 +0,0 @@
.DEFAULT: all
.PHONY: all clean image publish-image minikube-publish
DH_ORG=weaveworks
VERSION=$(shell git symbolic-ref --short HEAD)-$(shell git rev-parse --short HEAD)
all: image
clean:
go clean
rm -f cmd/kured/kured
rm -rf ./build
godeps=$(shell go get $1 && go list -f '{{join .Deps "\n"}}' $1 | grep -v /vendor/ | xargs go list -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}')
DEPS=$(call godeps,./cmd/kured)
cmd/kured/kured: $(DEPS)
cmd/kured/kured: cmd/kured/*.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o $@ cmd/kured/*.go
build/.image.done: cmd/kured/Dockerfile cmd/kured/kured
mkdir -p build
cp $^ build
sudo -E docker build -t quay.io/$(DH_ORG)/kured:$(VERSION) -f build/Dockerfile ./build
touch $@
image: build/.image.done
publish-image: image
sudo -E docker push quay.io/$(DH_ORG)/kured:$(VERSION)
minikube-publish: image
sudo -E docker save quay.io/$(DH_ORG)/kured:$(VERSION) | (eval $$(minikube docker-env) && docker load)

212
README.md
View File

@@ -1,210 +1,20 @@
# Kured Helm Repository
<img src="https://github.com/weaveworks/kured/raw/master/img/logo.png" align="right"/>
![Kured](https://raw.githubusercontent.com/kubereboot/kured/main/img/logo.png)
* [Introduction](#introduction)
* [Kubernetes & OS Compatibility](#kubernetes-&-os-compatibility)
* [Installation](#installation)
* [Configuration](#configuration)
* [Reboot Sentinel File & Period](#reboot-sentinel-file-&-period)
* [Blocking Reboots via Alerts](#blocking-reboots-via-alerts)
* [Prometheus Metrics](#prometheus-metrics)
* [Slack Notifications](#slack-notifications)
* [Overriding Lock Configuration](#overriding-lock-configuration)
* [Operation](#operation)
* [Testing](#testing)
* [Disabling Reboots](#disabling-reboots)
* [Manual Unlock](#manual-unlock)
* [Building](#building)
* [Getting Help](#getting-help)
Caution! We are currently in the middle of the move to a different github organisation.
Here is the info for the new organisation.
## Introduction
Add Kured repository to Helm repos:
Kured (KUbernetes REboot Daemon) is a Kubernetes daemonset that
performs safe automatic node reboots when the need to do so is
indicated by the package management system of the underlying OS.
* Watches for the presence of a reboot sentinel e.g. `/var/run/reboot-required`
* Utilises a lock in the API server to ensure only one node reboots at
a time
* Optionally defers reboots in the presence of active Prometheus alerts
* Cordons & drains worker nodes before reboot, uncordoning them after
## Kubernetes & OS Compatibility
The daemon image contains a 1.7.x `k8s.io/client-go` and `kubectl`
binary for the purposes of maintaining the lock and draining worker
nodes. Whilst it has only been tested on a 1.7.x cluster, Kubernetes
typically has good forwards/backwards compatibility so there is a
reasonable chance it will work on adjacent versions; please file an
issue if this is not the case.
Additionally, the image contains a `systemctl` binary from Ubuntu
16.04 in order to command reboots. Again, although this has not been
tested against other systemd distributions there is a good chance that
it will work.
## Installation
To obtain a default installation without Prometheus alerting interlock
or Slack notifications:
```
kubectl apply -f https://github.com/weaveworks/kured/releases/download/1.0.0/kured-ds.yaml
```console
helm repo add kubereboot https://kubereboot.github.io/charts/
```
If you want to customise the installation, download the manifest and
edit it in accordance with the following section before application.
## Install Kured
## Configuration
The following arguments can be passed to kured via the daemonset pod template:
```
Flags:
--alert-filter-regexp value alert names to ignore when checking for active alerts
--ds-name string namespace containing daemonset on which to place lock (default "kube-system")
--ds-namespace string name of daemonset on which to place lock (default "kured")
--lock-annotation string annotation in which to record locking node (default "weave.works/kured-node-lock")
--period duration reboot check period (default 1h0m0s)
--prometheus-url string Prometheus instance to probe for active alerts
--reboot-sentinel string path to file whose existence signals need to reboot (default "/var/run/reboot-required")
--slack-hook-url string slack hook URL for reboot notfications
--slack-username string slack username for reboot notfications (default "kured")
```console
helm install my-release kubereboot/kured
```
### Reboot Sentinel File & Period
By default kured checks for the existence of
`/var/run/reboot-required` every sixty minutes; you can override these
values with `--reboot-sentinel` and `--period`. Each replica of the
daemon uses a random offset derived from the period on startup so that
nodes don't all contend for the lock simultaneously.
### Blocking Reboots via Alerts
You may find it desirable to block automatic node reboots when there
are active alerts - you can do so by providing the URL of your
Prometheus server:
```
--prometheus-url=http://prometheus.monitoring.svc.cluster.local
```
By default the presence of *any* active (pending or firing) alerts
will block reboots, however you can ignore specific alerts:
```
--alert-filter-regexp=^(RebootRequired|AnotherBenignAlert|...$
```
An important application of this filter will become apparent in the
next section.
### Prometheus Metrics
Each kured pod exposes a single gauge metric (`:8080/metrics`) that
indicates the presence of the sentinel file:
```
# HELP kured_reboot_required OS requires reboot due to software updates.
# TYPE kured_reboot_required gauge
kured_reboot_required{node="ip-xxx-xxx-xxx-xxx.ec2.internal"} 0
```
The purpose of this metric is to power an alert which will summon an
operator if the cluster cannot reboot itself automatically for a
prolonged period:
```
# Alert if a reboot is required for any machines. Acts as a failsafe for the
# reboot daemon, which will not reboot nodes if there are pending alerts save
# this one.
ALERT RebootRequired
IF max(kured_reboot_required) != 0
FOR 24h
LABELS { severity="warning" }
ANNOTATIONS {
summary = "Machine(s) require being rebooted, and the reboot daemon has failed to do so for 24 hours",
impact = "Cluster nodes more vulnerable to security exploits. Eventually, no disk space left.",
description = "Machine(s) require being rebooted, probably due to kernel update.",
}
```
If you choose to employ such an alert and have configured kured to
probe for active alerts before rebooting, be sure to specify
`--alert-filter-regexp=^RebootRequired$` to avoid deadlock!
### Slack Notifications
If you specify a Slack hook via `--slack-hook-url`, kured will notify
you immediately prior to rebooting a node:
<img src="https://github.com/weaveworks/kured/raw/master/img/slack-notification.png"/>
We recommend setting `--slack-username` to be the name of the
environment, e.g. `dev` or `prod`.
### Overriding Lock Configuration
The `--ds-name` and `--ds-namespace` arguments should match the name and
namespace of the daemonset used to deploy the reboot daemon - the locking is
implemented by means of an annotation on this resource. The defaults match
the daemonset YAML provided in the repository.
Similarly `--lock-annotation` can be used to change the name of the
annotation kured will use to store the lock, but the default is almost
certainly safe.
## Operation
The example commands in this section assume that you have not
overriden the default lock annotation, daemonset name or namespace;
if you have, you will have to adjust the commands accordingly.
### Testing
You can test your configuration by provoking a reboot on a node:
```
sudo touch /var/run/reboot-required
```
### Disabling Reboots
If you need to temporarily stop kured from rebooting any nodes, you
can take the lock manually:
```
kubectl -n kube-system annotate ds kured weave.works/kured-node-lock='{"nodeID":"manual"}'
```
Don't forget to release it afterwards!
### Manual Unlock
In exceptional circumstances, such as a node experiencing a permanent
failure whilst rebooting, manual intervention may be required to
remove the cluster lock:
```
kubectl -n kube-system annotate ds kured weave.works/kured-node-lock-
```
> NB the `-` at the end of the command is important - it instructs
> `kubectl` to remove that annotation entirely.
## Building
```
dep ensure && make
```
## Getting Help
If you have any questions about, feedback for or problems with `kured`:
- Invite yourself to the <a href="https://weaveworks.github.io/community-slack/" target="_blank"> #weave-community </a> slack channel.
- Ask a question on the <a href="https://weave-community.slack.com/messages/general/"> #weave-community</a> slack channel.
- Send an email to <a href="mailto:weave-users@weave.works">weave-users@weave.works</a>
- <a href="https://github.com/weaveworks/kured/issues/new">File an issue.</a>
Your feedback is always welcome!
For more details on installing Kured please see the [chart readme](https://github.com/kubereboot/charts/tree/main/charts/kured).

View File

@@ -1,6 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/cache/apt
ADD https://storage.googleapis.com/kubernetes-release/release/v1.9.6/bin/linux/amd64/kubectl /usr/bin/kubectl
RUN chmod 0755 /usr/bin/kubectl
COPY ./kured /usr/bin/kured
ENTRYPOINT ["/usr/bin/kured"]

View File

@@ -1,286 +0,0 @@
package main
import (
"math/rand"
"net/http"
"os"
"os/exec"
"regexp"
"time"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/weaveworks/kured/pkg/alerts"
"github.com/weaveworks/kured/pkg/daemonsetlock"
"github.com/weaveworks/kured/pkg/delaytick"
"github.com/weaveworks/kured/pkg/notifications/slack"
)
var (
version = "unreleased"
// Command line flags
period time.Duration
dsNamespace string
dsName string
lockAnnotation string
prometheusURL string
alertFilter *regexp.Regexp
rebootSentinel string
slackHookURL string
slackUsername string
// Metrics
rebootRequiredGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Subsystem: "kured",
Name: "reboot_required",
Help: "OS requires reboot due to software updates.",
}, []string{"node"})
)
func init() {
prometheus.MustRegister(rebootRequiredGauge)
}
func main() {
rootCmd := &cobra.Command{
Use: "kured",
Short: "Kubernetes Reboot Daemon",
Run: root}
rootCmd.PersistentFlags().DurationVar(&period, "period", time.Minute*60,
"reboot check period")
rootCmd.PersistentFlags().StringVar(&dsNamespace, "ds-namespace", "kube-system",
"namespace containing daemonset on which to place lock")
rootCmd.PersistentFlags().StringVar(&dsName, "ds-name", "kured",
"name of daemonset on which to place lock")
rootCmd.PersistentFlags().StringVar(&lockAnnotation, "lock-annotation", "weave.works/kured-node-lock",
"annotation in which to record locking node")
rootCmd.PersistentFlags().StringVar(&prometheusURL, "prometheus-url", "",
"Prometheus instance to probe for active alerts")
rootCmd.PersistentFlags().Var(&regexpValue{&alertFilter}, "alert-filter-regexp",
"alert names to ignore when checking for active alerts")
rootCmd.PersistentFlags().StringVar(&rebootSentinel, "reboot-sentinel", "/var/run/reboot-required",
"path to file whose existence signals need to reboot")
rootCmd.PersistentFlags().StringVar(&slackHookURL, "slack-hook-url", "",
"slack hook URL for reboot notfications")
rootCmd.PersistentFlags().StringVar(&slackUsername, "slack-username", "kured",
"slack username for reboot notfications")
if err := rootCmd.Execute(); err != nil {
log.Fatal(err)
}
}
// newCommand creates a new Command with stdout/stderr wired to our standard logger
func newCommand(name string, arg ...string) *exec.Cmd {
cmd := exec.Command(name, arg...)
cmd.Stdout = log.NewEntry(log.StandardLogger()).
WithField("cmd", cmd.Args[0]).
WithField("std", "out").
WriterLevel(log.InfoLevel)
cmd.Stderr = log.NewEntry(log.StandardLogger()).
WithField("cmd", cmd.Args[0]).
WithField("std", "err").
WriterLevel(log.WarnLevel)
return cmd
}
func sentinelExists() bool {
_, err := os.Stat(rebootSentinel)
switch {
case err == nil:
return true
case os.IsNotExist(err):
return false
default:
log.Fatalf("Unable to determine existence of sentinel: %v", err)
return false // unreachable; prevents compilation error
}
}
func rebootRequired() bool {
if sentinelExists() {
log.Infof("Reboot required")
return true
} else {
log.Infof("Reboot not required")
return false
}
}
func rebootBlocked() bool {
if prometheusURL != "" {
alertNames, err := alerts.PrometheusActiveAlerts(prometheusURL, alertFilter)
if err != nil {
log.Warnf("Reboot blocked: prometheus query error: %v", err)
return true
}
count := len(alertNames)
if count > 10 {
alertNames = append(alertNames[:10], "...")
}
if count > 0 {
log.Warnf("Reboot blocked: %d active alerts: %v", count, alertNames)
return true
}
}
return false
}
func holding(lock *daemonsetlock.DaemonSetLock, metadata interface{}) bool {
holding, err := lock.Test(metadata)
if err != nil {
log.Fatalf("Error testing lock: %v", err)
}
if holding {
log.Infof("Holding lock")
}
return holding
}
func acquire(lock *daemonsetlock.DaemonSetLock, metadata interface{}) bool {
holding, holder, err := lock.Acquire(metadata)
switch {
case err != nil:
log.Fatalf("Error acquiring lock: %v", err)
return false
case !holding:
log.Warnf("Lock already held: %v", holder)
return false
default:
log.Infof("Acquired reboot lock")
return true
}
}
func release(lock *daemonsetlock.DaemonSetLock) {
log.Infof("Releasing lock")
if err := lock.Release(); err != nil {
log.Fatalf("Error releasing lock: %v", err)
}
}
func drain(nodeID string) {
log.Infof("Draining node %s", nodeID)
drainCmd := newCommand("/usr/bin/kubectl", "drain",
"--ignore-daemonsets", "--delete-local-data", "--force", nodeID)
if err := drainCmd.Run(); err != nil {
log.Fatalf("Error invoking drain command: %v", err)
}
}
func uncordon(nodeID string) {
log.Infof("Uncordoning node %s", nodeID)
uncordonCmd := newCommand("/usr/bin/kubectl", "uncordon", nodeID)
if err := uncordonCmd.Run(); err != nil {
log.Fatalf("Error invoking uncordon command: %v", err)
}
}
func commandReboot(nodeID string) {
log.Infof("Commanding reboot")
if slackHookURL != "" {
if err := slack.NotifyReboot(slackHookURL, slackUsername, nodeID); err != nil {
log.Warnf("Error notifying slack: %v", err)
}
}
// Relies on /var/run/dbus/system_bus_socket bind mount to talk to systemd
rebootCmd := newCommand("/bin/systemctl", "reboot")
if err := rebootCmd.Run(); err != nil {
log.Fatalf("Error invoking reboot command: %v", err)
}
}
func maintainRebootRequiredMetric(nodeID string) {
for {
if sentinelExists() {
rebootRequiredGauge.WithLabelValues(nodeID).Set(1)
} else {
rebootRequiredGauge.WithLabelValues(nodeID).Set(0)
}
time.Sleep(time.Minute)
}
}
// nodeMeta is used to remember information across reboots
type nodeMeta struct {
Unschedulable bool `json:"unschedulable"`
}
func rebootAsRequired(nodeID string) {
config, err := rest.InClusterConfig()
if err != nil {
log.Fatal(err)
}
client, err := kubernetes.NewForConfig(config)
if err != nil {
log.Fatal(err)
}
lock := daemonsetlock.New(client, nodeID, dsNamespace, dsName, lockAnnotation)
nodeMeta := nodeMeta{}
if holding(lock, &nodeMeta) {
if !nodeMeta.Unschedulable {
uncordon(nodeID)
}
release(lock)
}
source := rand.NewSource(time.Now().UnixNano())
tick := delaytick.New(source, period)
for _ = range tick {
if rebootRequired() && !rebootBlocked() {
node, err := client.CoreV1().Nodes().Get(nodeID, metav1.GetOptions{})
if err != nil {
log.Fatal(err)
}
nodeMeta.Unschedulable = node.Spec.Unschedulable
if acquire(lock, &nodeMeta) {
if !nodeMeta.Unschedulable {
drain(nodeID)
}
commandReboot(nodeID)
for {
log.Infof("Waiting for reboot")
time.Sleep(time.Minute)
}
}
}
}
}
func root(cmd *cobra.Command, args []string) {
log.Infof("Kubernetes Reboot Daemon: %s", version)
nodeID := os.Getenv("KURED_NODE_ID")
if nodeID == "" {
log.Fatal("KURED_NODE_ID environment variable required")
}
log.Infof("Node ID: %s", nodeID)
log.Infof("Lock Annotation: %s/%s:%s", dsNamespace, dsName, lockAnnotation)
log.Infof("Reboot Sentinel: %s every %v", rebootSentinel, period)
go rebootAsRequired(nodeID)
go maintainRebootRequiredMetric(nodeID)
http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(":8080", nil))
}

View File

@@ -1,31 +0,0 @@
package main
import (
"regexp"
)
type regexpValue struct {
value **regexp.Regexp
}
func (rev *regexpValue) String() string {
if *rev.value == nil {
return ""
}
return (*rev.value).String()
}
func (rev *regexpValue) Set(s string) error {
value, err := regexp.Compile(s)
if err != nil {
return err
}
*rev.value = value
return nil
}
func (rev *regexpValue) Type() string {
return "regexp.Regexp"
}

View File

@@ -1,23 +0,0 @@
package main
import (
"fmt"
"log"
"os"
"regexp"
"github.com/weaveworks/kured/pkg/alerts"
)
func main() {
if len(os.Args) != 3 {
log.Fatalf("USAGE: %s <prometheusURL> <filterRegexp>", os.Args[0])
}
count, err := alerts.PrometheusCountActive(os.Args[1], regexp.MustCompile(os.Args[2]))
if err != nil {
log.Fatal(err)
}
fmt.Println(count)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

688
index.yaml Normal file
View File

@@ -0,0 +1,688 @@
apiVersion: v1
entries:
kured:
- apiVersion: v1
appVersion: 1.10.2
created: "2022-08-20T09:11:27.828539459Z"
description: A Helm chart for kured
digest: 0d69719fdec1e5c264cb0b04a849aca7452a016e85ea1caca64d3b57b402c75c
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-3.0.1.tgz
version: 3.0.1
- apiVersion: v1
appVersion: 1.10.1
created: "2022-07-31T13:51:38.928629992Z"
description: A Helm chart for kured
digest: 1b66b4183ca1d3ac66779cc5ff2e1276c2a2325c17875a85a19532e8a5022a10
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-3.0.0.tgz
version: 3.0.0
- apiVersion: v1
appVersion: 1.10.1
created: "2022-07-01T15:44:53.561402098Z"
description: A Helm chart for kured
digest: e2727a5db21ab73d8c57db5a2a3cd09793296408c0c494279f8e2afb5d52cf28
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.17.0.tgz
version: 2.17.0
- apiVersion: v1
appVersion: 1.10.0
created: "2022-06-29T12:50:23.453793995Z"
description: A Helm chart for kured
digest: 1e047a20c633e226d7f77fc4e85b33a5547ce3e2b44525b680cb3d0b89350cbd
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.16.0.tgz
version: 2.16.0
- apiVersion: v1
appVersion: 1.10.0
created: "2022-06-08T17:32:33.101479721Z"
description: A Helm chart for kured
digest: e168f38de6d44da877509c099fcad738e5fcc3b99240ded34221c7bfa7ed5d0a
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.15.0.tgz
version: 2.15.0
- apiVersion: v1
appVersion: 1.9.2
created: "2022-05-25T04:51:50.346850231Z"
description: A Helm chart for kured
digest: 48b267700a0d48ab73e4b6ace31c1c84c393959ed09c31a3ec03e170b6b4aacf
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.14.2.tgz
version: 2.14.2
- apiVersion: v1
appVersion: 1.9.2
created: "2022-05-12T06:57:59.679228473Z"
description: A Helm chart for kured
digest: 345949c01aecbc73312a8dbdd2b7b553ca1a80fc24744a17c92b3c3c990f36a2
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.14.1.tgz
version: 2.14.1
- apiVersion: v1
appVersion: 1.9.2
created: "2022-05-06T19:42:06.720738587Z"
description: A Helm chart for kured
digest: cddb002491f4d32fb418dadc3cb846b12885fa6cb8c32d0968021c11bb3b2733
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.14.0.tgz
version: 2.14.0
- apiVersion: v1
appVersion: 1.9.2
created: "2022-04-02T15:26:54.467410377Z"
description: A Helm chart for kured
digest: 76000a5c32552deab99bae1745fcb195f73f99bfcdb847a96cbcc4f833d4b641
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.13.0.tgz
version: 2.13.0
- apiVersion: v1
appVersion: 1.9.2
created: "2022-03-29T10:07:10.572530457Z"
description: A Helm chart for kured
digest: 7635175d009834464b53f92184066a2e17dffe5a9c9f7965c32ffaada570326e
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.12.1.tgz
version: 2.12.1
- apiVersion: v1
appVersion: 1.9.1
created: "2022-03-16T10:49:00.591818431Z"
description: A Helm chart for kured
digest: 5ef50be15401f068d6558e23f327333c960cd48b3d09431e56362f5da5aed84c
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.12.0.tgz
version: 2.12.0
- apiVersion: v1
appVersion: 1.9.1
created: "2022-01-12T06:25:36.587168836Z"
description: A Helm chart for kured
digest: 9f2991549faa094ffb8324abeec649d39f9d2dd915e0287e11642411a47a4c26
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.11.2.tgz
version: 2.11.2
- apiVersion: v1
appVersion: 1.9.1
created: "2022-01-06T18:13:28.526458698Z"
description: A Helm chart for kured
digest: cb9884e9968426177a39d78b437d02046bd61b019cb8f3165624560ba24a9907
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.11.1.tgz
version: 2.11.1
- apiVersion: v1
appVersion: 1.9.0
created: "2021-12-17T13:15:05.508704637Z"
description: A Helm chart for kured
digest: 125117291df9b58f7961de17d4d2d8d0b55267e2acc90ad76a2aab1fc9efea96
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.11.0.tgz
version: 2.11.0
- apiVersion: v1
appVersion: 1.8.2
created: "2021-12-06T14:04:27.615912334Z"
description: A Helm chart for kured
digest: 0527e881055b974e869e86d6bda1a5ac1a86f305dbf7f9d7ba8cc082a24f1e32
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.10.2.tgz
version: 2.10.2
- apiVersion: v1
appVersion: 1.8.1
created: "2021-11-27T10:19:18.570439253Z"
description: A Helm chart for kured
digest: 905576b23f8263dcf26da50da6c004cb266a143cca0567f0e5d5586569b8e367
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.10.1.tgz
version: 2.10.1
- apiVersion: v1
appVersion: 1.8.0
created: "2021-10-08T14:02:19.678658295Z"
description: A Helm chart for kured
digest: fff452ed6b03903cb4d5c2b7c865b7e199fc03f7ce6a5e9449115a1746c37f50
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.10.0.tgz
version: 2.10.0
- apiVersion: v1
appVersion: 1.7.0
created: "2021-09-15T16:46:01.039895438Z"
description: A Helm chart for kured
digest: 02fd3ce98b427b411bf425cbdd60567072596f3c1ca44ff3ecb17f4852cd0099
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.9.1.tgz
version: 2.9.1
- apiVersion: v1
appVersion: 1.7.0
created: "2021-08-06T07:39:04.864672062Z"
description: A Helm chart for kured
digest: ee06afc5ba1af0591ac29f1be1425517a855959112d2fa7bc185df905f793d90
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.9.0.tgz
version: 2.9.0
- apiVersion: v1
appVersion: 1.7.0
created: "2021-07-26T11:19:41.659147727Z"
description: A Helm chart for kured
digest: 68154ea2c074c0d331548b9e17f3c3246b283251eb1c5331eabb60dba168c1ed
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.8.0.tgz
version: 2.8.0
- apiVersion: v1
appVersion: 1.7.0
created: "2021-07-16T07:55:57.986831107Z"
description: A Helm chart for kured
digest: 2607eabd4c1fd308e9825f30148ee67bc066660f800c92eeaffb7a9678c5451f
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.7.1.tgz
version: 2.7.1
- apiVersion: v1
appVersion: 1.7.0
created: "2021-06-17T16:14:33.768706163Z"
description: A Helm chart for kured
digest: 85ab0f0d25a26a863bce43100dc3ad9584b6f11319ca6d320093ed33acf3bc6f
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.7.0.tgz
version: 2.7.0
- apiVersion: v1
appVersion: 1.7.0
created: "2021-05-20T11:56:16.670153606Z"
description: A Helm chart for kured
digest: b783d7acd1c19d3b12474a9e74d0bf396b5cb2c2b4984246cb1d1f8bc2c12d68
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.6.0.tgz
version: 2.6.0
- apiVersion: v1
appVersion: 1.7.0
created: "2021-05-19T17:10:18.386329817Z"
description: A Helm chart for kured
digest: d4815d495cc9476dcb6e8204e9a2791fac1f89f17a9136d3167d202be88f7000
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.5.0.tgz
version: 2.5.0
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-14T08:11:51.869402029Z"
description: A Helm chart for kured
digest: 1961e0937676e0bcb8ceb7a4973c61450d059e2d4beea78481a9323cf0b964a6
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.4.3.tgz
version: 2.4.3
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.715078451Z"
description: A Helm chart for kured
digest: 4f26e153bec10f32d120c9abb521262aba97d96fbb80b0e8829b41157b556c4b
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/main/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.4.2.tgz
version: 2.4.2
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.714161094Z"
description: A Helm chart for kured
digest: 4788a1d33a938b6c17a760d6602eb03d68c86eb6be46c50272d9ebeeee3941ae
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.4.1.tgz
version: 2.4.1
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.713214735Z"
description: A Helm chart for kured
digest: 5cb1837122133aa6022b56140fb04583f232b4199ed44fe3746a6240e9d116a2
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.4.0.tgz
version: 2.4.0
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.712224972Z"
description: A Helm chart for kured
digest: d6eed3eac12ea285716e46f8de0fc101692fc1827d6a56780976ef8f0c4d1cce
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.3.2.tgz
version: 2.3.2
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.711557431Z"
description: A Helm chart for kured
digest: 84a75e3967d13440e3a856ecfc5a2a845ce19089a8b8b8da30d3e6344d1f3c3b
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.3.1.tgz
version: 2.3.1
- apiVersion: v1
appVersion: 1.6.1
created: "2021-04-06T13:01:16.710894489Z"
description: A Helm chart for kured
digest: db5f718db2a38cc4c46b5afb41fbc4cb82ac5298388008589bb1fc321d233ca3
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.3.0.tgz
version: 2.3.0
- apiVersion: v1
appVersion: 1.5.1
created: "2021-04-06T13:01:16.709668812Z"
description: A Helm chart for kured
digest: b3a8b13a79efa56a0a94fa91976faa4916fbdab826d9f50ddf63f4d9179a36e4
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.2.4.tgz
version: 2.2.4
- apiVersion: v1
appVersion: 1.5.1
created: "2021-04-06T13:01:16.70899537Z"
description: A Helm chart for kured
digest: 47d881f78ce887567dd3513c5bf0a1c4532c34e05cd9697cc602ce9e461fd10a
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.2.1.tgz
version: 2.2.1
- apiVersion: v1
appVersion: 1.5.0
created: "2021-04-06T13:01:16.708325128Z"
description: A Helm chart for kured
digest: f1d8d83d9992346275d8ed5b4cdb84164cbeaada73b1ff11d802f0d7a38c1621
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
- email: david@davidkarlsen.com
name: davidkarlsen
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.2.0.tgz
version: 2.2.0
- apiVersion: v1
appVersion: 1.4.5
created: "2021-04-06T13:01:16.707676487Z"
description: A Helm chart for kured
digest: 5c63a1bf4aff4394afb703f44d6f20bcb0d9f79af4a89b7a1476148e5f8b0fd5
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: daniel@weave.works
name: dholbach
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.1.1.tgz
version: 2.1.1
- apiVersion: v1
appVersion: 1.4.4
created: "2021-04-06T13:01:16.707031347Z"
description: A Helm chart for kured
digest: 8ae0a2884d185ac6311d9333ba7b29c8815a2b433892bc073922c9ad5c0771bc
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: daniel@weave.works
name: dholbach
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.0.3.tgz
version: 2.0.3
- apiVersion: v1
appVersion: 1.4.3
created: "2021-04-06T13:01:16.706360205Z"
description: A Helm chart for kured
digest: 6b8057d3f8f5774ae75a57e38e63fe73ac7230871082177bd219543e03bc3981
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: daniel@weave.works
name: dholbach
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.0.1.tgz
version: 2.0.1
- apiVersion: v1
appVersion: 1.4.2
created: "2021-04-06T13:01:16.705726665Z"
description: A Helm chart for kured
digest: 3a97561f4b5ad420a9e73ca88bcfdc29f25d722195614fc797b770ff053df672
home: https://github.com/weaveworks/kured
icon: https://raw.githubusercontent.com/weaveworks/kured/master/img/logo.png
maintainers:
- email: daniel@weave.works
name: dholbach
- email: christian.kotzbauer@gmail.com
name: ckotzbauer
name: kured
sources:
- https://github.com/weaveworks/kured
urls:
- https://weaveworks.github.io/kured/kured-2.0.0.tgz
version: 2.0.0
generated: "2022-08-20T09:11:27.825605805Z"

BIN
kured-2.0.0.tgz Normal file

Binary file not shown.

BIN
kured-2.0.1.tgz Normal file

Binary file not shown.

BIN
kured-2.0.3.tgz Normal file

Binary file not shown.

BIN
kured-2.1.1.tgz Normal file

Binary file not shown.

BIN
kured-2.10.0.tgz Normal file

Binary file not shown.

BIN
kured-2.10.1.tgz Normal file

Binary file not shown.

BIN
kured-2.10.2.tgz Normal file

Binary file not shown.

BIN
kured-2.11.0.tgz Normal file

Binary file not shown.

BIN
kured-2.11.1.tgz Normal file

Binary file not shown.

BIN
kured-2.11.2.tgz Normal file

Binary file not shown.

BIN
kured-2.12.0.tgz Normal file

Binary file not shown.

BIN
kured-2.12.1.tgz Normal file

Binary file not shown.

BIN
kured-2.13.0.tgz Normal file

Binary file not shown.

BIN
kured-2.14.0.tgz Normal file

Binary file not shown.

BIN
kured-2.14.1.tgz Normal file

Binary file not shown.

BIN
kured-2.14.2.tgz Normal file

Binary file not shown.

BIN
kured-2.15.0.tgz Normal file

Binary file not shown.

BIN
kured-2.16.0.tgz Normal file

Binary file not shown.

BIN
kured-2.17.0.tgz Normal file

Binary file not shown.

BIN
kured-2.2.0.tgz Normal file

Binary file not shown.

BIN
kured-2.2.1.tgz Normal file

Binary file not shown.

BIN
kured-2.2.4.tgz Normal file

Binary file not shown.

BIN
kured-2.3.0.tgz Normal file

Binary file not shown.

BIN
kured-2.3.1.tgz Normal file

Binary file not shown.

BIN
kured-2.3.2.tgz Normal file

Binary file not shown.

BIN
kured-2.4.0.tgz Normal file

Binary file not shown.

BIN
kured-2.4.1.tgz Normal file

Binary file not shown.

BIN
kured-2.4.2.tgz Normal file

Binary file not shown.

BIN
kured-2.4.3.tgz Normal file

Binary file not shown.

BIN
kured-2.5.0.tgz Normal file

Binary file not shown.

BIN
kured-2.6.0.tgz Normal file

Binary file not shown.

BIN
kured-2.7.0.tgz Normal file

Binary file not shown.

BIN
kured-2.7.1.tgz Normal file

Binary file not shown.

BIN
kured-2.8.0.tgz Normal file

Binary file not shown.

BIN
kured-2.9.0.tgz Normal file

Binary file not shown.

BIN
kured-2.9.1.tgz Normal file

Binary file not shown.

BIN
kured-3.0.0.tgz Normal file

Binary file not shown.

BIN
kured-3.0.1.tgz Normal file

Binary file not shown.

View File

@@ -1,47 +0,0 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: kured # Must match `--ds-name`
namespace: kube-system # Must match `--ds-namespace`
spec:
template:
metadata:
labels:
name: kured
spec:
containers:
- name: kured
image: quay.io/weaveworks/kured
imagePullPolicy: IfNotPresent
command:
- /usr/bin/kured
# args:
# - --alert-filter-regexp=^RebootRequired$
# - --ds-name=kured
# - --ds-namespace=kube-system
# - --lock-annotation=weave.works/kured-node-lock
# - --period=1h
# - --prometheus-url=http://prometheus.monitoring.svc.cluster.local
# - --reboot-sentinel=/var/run/reboot-required
# - --slack-hook-url=https://hooks.slack.com/...
# - --slack-username=prod
#
# NO USER SERVICEABLE PARTS BEYOND THIS POINT
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

View File

@@ -1,51 +0,0 @@
package alerts
import (
"context"
"fmt"
"regexp"
"sort"
"time"
"github.com/prometheus/client_golang/api/prometheus"
"github.com/prometheus/common/model"
)
// Returns a list of names of active (e.g. pending or firing) alerts, filtered
// by the supplied regexp.
func PrometheusActiveAlerts(prometheusURL string, filter *regexp.Regexp) ([]string, error) {
client, err := prometheus.New(prometheus.Config{Address: prometheusURL})
if err != nil {
return nil, err
}
queryAPI := prometheus.NewQueryAPI(client)
value, err := queryAPI.Query(context.Background(), "ALERTS", time.Now())
if err != nil {
return nil, err
}
if value.Type() == model.ValVector {
if vector, ok := value.(model.Vector); ok {
activeAlertSet := make(map[string]bool)
for _, sample := range vector {
if alertName, isAlert := sample.Metric[model.AlertNameLabel]; isAlert && sample.Value != 0 {
if filter == nil || !filter.MatchString(string(alertName)) {
activeAlertSet[string(alertName)] = true
}
}
}
var activeAlerts []string
for activeAlert, _ := range activeAlertSet {
activeAlerts = append(activeAlerts, activeAlert)
}
sort.Sort(sort.StringSlice(activeAlerts))
return activeAlerts, nil
}
}
return nil, fmt.Errorf("Unexpected value type: %v", value)
}

View File

@@ -1,122 +0,0 @@
package daemonsetlock
import (
"encoding/json"
"fmt"
"time"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
type DaemonSetLock struct {
client *kubernetes.Clientset
nodeID string
namespace string
name string
annotation string
}
type lockAnnotationValue struct {
NodeID string `json:"nodeID"`
Metadata interface{} `json:"metadata,omitempty"`
}
func New(client *kubernetes.Clientset, nodeID, namespace, name, annotation string) *DaemonSetLock {
return &DaemonSetLock{client, nodeID, namespace, name, annotation}
}
func (dsl *DaemonSetLock) Acquire(metadata interface{}) (acquired bool, owner string, err error) {
for {
ds, err := dsl.client.ExtensionsV1beta1().DaemonSets(dsl.namespace).Get(dsl.name, metav1.GetOptions{})
if err != nil {
return false, "", err
}
valueString, exists := ds.ObjectMeta.Annotations[dsl.annotation]
if exists {
value := lockAnnotationValue{}
if err := json.Unmarshal([]byte(valueString), &value); err != nil {
return false, "", err
}
return value.NodeID == dsl.nodeID, value.NodeID, nil
}
if ds.ObjectMeta.Annotations == nil {
ds.ObjectMeta.Annotations = make(map[string]string)
}
value := lockAnnotationValue{NodeID: dsl.nodeID, Metadata: metadata}
valueBytes, err := json.Marshal(&value)
if err != nil {
return false, "", err
}
ds.ObjectMeta.Annotations[dsl.annotation] = string(valueBytes)
_, err = dsl.client.ExtensionsV1beta1().DaemonSets(dsl.namespace).Update(ds)
if err != nil {
if se, ok := err.(*errors.StatusError); ok && se.ErrStatus.Reason == metav1.StatusReasonConflict {
// Something else updated the resource between us reading and writing - try again soon
time.Sleep(time.Second)
continue
} else {
return false, "", err
}
}
return true, dsl.nodeID, nil
}
}
func (dsl *DaemonSetLock) Test(metadata interface{}) (holding bool, err error) {
ds, err := dsl.client.ExtensionsV1beta1().DaemonSets(dsl.namespace).Get(dsl.name, metav1.GetOptions{})
if err != nil {
return false, err
}
valueString, exists := ds.ObjectMeta.Annotations[dsl.annotation]
if exists {
value := lockAnnotationValue{Metadata: metadata}
if err := json.Unmarshal([]byte(valueString), &value); err != nil {
return false, err
}
return value.NodeID == dsl.nodeID, nil
}
return false, nil
}
func (dsl *DaemonSetLock) Release() error {
for {
ds, err := dsl.client.ExtensionsV1beta1().DaemonSets(dsl.namespace).Get(dsl.name, metav1.GetOptions{})
if err != nil {
return err
}
valueString, exists := ds.ObjectMeta.Annotations[dsl.annotation]
if exists {
value := lockAnnotationValue{}
if err := json.Unmarshal([]byte(valueString), &value); err != nil {
return err
}
if value.NodeID != dsl.nodeID {
return fmt.Errorf("Not lock holder: %v", value.NodeID)
}
} else {
return fmt.Errorf("Lock not held")
}
delete(ds.ObjectMeta.Annotations, dsl.annotation)
_, err = dsl.client.ExtensionsV1beta1().DaemonSets(dsl.namespace).Update(ds)
if err != nil {
if se, ok := err.(*errors.StatusError); ok && se.ErrStatus.Reason == metav1.StatusReasonConflict {
// Something else updated the resource between us reading and writing - try again soon
time.Sleep(time.Second)
continue
} else {
return err
}
}
return nil
}
}

View File

@@ -1,22 +0,0 @@
package delaytick
import (
"math/rand"
"time"
)
// Tick regularly after an initial delay randomly distributed between d/2 and d + d/2
func New(s rand.Source, d time.Duration) <-chan time.Time {
c := make(chan time.Time)
go func() {
random := rand.New(s)
time.Sleep(time.Duration(float64(d)/2 + float64(d)*random.Float64()))
c <- time.Now()
for t := range time.Tick(d) {
c <- t
}
}()
return c
}

View File

@@ -1,42 +0,0 @@
package slack
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
var (
httpClient = &http.Client{Timeout: 5 * time.Second}
)
type body struct {
Text string `json:"text,omitempty"`
Username string `json:"username,omitempty"`
}
func NotifyReboot(hookURL, username, nodeID string) error {
msg := body{
Text: fmt.Sprintf("Rebooting node %s", nodeID),
Username: username,
}
var buf bytes.Buffer
if err := json.NewEncoder(&buf).Encode(&msg); err != nil {
return err
}
resp, err := httpClient.Post(hookURL, "application/json", &buf)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf(resp.Status)
}
return nil
}