casa-vlan-cicd-runners - kustomization implementation
This commit is contained in:
15
README.md
15
README.md
@@ -17,6 +17,7 @@ For more information about k3s cluster/nodes setup check [readme](./docs/k3s-clu
|
|||||||
- [Zigbee2mqtt](#zigbee2mqtt)
|
- [Zigbee2mqtt](#zigbee2mqtt)
|
||||||
- [node-red](#node-red)
|
- [node-red](#node-red)
|
||||||
- [core-dns](#core-dns)
|
- [core-dns](#core-dns)
|
||||||
|
- [casa-vlan-cicd-runners (gitea act runners)](#casa-vlan-cicd-runners-gitea-act-runners)
|
||||||
|
|
||||||
## Home Assistant
|
## Home Assistant
|
||||||
|
|
||||||
@@ -97,3 +98,17 @@ data:
|
|||||||
#
|
#
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## casa-vlan-cicd-runners (gitea act runners)
|
||||||
|
|
||||||
|
**Deploy app:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./services/casa-vlan-cicd-runners/ops-scripts/apply-app.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**Deploy Infra:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./services/casa-vlan-cicd-runners/ops-scripts/apply-infra.sh
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# Deploy
|
|
||||||
|
|
||||||
```bash
|
|
||||||
set -a
|
|
||||||
source ./.env
|
|
||||||
set +a
|
|
||||||
envsubst < ./secrets.yaml | kubectl apply -f -
|
|
||||||
kubectl apply -f deploy.yaml
|
|
||||||
```
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
namespace: casa-vlan-cicd
|
|
||||||
stringData:
|
|
||||||
GITEA_INSTANCE_URL: ${GITEA_INSTANCE_URL}
|
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN}
|
|
||||||
GITEA_MYLIMBO_RUNNER_NAME: ${GITEA_MYLIMBO_RUNNER_NAME}
|
|
||||||
GITEA_MYLIMBO_RUNNER_REGISTRATION_TOKEN: ${GITEA_MYLIMBO_RUNNER_REGISTRATION_TOKEN}
|
|
||||||
GITEA_MF_RUNNER_NAME: ${GITEA_MF_RUNNER_NAME}
|
|
||||||
GITEA_MF_RUNNER_REGISTRATION_TOKEN: ${GITEA_MF_RUNNER_REGISTRATION_TOKEN}
|
|
||||||
@@ -1,127 +1,9 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: casa-vlan-cicd
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
namespace: casa-vlan-cicd
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
labels:
|
|
||||||
app: casa-vlan-cicd-runners
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: casa-vlan-cicd-runners
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: casa-vlan-cicd-runners
|
|
||||||
spec:
|
|
||||||
nodeSelector:
|
|
||||||
role: worker-node
|
|
||||||
containers:
|
|
||||||
- name: mylimbo-casa-vlan-cicd-runners
|
|
||||||
image: git.limbosolutions.com/kb/gitea/act_runner:0.2.13-network-stack
|
|
||||||
imagePullPolicy: Always
|
|
||||||
env:
|
|
||||||
- name: LOG_LEVEL
|
|
||||||
value: "trace"
|
|
||||||
|
|
||||||
- name: CONFIG_FILE
|
|
||||||
value: /config.yaml
|
|
||||||
- name: GITEA_INSTANCE_URL
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_INSTANCE_URL
|
|
||||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_MYLIMBO_RUNNER_REGISTRATION_TOKEN
|
|
||||||
- name: GITEA_RUNNER_NAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_MYLIMBO_RUNNER_NAME
|
|
||||||
|
|
||||||
- name: GITEA_RUNNER_CAPACITY
|
|
||||||
value: "1"
|
|
||||||
- name: GITEA_RUNNER_EPHEMERAL
|
|
||||||
value: "0"
|
|
||||||
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "128Mi"
|
|
||||||
cpu: "100m"
|
|
||||||
limits:
|
|
||||||
memory: "512Mi"
|
|
||||||
cpu: "400m"
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-map
|
|
||||||
mountPath: /config.yaml
|
|
||||||
subPath: config.yaml
|
|
||||||
|
|
||||||
- name: mf-casa-vlan-cicd-runners
|
|
||||||
image: git.limbosolutions.com/kb/gitea/act_runner:0.2.13-network-stack
|
|
||||||
imagePullPolicy: Always
|
|
||||||
env:
|
|
||||||
- name: LOG_LEVEL
|
|
||||||
value: "trace"
|
|
||||||
|
|
||||||
- name: CONFIG_FILE
|
|
||||||
value: /config.yaml
|
|
||||||
- name: GITEA_INSTANCE_URL
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_INSTANCE_URL
|
|
||||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_MF_RUNNER_REGISTRATION_TOKEN
|
|
||||||
- name: GITEA_RUNNER_NAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
key: GITEA_MF_RUNNER_NAME
|
|
||||||
|
|
||||||
- name: GITEA_RUNNER_CAPACITY
|
|
||||||
value: "1"
|
|
||||||
- name: GITEA_RUNNER_EPHEMERAL
|
|
||||||
value: "0"
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "128Mi"
|
|
||||||
cpu: "100m"
|
|
||||||
limits:
|
|
||||||
memory: " 512Mi"
|
|
||||||
cpu: "400m"
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-map
|
|
||||||
mountPath: /config.yaml
|
|
||||||
subPath: config.yaml
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: config-map
|
|
||||||
configMap:
|
|
||||||
name: casa-vlan-cicd-runners
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: casa-vlan-cicd-runners
|
name: casa-vlan-cicd-runners
|
||||||
namespace: casa-vlan-cicd
|
|
||||||
data:
|
data:
|
||||||
config.yaml: |
|
config.yaml: |
|
||||||
# Example configuration file, it's safe to copy this as the default config file without any modification.
|
# Example configuration file, it's safe to copy this as the default config file without any modification.
|
||||||
103
services/casa-vlan-cicd-runners/deploy/deployment.yaml
Normal file
103
services/casa-vlan-cicd-runners/deploy/deployment.yaml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
labels:
|
||||||
|
app: casa-vlan-cicd-runners
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: casa-vlan-cicd-runners
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: casa-vlan-cicd-runners
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
role: worker-node
|
||||||
|
containers:
|
||||||
|
- name: mylimbo-casa-vlan-cicd-runner
|
||||||
|
image: git.limbosolutions.com/kb/gitea/act_runner:0.2.13-network-stack
|
||||||
|
imagePullPolicy: Always
|
||||||
|
env:
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: "trace"
|
||||||
|
|
||||||
|
- name: CONFIG_FILE
|
||||||
|
value: /config.yaml
|
||||||
|
- name: GITEA_INSTANCE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_INSTANCE_URL
|
||||||
|
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_MYLIMBO_RUNNER_REGISTRATION_TOKEN
|
||||||
|
- name: GITEA_RUNNER_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_MYLIMBO_RUNNER_NAME
|
||||||
|
|
||||||
|
- name: GITEA_RUNNER_EPHEMERAL
|
||||||
|
value: "0"
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "400m"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-map
|
||||||
|
mountPath: /config.yaml
|
||||||
|
subPath: config.yaml
|
||||||
|
|
||||||
|
- name: mf-casa-vlan-cicd-runner
|
||||||
|
image: git.limbosolutions.com/kb/gitea/act_runner:0.2.13-network-stack
|
||||||
|
imagePullPolicy: Always
|
||||||
|
env:
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: "trace"
|
||||||
|
|
||||||
|
- name: CONFIG_FILE
|
||||||
|
value: /config.yaml
|
||||||
|
- name: GITEA_INSTANCE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_INSTANCE_URL
|
||||||
|
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_MF_RUNNER_REGISTRATION_TOKEN
|
||||||
|
- name: GITEA_RUNNER_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
|
key: GITEA_MF_RUNNER_NAME
|
||||||
|
|
||||||
|
- name: GITEA_RUNNER_EPHEMERAL
|
||||||
|
value: "0"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: " 512Mi"
|
||||||
|
cpu: "400m"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-map
|
||||||
|
mountPath: /config.yaml
|
||||||
|
subPath: config.yaml
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: config-map
|
||||||
|
configMap:
|
||||||
|
name: casa-vlan-cicd-runners
|
||||||
14
services/casa-vlan-cicd-runners/deploy/kustomization.yaml
Normal file
14
services/casa-vlan-cicd-runners/deploy/kustomization.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- configmap.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
|
||||||
|
secretGenerator:
|
||||||
|
- name: casa-vlan-cicd-runners
|
||||||
|
envs:
|
||||||
|
- .env.d/.env
|
||||||
|
|
||||||
4
services/casa-vlan-cicd-runners/ops-scripts/apply-app.sh
Executable file
4
services/casa-vlan-cicd-runners/ops-scripts/apply-app.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
NAMESPACE=casa-vlan-cicd
|
||||||
|
kubectl kustomize ./services/casa-vlan-cicd-runners/deploy | kubectl --namespace ${NAMESPACE} apply -f -
|
||||||
4
services/casa-vlan-cicd-runners/ops-scripts/apply-infra.sh
Executable file
4
services/casa-vlan-cicd-runners/ops-scripts/apply-infra.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
NAMESPACE=casa-vlan-cicd
|
||||||
|
kubectl create namespace ${NAMESPACE} || true
|
||||||
Reference in New Issue
Block a user