Skip to content

Commit d387652

Browse files
committed
Add initial port of shutdown await from bash to Go
* Based on https://www.psdn.io/posts/kubelet-graceful-shutdown/
0 parents  commit d387652

File tree

15 files changed

+1623
-0
lines changed

15 files changed

+1623
-0
lines changed

.github/dependabot.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: docker
8+
directory: "/"
9+
schedule:
10+
interval: daily
11+
pull-request-branch-name:
12+
separator: "-"
13+
open-pull-requests-limit: 1
14+
- package-ecosystem: gomod
15+
directory: "/"
16+
schedule:
17+
interval: daily
18+
pull-request-branch-name:
19+
separator: "-"
20+
open-pull-requests-limit: 2
21+
ignore:
22+
- dependency-name: "k8s.io/api"
23+
- dependency-name: "k8s.io/apimachinery"

.github/workflows/test.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
build:
9+
name: go
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
go: ['1.18', '1.19']
15+
steps:
16+
- name: setup
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: ${{matrix.go}}
20+
21+
- name: checkout
22+
uses: actions/checkout@v3
23+
24+
- name: test
25+
run: make

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/

.golangci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
linters:
2+
enable:
3+
- goheader
4+
linters-settings:
5+
goheader:
6+
template: |-
7+
Copyright (C) {{year}} Poseidon Labs
8+
Copyright (C) {{year}} Dalton Hubble
9+
10+
This Source Code Form is subject to the terms of the Mozilla Public
11+
License, v. 2.0. If a copy of the MPL was not distributed with this
12+
file, You can obtain one at https://mozilla.org/MPL/2.0/.
13+

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# scuttle
2+
3+
Notable changes between versions.
4+
5+
## Latest
6+
7+
## v0.1.0
8+
9+
* Initial port from bash script to Go
10+
* Make uncordon, drain, and delete optional
11+
* Poll AWS spot instance termination notices
12+
* Drop requirement that `kubectl` be present

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM docker.io/golang:1.19.3 AS builder
2+
COPY . src
3+
RUN cd src && make build
4+
5+
FROM docker.io/alpine:3.16.2
6+
LABEL maintainer="Dalton Hubble <[email protected]>"
7+
RUN apk --no-cache --update add ca-certificates
8+
COPY --from=builder /go/src/bin/scuttle /usr/local/bin
9+
ENTRYPOINT ["/usr/local/bin/scuttle"]

0 commit comments

Comments
 (0)