-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
351 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# FlatNetwork Workload Examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: flatnetwork.pandaria.io/v1 | ||
kind: FlatNetworkSubnet | ||
metadata: | ||
name: ipvlan-ipv6-subnet201 | ||
namespace: cattle-flat-network | ||
spec: | ||
vlan: 201 | ||
cidr: fd00:eeee::/64 | ||
flatMode: ipvlan | ||
gateway: "" | ||
master: eth0 | ||
mode: "l2" | ||
podDefaultGateway: {} | ||
ranges: | ||
- from: fd00:eeee::1000 | ||
to: fd00:eeee::ffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: flatnetwork.pandaria.io/v1 | ||
kind: FlatNetworkSubnet | ||
metadata: | ||
name: ipvlan-subnet200 | ||
namespace: cattle-flat-network | ||
spec: | ||
vlan: 200 | ||
cidr: 192.168.200.0/24 | ||
flatMode: ipvlan | ||
gateway: "" | ||
master: eth0 | ||
mode: "l2" | ||
podDefaultGateway: | ||
enable: true | ||
serviceCIDR: '10.43.0.0/16' | ||
ranges: | ||
- from: 192.168.200.100 | ||
to: 192.168.200.200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-ipvlan-deployment | ||
namespace: default | ||
labels: | ||
app: nginx-ipvlan-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx-ipvlan-deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-ipvlan-deployment | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "ipvlan-subnet200" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-ipvlan-deployment | ||
image: nginx | ||
imagePullPolicy: Always | ||
securityContext: | ||
privileged: true | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-ipvlan-deployment-ipv6 | ||
namespace: default | ||
labels: | ||
app: nginx-ipvlan-deployment-ipv6 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx-ipvlan-deployment-ipv6 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-ipvlan-deployment-ipv6 | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "ipvlan-ipv6-subnet201" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-ipvlan-deployment-ipv6 | ||
image: nginx | ||
imagePullPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-ipvlan-deployment | ||
namespace: default | ||
labels: | ||
app: nginx-ipvlan | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: nginx-ipvlan | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-ipvlan | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "ipvlan-subnet200" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-ipvlan | ||
image: nginx | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-ipvlan-deployment-ipv6 | ||
namespace: default | ||
labels: | ||
app: nginx-ipvlan-ipv6 | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: nginx-ipvlan-ipv6 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-ipvlan-ipv6 | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "ipvlan-ipv6-subnet201" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-ipvlan | ||
image: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-ipvlan-service | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nginx-ipvlan | ||
ports: | ||
- port: 80 | ||
# By default and for convenience, the `targetPort` is set to | ||
# the same value as the `port` field. | ||
targetPort: 80 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-ipvlan-service-ipv6 | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nginx-ipvlan-ipv6 | ||
ports: | ||
- port: 80 | ||
# By default and for convenience, the `targetPort` is set to | ||
# the same value as the `port` field. | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: flatnetwork.pandaria.io/v1 | ||
kind: FlatNetworkSubnet | ||
metadata: | ||
name: macvlan-ipv6-subnet101 | ||
namespace: cattle-flat-network | ||
spec: | ||
vlan: 101 | ||
cidr: fd00:aaaa::/112 | ||
flatMode: macvlan | ||
gateway: "fd00:aaaa::0001" | ||
master: eth0 | ||
mode: "bridge" | ||
podDefaultGateway: {} | ||
ranges: | ||
- from: fd00:aaaa::1000 | ||
to: fd00:aaaa::ffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: flatnetwork.pandaria.io/v1 | ||
kind: FlatNetworkSubnet | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
project: "" | ||
name: macvlan-subnet100 | ||
namespace: cattle-flat-network | ||
spec: | ||
vlan: 100 | ||
cidr: 10.2.3.0/24 | ||
flatMode: macvlan | ||
gateway: "10.2.3.1" | ||
master: eth0 | ||
mode: "bridge" | ||
podDefaultGateway: {} | ||
ranges: | ||
- from: 10.2.3.100 | ||
to: 10.2.3.200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-macvlan-daemonset | ||
namespace: default | ||
labels: | ||
app: nginx-macvlan-daemonset | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx-macvlan-daemonset | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-macvlan-daemonset | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "macvlan-subnet100" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
# v1.multus-cni.io/default-network: '[{"name":"rancher-flat-network","interface":"eth0"}]' | ||
spec: | ||
containers: | ||
- name: nginx-macvlan-daemonset | ||
image: nginx | ||
imagePullPolicy: Always | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-macvlan-daemonset-ipv6 | ||
namespace: default | ||
labels: | ||
app: nginx-macvlan-daemonset-ipv6 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx-macvlan-daemonset-ipv6 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-macvlan-daemonset-ipv6 | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "macvlan-ipv6-subnet101" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-macvlan-daemonset-ipv6 | ||
image: nginx | ||
imagePullPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-macvlan-deployment | ||
namespace: default | ||
labels: | ||
app: nginx | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "macvlan-subnet100" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-macvlan-deployment-ipv6 | ||
namespace: default | ||
labels: | ||
app: nginx-ipv6 | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx-ipv6 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-ipv6 | ||
annotations: | ||
flatnetwork.pandaria.io/ip: "auto" | ||
flatnetwork.pandaria.io/subnet: "macvlan-ipv6-subnet101" | ||
flatnetwork.pandaria.io/mac: "" | ||
k8s.v1.cni.cncf.io/networks: '[{"name":"rancher-flat-network","interface":"eth1"}]' | ||
spec: | ||
containers: | ||
- name: nginx-ipv6 | ||
image: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-service | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nginx | ||
ports: | ||
- port: 80 | ||
# By default and for convenience, the `targetPort` is set to | ||
# the same value as the `port` field. | ||
targetPort: 80 | ||
# Optional field | ||
# By default and for convenience, the Kubernetes control plane | ||
# will allocate a port from a range (default: 30000-32767) | ||
nodePort: 0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-service-ipv6 | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nginx-ipv6 | ||
ports: | ||
- port: 80 | ||
# By default and for convenience, the `targetPort` is set to | ||
# the same value as the `port` field. | ||
targetPort: 80 | ||
# Optional field | ||
# By default and for convenience, the Kubernetes control plane | ||
# will allocate a port from a range (default: 30000-32767) | ||
nodePort: 0 |