Skip to content

Commit

Permalink
feat(networking): convert to multus thin
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Dec 20, 2024
1 parent 970cac6 commit f7f4489
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 32 deletions.
70 changes: 48 additions & 22 deletions kubernetes/apps/networking/multus/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: multus
name: &app multus
spec:
interval: 30m
chart:
spec:
chart: multus
version: 5.0.7
chart: app-template
version: 3.5.1
sourceRef:
kind: HelmRepository
name: angelnu
name: bjw-s
namespace: flux-system
install:
remediation:
Expand All @@ -22,21 +22,47 @@ spec:
strategy: rollback
retries: 3
values:
image:
repository: ghcr.io/buroa/multus-cni
tag: dev@sha256:873788c07144c6339fde6b734b67208f425a533607a7d915291f0f46bad92084
cni:
image:
repository: ghcr.io/buroa/cni-plugins
tag: 1.6.1@sha256:01707442d33aa5fe57a19a669edc3e38e73ca9e9377aee4902f0c0dffd59f5f1
logLevel: error
paths:
bin: /opt/cni/bin
config: /etc/cni/net.d
resources:
requests:
cpu: 10m
limits:
memory: 1024Mi
hostPaths:
netns: /var/run/netns
controllers:
multus:
type: daemonset
annotations:
reloader.stakater.com/auto: "true"
containers:
multus:
image:
repository: ghcr.io/buroa/multus-cni
tag: thin-dev@sha256:3b061386584a2b6c1e335768fdd0782e1d3ba379d67da41b013e5c81d73aee9b
command:
- /thin_entrypoint
args:
- --multus-conf-file=/config/00-multus.conf
- --cni-bin-dir=/opt/cni/bin
- --cni-conf-dir=/etc/cni/net.d
resources:
requests:
cpu: 10m
limits:
memory: 512Mi
securityContext:
privileged: true
defaultPodOptions:
hostNetwork: true
persistence:
config:
type: configMap
name: multus-configmap
globalMounts:
- path: /config/00-multus.conf
subPath: 00-multus.conf
readOnly: true
etc-cni-net-d:
type: hostPath
hostPath: /etc/cni/net.d
opt-cni-bin:
type: hostPath
hostPath: /opt/cni/bin
tmp:
type: emptyDir
serviceAccount:
create: true
name: *app
9 changes: 9 additions & 0 deletions kubernetes/apps/networking/multus/app/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./rbac.yaml
# renovate: depName=k8snetworkplumbingwg/network-attachment-definition-client datasource=github-releases
- https://raw.githubusercontent.com/k8snetworkplumbingwg/network-attachment-definition-client/refs/tags/v1.7.5/artifacts/networks-crd.yaml
configMapGenerator:
- name: multus-configmap
files:
- ./resources/00-multus.conf
generatorOptions:
disableNameSuffixHash: true
28 changes: 28 additions & 0 deletions kubernetes/apps/networking/multus/app/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: multus
rules:
- apiGroups: ["k8s.cni.cncf.io"]
resources: ["*"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "pods/status"]
verbs: ["get", "update"]
- apiGroups: ["", "events.k8s.io"]
resources: ["events"]
verbs: ["create", "patch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: multus
roleRef:
kind: ClusterRole
name: multus
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: multus
namespace: networking
14 changes: 14 additions & 0 deletions kubernetes/apps/networking/multus/app/resources/00-multus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "multus-cni-network",
"type": "multus",
"delegates": [
{
"type": "cilium-cni",
"name": "cilium",
"delegate": {
"isDefaultGateway": true
}
}
],
"kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig"
}
9 changes: 0 additions & 9 deletions kubernetes/flux/repositories/helm/angelnu.yaml

This file was deleted.

1 change: 0 additions & 1 deletion kubernetes/flux/repositories/helm/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./actions-runner-controller.yaml
- ./angelnu.yaml
- ./backube.yaml
- ./bjw-s.yaml
- ./cilium.yaml
Expand Down

0 comments on commit f7f4489

Please sign in to comment.