forked from infra/ansible
forgejo: Update runnerhost configuration with zabbix agent configuration
Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
parent
b0415adc16
commit
7ec4975ead
2 changed files with 4 additions and 104 deletions
|
|
@ -1,104 +0,0 @@
|
|||
---
|
||||
apiVersion: template.openshift.io/v1
|
||||
kind: Template
|
||||
metadata:
|
||||
name: forgejo-runner-vm
|
||||
annotations:
|
||||
description: KubeVirt VM for running Forgejo Action runners with a mounted SA token disk.
|
||||
parameters:
|
||||
- name: VM_NAME
|
||||
description: Name of the VirtualMachine
|
||||
required: true
|
||||
- name: NAMESPACE
|
||||
description: Target namespace
|
||||
value: forgejo
|
||||
- name: INSTANCE_TYPE
|
||||
description: VirtualMachineClusterInstanceType name
|
||||
value: u1.xlarge
|
||||
- name: DISK_SIZE
|
||||
description: Root disk size
|
||||
value: 30Gi
|
||||
- name: VM_USER
|
||||
description: Default VM user
|
||||
value: fedora
|
||||
- name: VM_PASSWORD
|
||||
description: Default VM password (change after first login)
|
||||
generate: expression
|
||||
from: "[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}"
|
||||
- name: SERVICE_ACCOUNT
|
||||
description: ServiceAccount name for Kubernetes API access
|
||||
value: forgejo-runner-vm
|
||||
- name: SA_TOKEN_SECRET
|
||||
description: Name of the Secret containing the SA token
|
||||
value: forgejo-runner-vm-token
|
||||
objects:
|
||||
- apiVersion: kubevirt.io/v1
|
||||
kind: VirtualMachine
|
||||
metadata:
|
||||
name: ${VM_NAME}
|
||||
namespace: ${NAMESPACE}
|
||||
labels:
|
||||
app: forgejo-runner
|
||||
spec:
|
||||
dataVolumeTemplates:
|
||||
- metadata:
|
||||
name: ${VM_NAME}-volume
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: DataSource
|
||||
name: fedora
|
||||
namespace: openshift-virtualization-os-images
|
||||
storage:
|
||||
resources:
|
||||
requests:
|
||||
storage: ${DISK_SIZE}
|
||||
instancetype:
|
||||
kind: virtualmachineclusterinstancetype
|
||||
name: ${INSTANCE_TYPE}
|
||||
preference:
|
||||
kind: virtualmachineclusterpreference
|
||||
name: fedora
|
||||
runStrategy: Always
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
network.kubevirt.io/headlessService: headless
|
||||
spec:
|
||||
serviceAccountName: ${SERVICE_ACCOUNT}
|
||||
architecture: amd64
|
||||
domain:
|
||||
devices:
|
||||
autoattachPodInterface: false
|
||||
disks:
|
||||
- name: sa-token-disk
|
||||
disk: {}
|
||||
serial: SATOKEN000001
|
||||
interfaces:
|
||||
- masquerade: {}
|
||||
name: default
|
||||
machine:
|
||||
type: pc-q35-rhel9.6.0
|
||||
resources: {}
|
||||
networks:
|
||||
- name: default
|
||||
pod: {}
|
||||
subdomain: headless
|
||||
volumes:
|
||||
- dataVolume:
|
||||
name: ${VM_NAME}-volume
|
||||
name: rootdisk
|
||||
- cloudInitNoCloud:
|
||||
userData: |
|
||||
#cloud-config
|
||||
chpasswd:
|
||||
expire: false
|
||||
password: "${VM_PASSWORD}"
|
||||
user: "${VM_USER}"
|
||||
bootcmd:
|
||||
- "mkdir -p /mnt/sa-token"
|
||||
- "mount /dev/$(lsblk --nodeps -no name,serial | grep SATOKEN000001 | cut -f1 -d' ') /mnt/sa-token"
|
||||
name: cloudinitdisk
|
||||
- name: sa-token-disk
|
||||
secret:
|
||||
secretName: ${SA_TOKEN_SECRET}
|
||||
|
||||
|
|
@ -16,3 +16,7 @@ forgejo_instance_url: "{{ (env == 'production') | ternary(forgejo_runner_instanc
|
|||
# - secret: 40-character hex string for idempotent registration
|
||||
#
|
||||
forgejo_runners: {{ (env == 'production') | ternary(forgejo_runner_secrets, forgejo_stg_runner_secrets) }}
|
||||
|
||||
# Configuration for the zabbix agent running on the runnerhost
|
||||
forgejo_runnerhost_zabbix_agent_identity: {{ zabbix_tls_psk_identity }}
|
||||
forgejo_runnerhost_zabbix_agent_psk: {{ (env == 'production') | ternary(zabbix_tls_prod_psk, zabbix_tls_stg_psk) }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue