initial commit

This commit is contained in:
allard
2025-11-23 18:58:51 +01:00
commit 376a944abc
1553 changed files with 314731 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
FROM alpine
ENTRYPOINT echo hallo Allard Krings

View File

@@ -0,0 +1,15 @@
Dit is een pipeline voor buildah.
let op:
gebruik de buildah task van Tekton zelf:
kubectl apply -f
https://api.hub.tekton.dev/v1/resource/tekton/task/buildah/0.5/raw
Deze task heeft een workspace "dockerconfig" die via de pipeline is gekoppeld aan
workspace "dockerconfig-ws" die op zijn beurt in de pipelinerun gekoppeld is aan
een secret "dockerconfig-secret dat gedefinieerd wordt conform
dockerconfig-secret.yaml

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: buildah-workspace-pv
spec:
storageClassName: ""
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
mountOptions:
- hard
- nfsvers=4.1
nfs:
server: 192.168.40.100
path: /mnt/nfs_share/tekton-buildah
readOnly: false

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: buildah-workspace-pvc
spec:
storageClassName: ""
volumeName: buildah-workspace-pv
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,2 @@
microk8s kubectl create secret generic harbor-userid-password \
--from-literal='Username=admin' --from-literal='Password=Harbor01@'

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: Secret
metadata:
name: docker-credentials
data:
config.json: ewoJImF1dGhzIjogewoJCSJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOiB7CgkJCSJhdXRoIjogIllXeHNZWEprYTNKcGJtZHpPa3QxWW1WeWJtVjBaWE13TVVBPSIKCQl9Cgl9Cn0=

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: dockerconfig-secret
stringData:
config.json: |
{
"auths": {
"harbor.alldcs.nl": {
"auth": "YWRtaW46SGFyYm9yMDFA"
}
}
}

View File

@@ -0,0 +1,4 @@
FROM alpine
ENTRYPOINT echo hallo Allard Krings
#

View File

@@ -0,0 +1,32 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: tutorial-pipeline
spec:
workspaces:
- name: myworkspace
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: myworkspace
params:
- name: url
value: https://github.com/AllardKrings/helloallard.git
- name: deleteExisting
value: "true"
- name: build
taskRef:
name: buildah
runAfter:
- fetch-repository
params:
- name: IMAGE
value: harbor.alldcs.nl/allard/helloallard
- name: IMAGE_PUSH_SECRET_NAME
value: harbor-credentials
workspaces:
- name: source
workspace: myworkspace

View File

@@ -0,0 +1,16 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: tutorial-pipeline-
spec:
pipelineRef:
name: tutorial-pipeline
workspaces:
- name: myworkspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi

View File

@@ -0,0 +1,24 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: buildah-clone-build-push-
spec:
pipelineRef:
name: buildah-clone-build-push
workspaces:
- name: myworkspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
- name: dockerconfig-ws
secret:
secretName: dockerconfig-secret
params:
- name: repo-url
value: https://github.com/AllardKrings/helloallard.git
- name: image-reference
value: harbor.alldcs.nl/allard/hello-allard:1.0

View File

@@ -0,0 +1,35 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: buildah-clone-build-push
spec:
workspaces:
- name: myworkspace
- name: dockerconfig-ws
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: myworkspace
params:
- name: url
value: https://github.com/AllardKrings/helloallard.git
- name: deleteExisting
value: "true"
- name: build
taskRef:
name: buildah
runAfter:
- fetch-repository
params:
- name: IMAGE
value: harbor.alldcs.nl/allard/helloallard:1.0
- name: TLSVERIFY
value: "false"
workspaces:
- name: source
workspace: myworkspace
- name: dockerconfig
workspace: dockerconfig-ws