añadiendo ejemplo de multus

This commit is contained in:
2025-07-25 17:20:23 +02:00
parent 743ffbad06
commit e8a0f23b4c
6 changed files with 255 additions and 0 deletions

17
coredns/configmap.yaml Normal file
View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns-config
namespace: coredns-multus
data:
Corefile: |
.:53 {
log
errors
forward . 8.8.8.8
cache 30
hosts {
192.168.0.41 apolo.c2et.com
fallthrough
}
}

32
coredns/deployment.yaml Normal file
View File

@@ -0,0 +1,32 @@
apiVersion: v1
kind: Pod
metadata:
name: coredns-multus
namespace: coredns-multus
annotations:
k8s.v1.cni.cncf.io/networks: |
[
{ "name": "br-admin", "namespace": "kube-system" },
{ "name": "br-srv", "namespace": "kube-system" }
]
spec:
hostNetwork: true
containers:
- name: coredns
image: coredns/coredns:1.11.1
volumeMounts:
- name: config-volume
mountPath: /etc/coredns/Corefile
subPath: Corefile
ports:
- containerPort: 53
protocol: UDP
- containerPort: 53
protocol: TCP
volumes:
- name: config-volume
configMap:
name: coredns-config
tolerations:
- operator: "Exists"
dnsPolicy: "Default"

4
coredns/namespace.yaml Normal file
View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: coredns-multus

View File

@@ -0,0 +1,20 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: br-admin
namespace: coredns-multus
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "br-admin",
"ipam": {
"type": "static",
"addresses": [
{
"address": "192.168.1.100/24",
"gateway": "192.168.1.1"
}
]
}
}'

View File

@@ -0,0 +1,20 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: br-srv
namespace: coredns-multus
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "br-srv",
"ipam": {
"type": "static",
"addresses": [
{
"address": "192.168.200.100/22",
"gateway": "192.168.200.1"
}
]
}
}'