Fixing meta

This commit is contained in:
2024-05-12 13:44:20 +02:00
parent ed58ef54e1
commit 988497833f
141 changed files with 9443 additions and 7802 deletions

View File

@@ -0,0 +1,12 @@
locals {
common-labels = {
"vynil.solidite.fr/owner-name" = var.instance
"vynil.solidite.fr/owner-namespace" = var.namespace
"vynil.solidite.fr/owner-category" = var.category
"vynil.solidite.fr/owner-component" = var.component
"app.kubernetes.io/managed-by" = "vynil"
"app.kubernetes.io/name" = var.component
"app.kubernetes.io/instance" = var.instance
}
}

View File

@@ -0,0 +1,78 @@
---
apiVersion: vinyl.solidite.fr/v1beta1
kind: Component
category: virt
metadata:
name: whereabouts
description: an IPAM plugin for CNIs capable of generating uniq IP across the cluster
options:
cni:
default:
bin_dir: /opt/cni/bin
conf_dir: /etc/cni/net.d
examples:
- bin_dir: /opt/cni/bin
conf_dir: /etc/cni/net.d
properties:
bin_dir:
default: /opt/cni/bin
description: use /var/lib/rancher/k3s/data/current/bin for k3s
type: string
conf_dir:
default: /etc/cni/net.d
description: use /var/lib/rancher/k3s/agent/etc/cni/net.d for k3s
type: string
type: object
images:
default:
operator:
pull_policy: IfNotPresent
registry: ghcr.io
repository: k8snetworkplumbingwg/whereabouts
tag: v0.7.0
examples:
- operator:
pull_policy: IfNotPresent
registry: ghcr.io
repository: k8snetworkplumbingwg/whereabouts
tag: v0.7.0
properties:
operator:
default:
pull_policy: IfNotPresent
registry: ghcr.io
repository: k8snetworkplumbingwg/whereabouts
tag: v0.7.0
properties:
pull_policy:
default: IfNotPresent
enum:
- Always
- Never
- IfNotPresent
type: string
registry:
default: ghcr.io
type: string
repository:
default: k8snetworkplumbingwg/whereabouts
type: string
tag:
default: v0.7.0
type: string
type: object
type: object
dependencies:
- dist: null
category: crd
component: whereabouts
providers:
kubernetes: true
authentik: null
kubectl: true
postgresql: null
mysql: null
restapi: null
http: null
gitea: null
tfaddtype: null

View File

@@ -0,0 +1,17 @@
resource "kubectl_manifest" "ConfigMap_whereabouts-config" {
yaml_body = <<-EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: whereabouts-config
namespace: ${var.namespace}
annotations:
kubernetes.io/description: |
Configmap containing user customizable cronjob schedule
ownerReferences: ${jsonencode(var.install_owner)}
labels: ${jsonencode(local.common-labels)}
data:
cron-expression: 30 4 * * *
EOF
}

View File

@@ -0,0 +1,91 @@
resource "kubectl_manifest" "ServiceAccount_whereabouts" {
yaml_body = <<-EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: whereabouts
namespace: ${var.namespace}
ownerReferences: ${jsonencode(var.install_owner)}
labels: ${jsonencode(local.common-labels)}
EOF
}
resource "kubectl_manifest" "ClusterRoleBinding_whereabouts" {
yaml_body = <<-EOF
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: whereabouts
labels: ${jsonencode(local.common-labels)}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: whereabouts-cni
subjects:
- kind: ServiceAccount
name: whereabouts
namespace: ${var.namespace}
EOF
}
resource "kubectl_manifest" "ClusterRole_whereabouts-cni" {
yaml_body = <<-EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: whereabouts-cni
labels: ${jsonencode(local.common-labels)}
rules:
- apiGroups:
- whereabouts.cni.cncf.io
resources:
- ippools
- overlappingrangeipreservations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
- apiGroups:
- ''
resources:
- pods
verbs:
- list
- watch
- apiGroups:
- ''
resources:
- nodes
verbs:
- get
- apiGroups:
- k8s.cni.cncf.io
resources:
- network-attachment-definitions
verbs:
- get
- list
- watch
- apiGroups:
- ''
- events.k8s.io
resources:
- events
verbs:
- create
- patch
- update
- get
EOF
}

View File

@@ -0,0 +1,80 @@
resource "kubectl_manifest" "DaemonSet_whereabouts" {
yaml_body = <<-EOF
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: whereabouts
namespace: ${var.namespace}
labels: ${jsonencode(local.common-labels)}
ownerReferences: ${jsonencode(var.install_owner)}
spec:
selector:
matchLabels:
name: whereabouts
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
tier: node
app: whereabouts
name: whereabouts
spec:
hostNetwork: true
serviceAccountName: whereabouts
tolerations:
- operator: Exists
effect: NoSchedule
containers:
- name: whereabouts
command:
- /bin/sh
args:
- -c
- |
SLEEP=false /install-cni.sh && /ip-control-loop -log-level debug
image: ${var.images.operator.registry}/${var.images.operator.repository}:${var.images.operator.tag}
imagePullPolicy: ${var.images.operator.pull_policy}
env:
- name: NODENAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: WHEREABOUTS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 200Mi
securityContext:
privileged: true
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: cni-net-dir
mountPath: /host/etc/cni/net.d
- name: cron-scheduler-configmap
mountPath: /cron-schedule
volumes:
- name: cnibin
hostPath:
path: ${var.cni.bin_dir}
- name: cni-net-dir
hostPath:
path: ${var.cni.conf_dir}
- name: cron-scheduler-configmap
configMap:
name: whereabouts-config
defaultMode: 0744
items:
- key: cron-expression
path: config
EOF
}