Skip to content
Merged
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $(call add-crd-gen,operator-alpha,./operator/v1alpha1,./operator/v1alpha1,./oper
$(call add-crd-gen,quota,./quota/v1,./quota/v1,./quota/v1)
$(call add-crd-gen,samples,./samples/v1,./samples/v1,./samples/v1)
$(call add-crd-gen,security,./security/v1,./security/v1,./security/v1)
$(call add-crd-gen,network,./network/v1,./network/v1,./network/v1)

RUNTIME ?= podman
RUNTIME_IMAGE_NAME ?= openshift-api-generator
Expand Down
134 changes: 134 additions & 0 deletions network/v1/001-clusternetwork-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: clusternetworks.network.openshift.io
spec:
group: network.openshift.io
names:
kind: ClusterNetwork
listKind: ClusterNetworkList
plural: clusternetworks
singular: clusternetwork
scope: Cluster
validation:
# As compared to ValidateClusterNetwork, this does not validate that:
# - the hostSubnetLengths are valid for their CIDRs
# - the cluster/service networks do not overlap
# - .network and .hostsubnetlength are set if name == 'default'
# - .network and .hostsubnetlength are either unset, or equal to
# .clusterNetworks[0].CIDR and .clusterNetworks[0].hostSubnetLength
openAPIV3Schema:
description: ClusterNetwork describes the cluster network. There is normally
only one object of this type, named "default", which is created by the SDN
network plugin based on the master configuration when the cluster is brought
up for the first time.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
clusterNetworks:
description: ClusterNetworks is a list of ClusterNetwork objects that defines
the global overlay network's L3 space by specifying a set of CIDR and
netmasks that the SDN can allocate addresses from.
items:
description: ClusterNetworkEntry defines an individual cluster network.
The CIDRs cannot overlap with other cluster network CIDRs, CIDRs reserved
for external ips, CIDRs reserved for service networks, and CIDRs reserved
for ingress ips.
properties:
CIDR:
description: CIDR defines the total range of a cluster networks address
space.
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$'
hostSubnetLength:
description: HostSubnetLength is the number of bits of the accompanying
CIDR address to allocate to each node. eg, 8 would mean that each
node would have a /24 slice of the overlay network for its pods.
format: int32
type: integer
minimum: 2
maximum: 30
required:
- CIDR
- hostSubnetLength
type: object
type: array
hostsubnetlength:
description: HostSubnetLength is the number of bits of network to allocate
to each node. eg, 8 would mean that each node would have a /24 slice of
the overlay network for its pods
format: int32
type: integer
minimum: 2
maximum: 30
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
mtu:
description: MTU is the MTU for the overlay network. This should be 50 less
than the MTU of the network connecting the nodes. It is normally autodetected
by the cluster network operator.
format: int32
type: integer
minimum: 576
maximum: 65536
network:
description: Network is a CIDR string specifying the global overlay network's
L3 space
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$'
pluginName:
description: PluginName is the name of the network plugin being used
type: string
serviceNetwork:
description: ServiceNetwork is the CIDR range that Service IP addresses
are allocated from
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$'
vxlanPort:
description: VXLANPort sets the VXLAN destination port used by the cluster.
It is set by the master configuration file on startup and cannot be edited
manually. Valid values for VXLANPort are integers 1-65535 inclusive and
if unset defaults to 4789. Changing VXLANPort allows users to resolve
issues between openshift SDN and other software trying to use the same
VXLAN destination port.
format: int32
type: integer
minimum: 1
maximum: 65535
required:
- clusterNetworks
- serviceNetwork
type: object
additionalPrinterColumns:
- name: Cluster Network
type: string
description: The primary cluster network CIDR
JSONPath: .network
- name: Service Network
type: string
description: The service network CIDR
JSONPath: .serviceNetwork
- name: Plugin Name
type: string
description: The OpenShift SDN network plug-in in use
JSONPath: .pluginName
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
104 changes: 104 additions & 0 deletions network/v1/002-hostsubnet-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: hostsubnets.network.openshift.io
spec:
group: network.openshift.io
names:
kind: HostSubnet
listKind: HostSubnetList
plural: hostsubnets
singular: hostsubnet
scope: Cluster
validation:
# As compared to ValidateHostSubnet, this does not validate that:
# - .host == .name
# - either .subnet is set or the assign-subnet annotation is present
# As compared to ValidateHostSubnetUpdate, this does not validate that:
# - .subnet is not changed on an existing object
openAPIV3Schema:
description: HostSubnet describes the container subnet network on a node. The
HostSubnet object must have the same name as the Node object it corresponds
to.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
egressCIDRs:
description: EgressCIDRs is the list of CIDR ranges available for automatically
assigning egress IPs to this node from. If this field is set then EgressIPs
should be treated as read-only.
items:
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$'
type: array
egressIPs:
description: EgressIPs is the list of automatic egress IP addresses currently
hosted by this node. If EgressCIDRs is empty, this can be set by hand;
if EgressCIDRs is set then the master will overwrite the value here with
its own allocation of egress IPs.
items:
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$'
type: array
host:
description: Host is the name of the node. (This is the same as the object's
name, but both fields must be set.)
type: string
pattern: '^[a-z0-9.-]+$'
hostIP:
description: HostIP is the IP address to be used as a VTEP by other nodes
in the overlay network
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$'
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
subnet:
description: Subnet is the CIDR range of the overlay network assigned to
the node for its pods
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$'
required:
- host
- hostIP
type: object
additionalPrinterColumns:
- name: Host
type: string
description: The name of the node
JSONPath: .host
- name: Host IP
type: string
description: The IP address to be used as a VTEP by other nodes in the overlay network
JSONPath: .hostIP
- name: Subnet
type: string
description: The CIDR range of the overlay network assigned to the node for its pods
JSONPath: .subnet
- name: Egress CIDRs
type: string
description: The network egress CIDRs
JSONPath: .egressCIDRs
- name: Egress IPs
type: string
description: The network egress IP addresses
JSONPath: .egressIPs
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
80 changes: 80 additions & 0 deletions network/v1/003-netnamespace-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: netnamespaces.network.openshift.io
spec:
group: network.openshift.io
names:
kind: NetNamespace
listKind: NetNamespaceList
plural: netnamespaces
singular: netnamespace
scope: Cluster
validation:
# As compared to ValidateNetNamespace, this does not validate that:
# - .netname == .name
# - .netid is not 1-9
openAPIV3Schema:
description: NetNamespace describes a single isolated network. When using the
redhat/openshift-ovs-multitenant plugin, every Namespace will have a corresponding
NetNamespace object with the same name. (When using redhat/openshift-ovs-subnet,
NetNamespaces are not used.)
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
egressIPs:
description: EgressIPs is a list of reserved IPs that will be used as the
source for external traffic coming from pods in this namespace. (If empty,
external traffic will be masqueraded to Node IPs.)
items:
type: string
pattern: '^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$'
type: array
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
netid:
description: NetID is the network identifier of the network namespace assigned
to each overlay network packet. This can be manipulated with the "oc adm
pod-network" commands.
format: int32
type: integer
minimum: 0
maximum: 16777215
netname:
description: NetName is the name of the network namespace. (This is the
same as the object's name, but both fields must be set.)
type: string
pattern: '^[a-z0-9.-]+$'
required:
- netid
- netname
type: object
additionalPrinterColumns:
- name: NetID
type: integer
description: The network identifier of the network namespace
JSONPath: .netid
- name: Egress IPs
type: string
description: The network egress IP addresses
JSONPath: .egressIPs
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading