Prepare helmfile for the service cluster

This commit is contained in:
2024-04-01 13:30:18 +02:00
parent e6d934ad7b
commit d44ccf830c
14 changed files with 227 additions and 31 deletions

View File

@ -0,0 +1,8 @@
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

@ -0,0 +1,20 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: generate-ssh-key
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
serviceAccountName: default

View File

@ -0,0 +1,17 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: generate-ssh-key
spec:
workspaces:
- name: outputs
params:
- name: username
type: string
tasks:
- name: generate-key
taskRef:
name: generate-key
workspaces:
- name: outputs
workspaces: outputs

View File

@ -0,0 +1,12 @@
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

@ -0,0 +1,47 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: generate-key
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:
#!/bin/sh
ls -R $(workspaces.outputs.path)
- name: kubectl
image: alpine/k8s:1.20.7
script:
#!/bin/sh
kubectl get all
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: goodbye
spec:
params:
- name: username
type: string
steps:
- name: goodbye
image: ubuntu
script: |
#!/bin/bash
echo "Goodbye $(params.username)!"