building an debian-stable image

This commit is contained in:
2021-02-22 13:08:48 +01:00
parent 3538f407e8
commit aaaf6fa29f
5 changed files with 132 additions and 30 deletions

View File

@@ -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/*

View File

@@ -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

View File

@@ -5,9 +5,8 @@ metadata:
app: distcc app: distcc
release: stable release: stable
name: distcc name: distcc
namespace: default
spec: spec:
replicas: 5 replicas: 4
selector: selector:
matchLabels: matchLabels:
app: distcc app: distcc
@@ -21,7 +20,7 @@ spec:
spec: spec:
containers: containers:
- name: distcc - name: distcc
image: cr.lan/distcc:aarch64 image: cr.lan/distcc
imagePullPolicy: Always imagePullPolicy: Always
#env: #env:
#- name: OPTIONS #- name: OPTIONS
@@ -35,10 +34,10 @@ spec:
protocol: TCP protocol: TCP
resources: resources:
limits: limits:
cpu: 1 cpu: 4
memory: 128Mi memory: 128Mi
requests: requests:
cpu: 1 cpu: 50m
memory: 64Mi memory: 64Mi
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
restartPolicy: Always restartPolicy: Always
@@ -55,26 +54,25 @@ spec:
values: values:
- distcc - distcc
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
--- #---
apiVersion: v1 #apiVersion: v1
kind: Service #kind: Service
metadata: #metadata:
labels: # labels:
app: distcc # app: distcc
release: stable # release: stable
namespace: default # name: distcc
name: distcc #spec:
spec: # externalTrafficPolicy: Cluster
externalTrafficPolicy: Cluster # ports:
ports: # - name: distcc-data
- name: distcc-data # port: 3632
port: 3632 # targetPort: 3632
targetPort: 3632 # protocol: TCP
protocol: TCP # - name: distcc-stats
- name: distcc-stats # port: 3633
port: 3633 # targetPort: 3633
targetPort: 3633 # protocol: TCP
protocol: TCP # selector:
selector: # app: distcc
app: distcc # type: LoadBalancer
type: LoadBalancer

View File

@@ -32,6 +32,16 @@ spec:
value: "1000" value: "1000"
- name: TZ - name: TZ
value: "Europe/Berlin" 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: volumeMounts:
- name: gitea - name: gitea
mountPath: /data mountPath: /data

View File

@@ -45,12 +45,13 @@ spec:
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
cd $(resources.inputs.source.path) cd $(resources.inputs.source.path)
ls -al
export GOARCH=arm64 export GOARCH=arm64
export GOPATH=/usr/src/gopath export GOPATH=/usr/src/gopath
export GOCACHE=/usr/src/gocache export GOCACHE=/usr/src/gocache
go env go env
go get go get github.com/sapcc/mosquitto-exporter
make -j4 build CGO_ENABLED=1 make -j4 build CGO_ENABLED=0
- name: build-and-push - name: build-and-push
image: gcr.io/kaniko-project/executor:arm64 image: gcr.io/kaniko-project/executor:arm64
command: command: