Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] vxlan+bgp-evpn #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions gen/k8s/v6test/configmap.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions gen/k8s/v6test/deployment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions gen/k8s/v6test/kustomization.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions k8s/v6test/config/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
!
frr version 9.1
frr defaults traditional
service integrated-vtysh-config
!
router bgp 64567
no bgp default ipv4-unicast
bgp disable-ebgp-connected-route-check
neighbor v6gw peer-group
neighbor v6gw remote-as 64566
neighbor v6gw ebgp-multihop
neighbor v6gw timers 10 30
neighbor 10.33.136.182 peer-group v6gw
neighbor 10.33.159.57 peer-group v6gw
!
address-family l2vpn evpn
neighbor v6gw activate
neighbor v6gw route-map evpn in
neighbor v6gw route-map evpn out
advertise-all-vni
exit-address-family
exit
!
route-map evpn permit 10
match evpn vni 66
exit
!
end
12 changes: 12 additions & 0 deletions k8s/v6test/configmap.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
apiVersion: 'v1',
kind: 'ConfigMap',
metadata: {
name: 'v6test-frr-config',
},
data: {
'frr.conf': importstr './config/frr.conf',
},
},
]
80 changes: 80 additions & 0 deletions k8s/v6test/deployment.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: 'v6test',
labels: {
'rubykaigi.org/app': 'v6test',
},
},
spec: {
replicas: 1,
selector: {
matchLabels: { 'rubykaigi.org/app': 'v6test' },
},
template: {
metadata: {
labels: { 'rubykaigi.org/app': 'v6test' },
},
spec: {
nodeSelector: {
'rubykaigi.org/node-group': 'onpremises',
},
tolerations: [
{ key: 'dedicated', value: 'onpremises', effect: 'NoSchedule' },
],
containers: [
{
name: 'frr',
image: 'quay.io/frrouting/frr:9.1.0',
command: [
'/bin/bash',
'-xe',
'-c',
|||
if ! ip link show dev vxlan-66; then
underlay_iface=eth0
local_addr=$(ip -br addr show "$underlay_iface" | awk 'match($0, /10\.33\.\d+\.\d+/) { print substr($0, RSTART, RLENGTH) }')
ip link add vxlan-66 type vxlan id 66 local "$local_addr" dstport 4789 nolearning dev "$underlay_iface"
ip link add br-66 type bridge stp_state 0
ip link set up br-66
ip link set up vxlan-66 master br-66 addrgenmode none
ip addr add 2001:df0:8500:ca60::"$local_addr"/64 dev br-66
ip route add default via 2001:df0:8500:ca60::a21:88b6
fi

ln -sf /config/frr/frr.conf /etc/frr/
sed -i 's|bgpd=no|bgpd=yes|' /etc/frr/daemons
exec /usr/lib/frr/docker-start
|||,
],
securityContext: {
capabilities: { add: ['SYS_ADMIN', 'NET_ADMIN'] },
},
volumeMounts: [
{ name: 'frr-config', mountPath: '/config/frr', readOnly: false },
],
},
{
name: 'v6test',
image: 'public.ecr.aws/docker/library/debian:stable',
command: ['/bin/sleep', '1d'],
securityContext: {
capabilities: { add: ['NET_ADMIN'] },
},
},
],
volumes: [
{
name: 'frr-config',
configMap: {
name: 'v6test-frr-config',
},
},
],
},
},
},
},
]
9 changes: 9 additions & 0 deletions k8s/v6test/kustomization.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
apiVersion: 'kustomize.config.k8s.io/v1beta1',
kind: 'Kustomization',
namespace: 'default',
resources: [
'./configmap.yml',
'./deployment.yml',
],
}
2 changes: 2 additions & 0 deletions route53/rubykaigi.net.route
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ template 'rubykaigi.net-common' do

ignore 'captioner.apne1.rubykaigi.net'

ignore_under 'v6gw.apne1.rubykaigi.net'

# external-dns ni sitai
rrset 'tftp.rubykaigi.net', 'CNAME' do
ttl 60
Expand Down
1 change: 1 addition & 0 deletions tf/v6gw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
99 changes: 99 additions & 0 deletions tf/v6gw/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tf/v6gw/aws.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
provider "aws" {
region = "ap-northeast-1"
allowed_account_ids = ["005216166247"]
default_tags {
tags = {
Project = "rk24net"
Component = "v6gw"
}
}
}

data "aws_caller_identity" "current" {}
8 changes: 8 additions & 0 deletions tf/v6gw/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
backend "s3" {
bucket = "rk-infra"
region = "ap-northeast-1"
key = "terraform/nw-v6gw.tfstate"
dynamodb_table = "rk-terraform"
}
}
19 changes: 19 additions & 0 deletions tf/v6gw/cloudconfig.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(import '../cloudconfig.base.libsonnet') {
apt: {
sources: {
nekomit: {
source: 'deb https://deb.nekom.it/ jammy main',
key: importstr 'nekomit.key',
},
},
},

packages: [
{
apt: [
'mitamae',
'zip',
],
},
],
}
Loading