building an debian-stable image
This commit is contained in:
9
_CI-CD/debian-stable/Dockerfile
Normal file
9
_CI-CD/debian-stable/Dockerfile
Normal 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/*
|
||||
84
_CI-CD/debian-stable/tekton-debian-stable.yaml
Normal file
84
_CI-CD/debian-stable/tekton-debian-stable.yaml
Normal 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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user