Add dummy pipelines

This commit is contained in:
Nikolai Rodionov 2024-04-01 14:22:07 +02:00
parent d44ccf830c
commit 217a105a5c
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
5 changed files with 52 additions and 75 deletions

View File

@ -1,8 +0,0 @@
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: custom-addresspool
namespace: metallb-system
spec:
addresses:
- 192.168.5.15-192.168.5.15

View File

@ -1,20 +1,8 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: generate-ssh-key
name: hetzner-k3s
spec:
pipelineRef:
name: generate-ssh-key
params:
- name: username
value: "Tekton"
workspaces:
- name: outputs
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce # access mode may affect how you can use this volume in parallel tasks
resources:
requests:
storage: 1Gi
name: hetzner-k3s
serviceAccountName: default

View File

@ -1,17 +1,15 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: generate-ssh-key
name: hetzner-k3s
spec:
workspaces:
- name: outputs
params:
- name: username
type: string
tasks:
- name: generate-key
- name: generate-ssh-keys
taskRef:
name: generate-key
workspaces:
- name: outputs
workspaces: outputs
name: generate-ssh-keys
- name: prepare-hetzner-infra
taskRef:
name: prepare-hetzner-infra
- name: bootstrap-k3s
taskRef:
name: bootstrap-k3s

View File

@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin
subjects:
- kind: ServiceAccount
name: default
namespace: 60927041-78c2-4095-a2f5-6443c20c # this is the namespace your service account is in
roleRef: # referring to your ClusterRole
kind: ClusterRole
name: admin
apiGroup: rbac.authorization.k8s.io

View File

@ -2,46 +2,57 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: generate-key
name: generate-ssh-keys
spec:
workspaces:
- name: outputs
mountPath: /tmp/outputs
steps:
- name: prepare-ssh-key
image: ansible
imagePullPolicy: Never
script: |
#!/bin/sh
export SP_CUSTOMER=allanger
export SP_ENV=default
export SP_STATE=present
export COLLECTIONS_PATHS=./.ansible/collection
export COLLECTIONS_PATHS=./.ansible/collections
export ANSIBLE_ROLES_PATH=$./.ansible/roles
ansible-playbook /src/ssh-key-gen/playbook.yml -i /src/ssh-key-gen/inventory.yaml
- name: print-keys
image: alpine
script:
imagePullPolicy: Never
script: |-
#!/bin/sh
ls -R $(workspaces.outputs.path)
- name: kubectl
image: alpine/k8s:1.20.7
script:
echo "Generate SSH keys"
- name: save-ssh-keys
image: alpine
script: |-
#!/bin/sh
kubectl get all
echo "Save public and private keys to k8s secret"
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: goodbye
name: prepare-hetzner-infra
spec:
params:
- name: username
type: string
steps:
- name: goodbye
image: ubuntu
- name: create-hetzner-infra
image: alpine
imagePullPolicy: Never
script: |-
#!/bin/sh
echo "Create hetzner server and everything else"
- name: save-inventory
image: alpine
script: |-
#!/bin/sh
echo "Inventory file that is generated by ansible, must be saved to secrets"
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: bootstrap-k3s
spec:
steps:
- name: prepare-servers
image: alpine
script: |
#!/bin/bash
echo "Goodbye $(params.username)!"
#!/bin/sh
echo "Prepere nodes"
- name: prepare-k3s
image: alpine
script: |-
#!/bin/sh
echo "Bootsrap k3s"
- name: save-kubeconfig
image: alpine
script: |-
#!/bin/sh
echo "check if kubeconfig is valid and save it to k8s secrets"