diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 456533d4..00000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Build the manager binary -FROM golang:1.17 as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY main.go main.go -COPY api/ api/ -COPY controllers/ controllers/ - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go - -# Use distroless as minimal base image to package the manager binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot -WORKDIR / -COPY --from=builder /workspace/manager . -USER 65532:65532 - -ENTRYPOINT ["/manager"] diff --git a/Makefile b/Makefile index 6967e9cd..0f2a4ced 100644 --- a/Makefile +++ b/Makefile @@ -108,12 +108,6 @@ test: delete-test-coverage $(CODECOVERAGE_OUT) ## Run tests. explore-test-coverage: $(CODECOVERAGE_OUT) ## Display test coverage report in default web browser. go tool cover -html=$< -##@ Build - -.PHONY: run -run: ## Run a controller from your host. - go run ./main.go - ##@ Deployment $(KODATA): diff --git a/README.md b/README.md index bd96d0e2..9343e9ef 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Your EKS cluster must have an IAM OIDC Provider. Follow the steps in [Create an Download the service account policy template for AWS CloudFormation at https://github.com/aws/aws-node-termination-handler/releases/download/v2.0.0-alpha/infrastructure.yaml Then create the IAM Policy by deploying the AWS CloudFormation stack: + ```sh aws cloudformation deploy \ --template-file infrastructure.yaml \ @@ -50,6 +51,7 @@ aws cloudformation deploy \ Use either the AWS CLI or AWS Console to lookup the ARN of the IAM Policy for the service account. Create the cluster service account using the following command: + ```sh eksctl create iamserviceaccount \ --cluster \ @@ -64,6 +66,7 @@ eksctl create iamserviceaccount \ ### 2. Deploy NTH Get the ARN of the service account role: + ```sh eksctl get iamserviceaccount \ --cluster \ @@ -72,6 +75,7 @@ eksctl get iamserviceaccount \ ``` Add the AWS `eks-charts` helm repository and deploy the chart: + ```sh helm repo add eks https://aws.github.io/eks-charts diff --git a/charts/aws-node-termination-handler-2/Chart.yaml b/charts/aws-node-termination-handler-2/Chart.yaml index 698cb33d..af10c41c 100644 --- a/charts/aws-node-termination-handler-2/Chart.yaml +++ b/charts/aws-node-termination-handler-2/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: aws-node-termination-handler-2 description: A Helm chart for aws-node-termination-handler, an open-source component for gracefully handling termination events for node hosted in AWS. type: application -version: 0.1.0 +version: "0.1.0" appVersion: "2.0.0-0.1" kubeVersion: ">=1.16-0" keywords: diff --git a/scripts/download-ko.sh b/scripts/download-ko.sh index 3839ac50..a0b5595d 100755 --- a/scripts/download-ko.sh +++ b/scripts/download-ko.sh @@ -33,7 +33,7 @@ if [[ -z "${dir_path}" ]]; then exit 1 fi -if ! which wget >/dev/null ; then +if ! command -v wget >/dev/null; then echo "error: wget not installed" 1>&2 exit 1 fi