Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back to alpine #13

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
FROM python:3-slim-stretch
FROM python:3-alpine

ARG VERSION=undefined
ENV VERSION ${VERSION}

# Install curl and certificates
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
openssl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN apk add --no-cache curl openssl ca-certificates

# Install kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION := $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
IMG ?= quay.io/pusher/k8s-spot-termination-handler
IMG ?= quay.io/cogentwebworks/k8s-spot-termination-handler

RED := \033[31m
GREEN := \033[32m
1 change: 1 addition & 0 deletions deploy/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ rules:
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
11 changes: 7 additions & 4 deletions deploy/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: k8s-spot-termination-handler
namespace: kube-system
labels:
app: k8s-spot-termination-handler
spec:
selector:
matchLabels:
app: k8s-spot-termination-handler
template:
metadata:
name: k8s-spot-termination-handler
labels:
app: k8s-spot-termination-handler
spec:
# Uncomment the following line if using RBAC
# serviceAccountName: k8s-spot-termination-handler
# comment the following line if not using RBAC
serviceAccountName: k8s-spot-termination-handler
containers:
- name: k8s-spot-termination-handler
image: quay.io/pusher/k8s-spot-termination-handler:v0.1.0
image: quay.io/cogentwebworks/k8s-spot-termination-handler:v0.4
imagePullPolicy: IfNotPresent
env:
- name: NODE_NAME
3 changes: 2 additions & 1 deletion docker_entrypoint.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ def main():
if result == 0:
print('Node Drain successful')
break

# Sleep so we do not restart before drain evicts this pod.
sleep(120)
else:
if counter == 60:
counter = 0
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8==3.6.0
pylint==2.3.1
requests==2.21.0
urllib3<1.25,>=1.21.1
flake8==3.8.3
pylint==2.5.3
requests==2.24.0
urllib3==1.25.10