This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rebuy-de/update_readme_installation
adds sample k8s manifests and updates readme
- Loading branch information
Showing
4 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Example K8S Deployment manifest file, read before applying | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
|
||
metadata: | ||
name: node-drainer | ||
labels: | ||
app: node-drainer | ||
|
||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 3 | ||
|
||
# You should always have one replica only, | ||
# node-drainer was not designed to run concurrently | ||
strategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
maxSurge: 0 | ||
|
||
template: | ||
metadata: | ||
name: node-drainer | ||
labels: | ||
app: node-drainer | ||
|
||
spec: | ||
# The service account is necessary if your K8S cluster is running RBAC, | ||
# otherwise the following line should be deleted | ||
serviceAccountName: node-drainer | ||
|
||
containers: | ||
- name: node-drainer | ||
image: "quay.io/rebuy/node-drainer:master" | ||
imagePullPolicy: Always | ||
# These are sample arguments, configure before applying the manifest | ||
args: | ||
- -q=asg-shutdown-queue | ||
- -r=eu-west-1 | ||
- --access-key-id=FILL-ME-IN | ||
- --secret-access-key=FILL-ME-IN | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Example service account K8S manifest file, read before applying | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: node-drainer | ||
--- | ||
# ClusterRole is necessary for node-drainer to read node information | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: node-drainer | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
verbs: ["list", "watch", "get", "update"] | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
verbs: ["list", "delete", "get"] | ||
- apiGroups: [""] | ||
resources: | ||
- pods/eviction | ||
verbs: ["list", "get", "create"] | ||
--- | ||
# We must bind the ClusterRole to our new ServiceAccount | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: node-drainer | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: node-drainer | ||
subjects: | ||
- kind: ServiceAccount | ||
name: node-drainer | ||
namespace: default |