From 2bd043a84df83e9f664e10874b6046a7e6a30f7c Mon Sep 17 00:00:00 2001 From: Raffael Sahli Date: Thu, 8 Jun 2023 06:43:53 +0000 Subject: [PATCH 1/2] style: lint fix --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index fac29c3c..d65320e8 100644 --- a/main.go +++ b/main.go @@ -228,6 +228,6 @@ func main() { os.Exit(1) } - s.Shutdown(context.TODO()) + _ = s.Shutdown(context.TODO()) wg.Wait() } From d5535fb70dcd4c685529016886feb7dfdff32489 Mon Sep 17 00:00:00 2001 From: Raffael Sahli Date: Thu, 8 Jun 2023 07:01:32 +0000 Subject: [PATCH 2/2] fix: add missing files covered previously by gitignore --- .gitignore | 2 +- config/base/manager/deployment.yaml | 64 ++++++++++++++++++++++++++ config/base/manager/kustomization.yaml | 8 ++++ config/base/manager/service.yaml | 17 +++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 config/base/manager/deployment.yaml create mode 100644 config/base/manager/kustomization.yaml create mode 100644 config/base/manager/service.yaml diff --git a/.gitignore b/.gitignore index be55a9c3..ec90376f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ *.so *.dylib bin -manager +/manager config/tests/cases/simple/charts coverage.out diff --git a/config/base/manager/deployment.yaml b/config/base/manager/deployment.yaml new file mode 100644 index 00000000..c0cf2b44 --- /dev/null +++ b/config/base/manager/deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: k8sreq-duplicator-controller + labels: + control-plane: controller-manager +spec: + selector: + matchLabels: + control-plane: controller-manager + replicas: 1 + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + labels: + control-plane: controller-manager + spec: + containers: + - command: + - /manager + args: + - --enable-leader-election + image: ghcr.io/doodlescheduling/k8sreq-duplicator-controller:latest + name: k8sreq-duplicator-controller + imagePullPolicy: Never + ports: + - name: metrics + containerPort: 9556 + protocol: TCP + - name: probes + containerPort: 9557 + protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsNonRoot: true + capabilities: + drop: ["ALL"] + seccompProfile: + type: RuntimeDefault + livenessProbe: + httpGet: + path: /healthz + port: probes + initialDelaySeconds: 5 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /readyz + port: probes + initialDelaySeconds: 5 + periodSeconds: 10 + resources: + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 100m + memory: 64Mi + terminationGracePeriodSeconds: 10 diff --git a/config/base/manager/kustomization.yaml b/config/base/manager/kustomization.yaml new file mode 100644 index 00000000..53f17ea0 --- /dev/null +++ b/config/base/manager/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- deployment.yaml +- service.yaml +images: +- name: ghcr.io/doodlescheduling/k8sreq-duplicator-controller + newTag: v0.0.1 diff --git a/config/base/manager/service.yaml b/config/base/manager/service.yaml new file mode 100644 index 00000000..c7a11fd2 --- /dev/null +++ b/config/base/manager/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: k8sreq-duplicator-controller +spec: + ports: + - port: 8080 + targetPort: http + protocol: TCP + name: http + - port: 9556 + targetPort: metrics + protocol: TCP + name: metrics + selector: + control-plane: controller-manager + type: ClusterIP