From aaaf6fa29f5b0c6fdef6c366686c87720a27e193 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Mon, 22 Feb 2021 13:08:48 +0100 Subject: [PATCH] building an debian-stable image --- _CI-CD/debian-stable/Dockerfile | 9 ++ .../debian-stable/tekton-debian-stable.yaml | 84 +++++++++++++++++++ apps/distcc/distcc-deployment.yaml | 54 ++++++------ apps/gitea.yaml | 10 +++ ...ekton-image-build-prometheus-exporter.yaml | 5 +- 5 files changed, 132 insertions(+), 30 deletions(-) create mode 100644 _CI-CD/debian-stable/Dockerfile create mode 100644 _CI-CD/debian-stable/tekton-debian-stable.yaml diff --git a/_CI-CD/debian-stable/Dockerfile b/_CI-CD/debian-stable/Dockerfile new file mode 100644 index 0000000..788662a --- /dev/null +++ b/_CI-CD/debian-stable/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:stable-slim + +RUN sed -i 's@deb.debian.org@apt-cache.lan/deb.debian.org@g' /etc/apt/sources.list && \ + sed -i 's@security.debian.org@apt-cache.lan/security.debian.org@g' /etc/apt/sources.list && \ + apt-get update && apt-get install -y \ + dig procps nmap bash iputils-ping && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/apt/* \ No newline at end of file diff --git a/_CI-CD/debian-stable/tekton-debian-stable.yaml b/_CI-CD/debian-stable/tekton-debian-stable.yaml new file mode 100644 index 0000000..02974c3 --- /dev/null +++ b/_CI-CD/debian-stable/tekton-debian-stable.yaml @@ -0,0 +1,84 @@ +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: chaos-kubernetes-git +spec: + type: git + params: + - name: revision + value: master + - name: url + value: http://git-ui.lan/chaos/kubernetes.git + - name: submodules + value: "false" +--- +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: img-debian-stable +spec: + type: image + params: + - name: url + value: cr.lan/debian-stable +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: build-debian-stable +spec: + params: + - name: pathToContainerFile + type: string + default: $(resources.inputs.source.path)/_CI-CD/debian-stable/Dockerfile + - name: pathToContext + type: string + default: $(resources.inputs.source.path)/_CI-CD/debian-stable + resources: + inputs: + - name: source + type: git + outputs: + - name: builtImage + type: image + steps: + - name: build-and-push + image: gcr.io/kaniko-project/executor:arm64 + command: + - /kaniko/executor + args: + - --dockerfile=$(params.pathToContainerFile) + - --destination=$(resources.outputs.builtImage.url) + - --context=$(params.pathToContext) + - --skip-tls-verify + #workspaces: + # - name: workspace + # mountPath: /workspace +--- +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: + name: img-debian-stable +spec: + taskRef: + name: build-debian-stable + params: + - name: pathToContainerFile + value: Dockerfile + resources: + inputs: + - name: source + resourceRef: + name: chaos-kubernetes-git + outputs: + - name: builtImage + resourceRef: + name: img-debian-stable +# workspaces: +# - name: workspace +# persistentVolumeClaim: +# claimName: tektoncd-workspaces +# subPath: workspaces + + + \ No newline at end of file diff --git a/apps/distcc/distcc-deployment.yaml b/apps/distcc/distcc-deployment.yaml index bf27b50..ae8c0ec 100644 --- a/apps/distcc/distcc-deployment.yaml +++ b/apps/distcc/distcc-deployment.yaml @@ -5,9 +5,8 @@ metadata: app: distcc release: stable name: distcc - namespace: default spec: - replicas: 5 + replicas: 4 selector: matchLabels: app: distcc @@ -21,7 +20,7 @@ spec: spec: containers: - name: distcc - image: cr.lan/distcc:aarch64 + image: cr.lan/distcc imagePullPolicy: Always #env: #- name: OPTIONS @@ -35,10 +34,10 @@ spec: protocol: TCP resources: limits: - cpu: 1 + cpu: 4 memory: 128Mi requests: - cpu: 1 + cpu: 50m memory: 64Mi dnsPolicy: ClusterFirst restartPolicy: Always @@ -55,26 +54,25 @@ spec: values: - distcc topologyKey: kubernetes.io/hostname ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: distcc - release: stable - namespace: default - name: distcc -spec: - externalTrafficPolicy: Cluster - ports: - - name: distcc-data - port: 3632 - targetPort: 3632 - protocol: TCP - - name: distcc-stats - port: 3633 - targetPort: 3633 - protocol: TCP - selector: - app: distcc - type: LoadBalancer +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# labels: +# app: distcc +# release: stable +# name: distcc +#spec: +# externalTrafficPolicy: Cluster +# ports: +# - name: distcc-data +# port: 3632 +# targetPort: 3632 +# protocol: TCP +# - name: distcc-stats +# port: 3633 +# targetPort: 3633 +# protocol: TCP +# selector: +# app: distcc +# type: LoadBalancer diff --git a/apps/gitea.yaml b/apps/gitea.yaml index f3cb62c..2b90ae2 100644 --- a/apps/gitea.yaml +++ b/apps/gitea.yaml @@ -32,6 +32,16 @@ spec: value: "1000" - name: TZ value: "Europe/Berlin" + - name: DB_TYPE + value: postgres + - name: DB_HOST + value: postgres.live-env.svc.cluster.local:5432 + - name: DB_NAME + value: gitea + - name: DB_USER + value: gitea + - name: DB_PASSWD + value: giteaEu94XSS4gKpheSBoMsIs volumeMounts: - name: gitea mountPath: /data diff --git a/apps/mosquitto/tekton-image-build-prometheus-exporter.yaml b/apps/mosquitto/tekton-image-build-prometheus-exporter.yaml index 3a49a7f..6dd48a4 100644 --- a/apps/mosquitto/tekton-image-build-prometheus-exporter.yaml +++ b/apps/mosquitto/tekton-image-build-prometheus-exporter.yaml @@ -45,12 +45,13 @@ spec: script: | #!/usr/bin/env bash cd $(resources.inputs.source.path) + ls -al export GOARCH=arm64 export GOPATH=/usr/src/gopath export GOCACHE=/usr/src/gocache go env - go get - make -j4 build CGO_ENABLED=1 + go get github.com/sapcc/mosquitto-exporter + make -j4 build CGO_ENABLED=0 - name: build-and-push image: gcr.io/kaniko-project/executor:arm64 command: