From f98c2e21ab21d7a6c84fd2ce0eb7ab6190bfaad4 Mon Sep 17 00:00:00 2001 From: David Binney Date: Thu, 17 Aug 2023 07:39:34 +0930 Subject: [PATCH] migrate #12: adding more fixes/cleanup --- Dockerfile | 11 +++++++++-- k8s-cluster-util-apis.yml | 16 ++++------------ main.go | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9650a2d..5c33d75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ # # multi stage build, yo! FROM golang:1.21 -COPY . /app/ WORKDIR /app +COPY . /app/ LABEL org.opencontainers.image.source https://github.com/donkeyx/cluster-utils-api LABEL maintainer="David Binney " RUN make deps build -# switched for potential shell +# no longer using musl dns moved to debian FROM debian:stable-slim WORKDIR /app +ENV \ + LANG en_AU.UTF-8 \ + LANGUAGE en_AU.UTF-8 \ + LC_ALL en_AU.UTF-8 \ + LC_CTYPE=en_AU.UTF-8 \ + TZ="Australia/Adelaide" + COPY --from=0 /app/bin/cu-api /app/cu-api ENTRYPOINT [ "./cu-api" ] diff --git a/k8s-cluster-util-apis.yml b/k8s-cluster-util-apis.yml index 3275b91..ffe8640 100644 --- a/k8s-cluster-util-apis.yml +++ b/k8s-cluster-util-apis.yml @@ -36,20 +36,12 @@ spec: - name: PORT value: "8080" resources: - limits: + requests: cpu: "0.1" + memory: "50Mi" + limits: + cpu: "0.5" memory: 100Mi - initContainers: - - name: init-dns - image: curlimages/curl - command: - [ - "sh", - "-c", - "until curl -fsS https://google.com >> /dev/null; do sleep 2 ; done ;", - ] - imagePullSecrets: - - name: dockerhub-reg-cred --- apiVersion: v1 diff --git a/main.go b/main.go index 109a5d7..7a167e2 100644 --- a/main.go +++ b/main.go @@ -27,8 +27,8 @@ func main() { router.GET("/healthz", healthHandler) router.GET("/ready", readyHandler) router.GET("/readyz", readyHandler) + router.GET("/headers", headersHandler) - router.GET("/headersz", headersHandler) // Start the server port := "8080"