diff --git a/charts/stable/metallb/Chart.yaml b/charts/stable/metallb/Chart.yaml index f1b5b7f6ab6..c2a0e3cce75 100644 --- a/charts/stable/metallb/Chart.yaml +++ b/charts/stable/metallb/Chart.yaml @@ -8,6 +8,9 @@ keywords: - metallb - loadbalancer dependencies: + - name: common + repository: https://library-charts.truecharts.org + version: 10.5.6 - name: metallb repository: https://metallb.github.io/metallb version: 0.13.5 @@ -21,7 +24,7 @@ sources: - https://github.com/metallb/metallb - https://metallb.universe.tf type: application -version: 2.0.15 +version: 3.0.0 annotations: truecharts.org/catagories: | - core diff --git a/charts/stable/metallb/ci/ci-values.yaml b/charts/stable/metallb/ci/ci-values.yaml new file mode 100644 index 00000000000..1a273e1903d --- /dev/null +++ b/charts/stable/metallb/ci/ci-values.yaml @@ -0,0 +1,8 @@ +metallb: + ipAddressPools: + - addressPool: + name: ci_pool + addresses: + - 172.0.0.0/24 + autoAssign: true + avoidBuggyIPs: false diff --git a/charts/stable/metallb/crds/bgpadvertisment.yaml b/charts/stable/metallb/crds/bgpadvertisment.yaml new file mode 100644 index 00000000000..fde1cbb1d2a --- /dev/null +++ b/charts/stable/metallb/crds/bgpadvertisment.yaml @@ -0,0 +1,222 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.7.0 + creationTimestamp: null + name: bgpadvertisements.metallb.io +spec: + group: metallb.io + names: + kind: BGPAdvertisement + listKind: BGPAdvertisementList + plural: bgpadvertisements + singular: bgpadvertisement + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: + BGPAdvertisement allows to advertise the IPs coming from the + selected IPAddressPools via BGP, setting the parameters of the BGP Advertisement. + 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 + 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 + spec: + description: BGPAdvertisementSpec defines the desired state of BGPAdvertisement. + properties: + aggregationLength: + default: 32 + description: + The aggregation-length advertisement option lets you + “roll up” the /32s into a larger prefix. Defaults to 32. Works for + IPv4 addresses. + format: int32 + minimum: 1 + type: integer + aggregationLengthV6: + default: 128 + description: + The aggregation-length advertisement option lets you + “roll up” the /128s into a larger prefix. Defaults to 128. Works + for IPv6 addresses. + format: int32 + type: integer + communities: + description: + The BGP communities to be associated with the announcement. + Each item can be a community of the form 1234:1234 or the name of + an alias defined in the Community CRD. + items: + type: string + type: array + ipAddressPoolSelectors: + description: + A selector for the IPAddressPools which would get advertised + via this advertisement. If no IPAddressPool is selected by this + or by the list, the advertisement is applied to all the IPAddressPools. + items: + description: + A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + type: array + ipAddressPools: + description: + The list of IPAddressPools to advertise via this advertisement, + selected by name. + items: + type: string + type: array + localPref: + description: + The BGP LOCAL_PREF attribute which is used by BGP best + path algorithm, Path with higher localpref is preferred over one + with lower localpref. + format: int32 + type: integer + nodeSelectors: + description: + NodeSelectors allows to limit the nodes to announce as + next hops for the LoadBalancer IP. When empty, all the nodes having are + announced as next hops. + items: + description: + A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + type: array + peers: + description: + Peers limits the bgppeer to advertise the ips of the + selected pools to. When empty, the loadbalancer IP is announced + to all the BGPPeers configured. + items: + type: string + type: array + type: object + status: + description: BGPAdvertisementStatus defines the observed state of BGPAdvertisement. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/stable/metallb/crds/bgppeer.yaml b/charts/stable/metallb/crds/bgppeer.yaml new file mode 100644 index 00000000000..a922b969b50 --- /dev/null +++ b/charts/stable/metallb/crds/bgppeer.yaml @@ -0,0 +1,290 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.7.0 + creationTimestamp: null + name: bgppeers.metallb.io +spec: + group: metallb.io + names: + kind: BGPPeer + listKind: BGPPeerList + plural: bgppeers + singular: bgppeer + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: BGPPeer is the Schema for the peers API. + 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 + 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 + spec: + description: BGPPeerSpec defines the desired state of Peer. + properties: + bfdProfile: + type: string + ebgpMultiHop: + description: EBGP peer is multi-hops away + type: boolean + holdTime: + description: Requested BGP hold time, per RFC4271. + type: string + keepaliveTime: + description: Requested BGP keepalive time, per RFC4271. + type: string + myASN: + description: AS number to use for the local end of the session. + format: int32 + maximum: 4294967295 + minimum: 0 + type: integer + nodeSelectors: + description: + Only connect to this peer on nodes that match one of + these selectors. + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + minItems: 1 + type: array + required: + - key + - operator + - values + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + type: array + password: + description: + Authentication password for routers enforcing TCP MD5 + authenticated sessions + type: string + peerASN: + description: AS number to expect from the remote end of the session. + format: int32 + maximum: 4294967295 + minimum: 0 + type: integer + peerAddress: + description: Address to dial when establishing the session. + type: string + peerPort: + description: Port to dial when establishing the session. + maximum: 16384 + minimum: 0 + type: integer + routerID: + description: BGP router ID to advertise to the peer + type: string + sourceAddress: + description: Source address to use when establishing the session. + type: string + required: + - myASN + - peerASN + - peerAddress + type: object + status: + description: BGPPeerStatus defines the observed state of Peer. + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1beta2 + schema: + openAPIV3Schema: + description: BGPPeer is the Schema for the peers API. + 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 + 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 + spec: + description: BGPPeerSpec defines the desired state of Peer. + properties: + bfdProfile: + description: + The name of the BFD Profile to be used for the BFD session + associated to the BGP session. If not set, the BFD session won't + be set up. + type: string + ebgpMultiHop: + description: + To set if the BGPPeer is multi-hops away. Needed for + FRR mode only. + type: boolean + holdTime: + description: Requested BGP hold time, per RFC4271. + type: string + keepaliveTime: + description: Requested BGP keepalive time, per RFC4271. + type: string + myASN: + description: AS number to use for the local end of the session. + format: int32 + maximum: 4294967295 + minimum: 0 + type: integer + nodeSelectors: + description: + Only connect to this peer on nodes that match one of + these selectors. + items: + description: + A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + type: array + password: + description: + Authentication password for routers enforcing TCP MD5 + authenticated sessions + type: string + passwordSecret: + description: + passwordSecret is name of the authentication secret for + BGP Peer. the secret must be of type "kubernetes.io/basic-auth", + and created in the same namespace as the MetalLB deployment. The + password is stored in the secret as the key "password". + properties: + name: + description: + name is unique within a namespace to reference a + secret resource. + type: string + namespace: + description: + namespace defines the space within which the secret + name must be unique. + type: string + type: object + peerASN: + description: AS number to expect from the remote end of the session. + format: int32 + maximum: 4294967295 + minimum: 0 + type: integer + peerAddress: + description: Address to dial when establishing the session. + type: string + peerPort: + default: 179 + description: Port to dial when establishing the session. + maximum: 16384 + minimum: 0 + type: integer + routerID: + description: BGP router ID to advertise to the peer + type: string + sourceAddress: + description: Source address to use when establishing the session. + type: string + required: + - myASN + - peerASN + - peerAddress + type: object + status: + description: BGPPeerStatus defines the observed state of Peer. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/stable/metallb/crds/community.yaml b/charts/stable/metallb/crds/community.yaml new file mode 100644 index 00000000000..db194821617 --- /dev/null +++ b/charts/stable/metallb/crds/community.yaml @@ -0,0 +1,68 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.7.0 + creationTimestamp: null + name: communities.metallb.io +spec: + group: metallb.io + names: + kind: Community + listKind: CommunityList + plural: communities + singular: community + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: + Community is a collection of aliases for communities. Users can + define named aliases to be used in the BGPPeer CRD. + 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 + 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 + spec: + description: CommunitySpec defines the desired state of Community. + properties: + communities: + items: + properties: + name: + description: The name of the alias for the community. + type: string + value: + description: + The BGP community value corresponding to the given + name. + type: string + type: object + type: array + type: object + status: + description: CommunityStatus defines the observed state of Community. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/stable/metallb/crds/ipaddresspool.yaml b/charts/stable/metallb/crds/ipaddresspool.yaml new file mode 100644 index 00000000000..237a1350738 --- /dev/null +++ b/charts/stable/metallb/crds/ipaddresspool.yaml @@ -0,0 +1,80 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.7.0 + creationTimestamp: null + name: ipaddresspools.metallb.io +spec: + group: metallb.io + names: + kind: IPAddressPool + listKind: IPAddressPoolList + plural: ipaddresspools + singular: ipaddresspool + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: + IPAddressPool represents a pool of IP addresses that can be allocated + to LoadBalancer services. + 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 + 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 + spec: + description: IPAddressPoolSpec defines the desired state of IPAddressPool. + properties: + addresses: + description: + A list of IP address ranges over which MetalLB has authority. + You can list multiple ranges in a single pool, they will all share + the same settings. Each range can be either a CIDR prefix, or an + explicit start-end range of IPs. + items: + type: string + type: array + autoAssign: + default: true + description: + AutoAssign flag used to prevent MetallB from automatic + allocation for a pool. + type: boolean + avoidBuggyIPs: + default: false + description: + AvoidBuggyIPs prevents addresses ending with .0 and .255 + to be used by a pool. + type: boolean + required: + - addresses + type: object + status: + description: IPAddressPoolStatus defines the observed state of IPAddressPool. + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/stable/metallb/crds/l2advertisment.yaml b/charts/stable/metallb/crds/l2advertisment.yaml new file mode 100644 index 00000000000..c6bca62268e --- /dev/null +++ b/charts/stable/metallb/crds/l2advertisment.yaml @@ -0,0 +1,182 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.7.0 + creationTimestamp: null + name: l2advertisements.metallb.io +spec: + group: metallb.io + names: + kind: L2Advertisement + listKind: L2AdvertisementList + plural: l2advertisements + singular: l2advertisement + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: + L2Advertisement allows to advertise the LoadBalancer IPs provided + by the selected pools via L2. + 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 + 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 + spec: + description: L2AdvertisementSpec defines the desired state of L2Advertisement. + properties: + ipAddressPoolSelectors: + description: + A selector for the IPAddressPools which would get advertised + via this advertisement. If no IPAddressPool is selected by this + or by the list, the advertisement is applied to all the IPAddressPools. + items: + description: + A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + type: array + ipAddressPools: + description: + The list of IPAddressPools to advertise via this advertisement, + selected by name. + items: + type: string + type: array + nodeSelectors: + description: + NodeSelectors allows to limit the nodes to announce as + next hops for the LoadBalancer IP. When empty, all the nodes having are + announced as next hops. + items: + description: + A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + type: array + type: object + status: + description: L2AdvertisementStatus defines the observed state of L2Advertisement. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/stable/metallb/questions.yaml b/charts/stable/metallb/questions.yaml index 85be4a8e857..4e6a39e71b1 100644 --- a/charts/stable/metallb/questions.yaml +++ b/charts/stable/metallb/questions.yaml @@ -3,56 +3,298 @@ questions: # Include{global} # Include{controller} - variable: metallb - group: "App Configuration" - label: "" + group: App Configuration + label: MetalLB Configuration schema: additional_attrs: true type: dict attrs: - - variable: configInline - label: "MetalLB Configuration" + - variable: ipAddressPools + label: IP Address Pools Object schema: additional_attrs: true - type: dict - attrs: - - variable: address-pools - label: "Address Pools" + type: list + default: [] + items: + - variable: name + label: Name + description: Name of the IP address pool + schema: + type: string + required: true + default: "" + - variable: autoAssign + label: Auto Assign + description: AutoAssign flag used to prevent MetallB from automatic + allocation for a pool. + schema: + type: boolean + default: true + - variable: avoidBuggyIPs + label: Avoid Buggy IPs + description: AvoidBuggyIPs prevents addresses ending with .0 and .255 + to be used by a pool. + schema: + type: boolean + default: false + - variable: addresses + label: Addresses Pools + description: A list of IP address ranges over which MetalLB has authority. + You can list multiple ranges in a single pool, they will all share + the same settings. Each range can be either a CIDR prefix, or an + explicit start-end range of IPs. schema: type: list default: [] items: - - variable: address-pools-entry - group: "Address Pool" - label: "" + - variable: addressPoolEntry + label: Address Pool Entry schema: - additional_attrs: true - type: dict - attrs: - - variable: name - label: "Name" - schema: - type: string - default: "" - required: true - - variable: protocol - label: "Protocol" - schema: - type: string - default: "layer2" - enum: - - value: "layer2" - description: "layer2" - - value: "bgp" - description: "bgp" - - variable: addresses - label: "Addresses" - schema: - type: list - default: [] - items: - - variable: address - label: "Adress" - schema: - type: string - default: "" - required: true + type: string + default: "" + required: true + - variable: L2Advertisements + label: L2 Advertisements + description: L2Advertisement allows to advertise the LoadBalancer IPs provided + by the selected pools via L2. + schema: + additional_attrs: true + type: list + default: [] + items: + - variable: name + label: Name + description: Name of the L2 Advertisement + schema: + type: string + required: true + default: "" + - variable: addressPools + label: Address Pools + description: The list of IPAddressPools to advertise via this advertisement, + selected by name. + schema: + type: list + default: [] + items: + - variable: addressPoolEntry + label: Address Pool Entry + schema: + type: string + default: "" + required: true + - variable: nodeSelectors + label: Node Selectors + description: NodeSelectors allows to limit the nodes to announce as + next hops for the LoadBalancer IP. When empty, all the nodes having are + announced as next hops. + schema: + type: list + default: [] + items: + - variable: nodeSelectorEntry + label: Node Selector Entry + schema: + type: string + default: "" + required: true + - variable: Communities + label: Communities + description: Community is a collection of aliases for communities. Users can + define named aliases to be used in the BGPPeer CRD. + schema: + additional_attrs: true + type: list + default: [] + items: + - variable: name + label: Name + description: The name of the alias for the community. + schema: + type: string + required: true + default: "" + - variable: value + label: Value + description: The BGP community value corresponding to the given name. + schema: + type: string + required: true + default: "" + - variable: Peers + label: Peers + description: BGPPeer is the Schema for the peers API. + schema: + additional_attrs: true + type: list + default: [] + items: + - variable: name + label: Name + description: The name of the peer. + schema: + type: string + required: true + default: "" + - variable: bfdProfile + label: BFD Profile + description: The name of the BFD Profile to be used for the BFD session + associated to the BGP session. If not set, the BFD session won't + be set up. + schema: + type: string + default: "" + - variable: ebgpMultiHop + label: EBGP MultiHop + description: TTo set if the BGPPeer is multi-hops away. Needed for + FRR mode only. + schema: + type: boolean + default: false + - variable: holdTime + label: Hold Time + description: Requested BGP hold time, per RFC4271. + schema: + type: int + - variable: keepaliveTime + label: Keep Alive Time + description: Requested BGP keep alive time, per RFC4271. + schema: + type: int + - variable: myASN + label: My ASN + description: AS number to use for the local end of the session. + schema: + type: int + - variable: password + label: Password + description: Authentication password for routers enforcing TCP MD5 + authenticated sessions + schema: + type: string + private: true + default: "" + - variable: peerASN + label: Peer ASN + description: AS number to expect from the remote end of the session. + schema: + type: string + valid_chars: '^[0-9]*$' + default: "" + - variable: peerAddress + label: Peer Address + description: Address to dial when establishing the session. + schema: + type: string + default: "" + - variable: peerPort + label: Peer Port + description: Port to dial when establishing the session. + schema: + type: string + valid_chars: '^[0-9]*$' + default: "" + - variable: routerID + label: Router ID + description: BGP router ID to advertise to the peer + schema: + type: string + default: "" + - variable: sourceAddress + label: Source Address + description: Source address to use when establishing the session. + schema: + type: string + default: "" + - variable: nodeSelectors + label: Node Selectors + description: Only connect to this peer on nodes that match one of + these selectors. + schema: + type: list + default: [] + items: + - variable: nodeSelectorEntry + label: Node Selector Entry + schema: + type: string + default: "" + required: true + - variable: BGPAdvertisements + label: BGP Advertisements + description: BGPAdvertisement allows to advertise the IPs coming from the + selected IPAddressPools via BGP. + schema: + additional_attrs: true + type: list + default: [] + items: + - variable: name + label: Name + description: Name of the BGP Advertisement + schema: + type: string + required: true + default: "" + - variable: addressPools + label: Address Pools + description: The list of IPAddressPools to advertise via this advertisement, + selected by name. + schema: + type: list + default: [] + items: + - variable: addressPoolEntry + label: Address Pool Entry + schema: + type: string + default: "" + required: true + - variable: aggregationLength + label: Aggregation Length + description: The aggregation-length advertisement option lets you + "roll up" the /32s into a larger prefix. Defaults to 32. Works for + IPv4 addresses. + schema: + type: string + valid_chars: '^[0-9]*$' + default: "" + - variable: localpref + label: Local Pref + description: The BGP LOCAL_PREF attribute which is used by BGP best + path algorithm, Path with higher localpref is preferred over one + with lower localpref. + schema: + type: string + valid_chars: '^[0-9]*$' + default: "" + - variable: communities + label: Communities + description: The BGP communities to be associated with the announcement. + Each item can be a community of the form 1234:1234 or the name of + an alias defined in the Community CRD. + schema: + type: list + default: [] + items: + - variable: communityEntry + label: Community Entry + schema: + type: string + default: "" + required: true + - variable: peers + label: Peers + description: Peers limits the BGPpeer to advertise the ips of the + selected pools to. When empty, the loadbalancer IP is announced + to all the BGPPeers configured. + schema: + type: list + default: [] + items: + - variable: peerEntry + label: Peer Entry + schema: + type: string + default: "" + required: true diff --git a/charts/stable/metallb/templates/_bgpadvertisement.tpl b/charts/stable/metallb/templates/_bgpadvertisement.tpl new file mode 100644 index 00000000000..5902c6afc7a --- /dev/null +++ b/charts/stable/metallb/templates/_bgpadvertisement.tpl @@ -0,0 +1,41 @@ +{{- define "metallb.bgpadv" -}} + +{{ $namespace := .Release.Namespace }} + +{{- if .Values.metallb.BGPAdvertisements }} +{{- range .Values.metallb.BGPAdvertisements }} +apiVersion: metallb.io/v1beta1 +kind: BGPAdvertisement +metadata: + name: {{ .name }} + labels: + {{- include "tc.common.labels" $ | nindent 4 }} + annotations: + {{- include "tc.common.annotations" $ | nindent 4 }} +spec: + ipAddressPools: + {{- range .addressPools }} + - {{ . }} + {{- end }} + {{- with .aggregationLength }} + aggregationLength: {{ . | int }} + {{- end }} + {{- with .localpref }} + localpref: {{ . | int }} + {{- end }} + {{- if .communities }} + communities: + {{- range .communities }} + - {{ . }} + {{- end }} + {{- end }} + {{- if .peers }} + peers: + {{- range .peers }} + - {{ . }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} + +{{- end -}} diff --git a/charts/stable/metallb/templates/_community.tpl b/charts/stable/metallb/templates/_community.tpl new file mode 100644 index 00000000000..9b2e907c8f2 --- /dev/null +++ b/charts/stable/metallb/templates/_community.tpl @@ -0,0 +1,20 @@ +{{- define "metallb.community" -}} + +{{- if .Values.metallb.Communities }} +apiVersion: metallb.io/v1beta1 +kind: Community +metadata: + name: communities + labels: + {{- include "tc.common.labels" $ | nindent 4 }} + annotations: + {{- include "tc.common.annotations" $ | nindent 4 }} +spec: + communities: + {{- range .Values.metallb.Communities }} + - name: {{ .name }} + value: {{ .value }} + {{- end }} +{{- end }} + +{{- end -}} diff --git a/charts/stable/metallb/templates/_ipaddresspool.tpl b/charts/stable/metallb/templates/_ipaddresspool.tpl new file mode 100644 index 00000000000..32dd65c233e --- /dev/null +++ b/charts/stable/metallb/templates/_ipaddresspool.tpl @@ -0,0 +1,24 @@ +{{- define "metallb.ipAddressPool" -}} + +{{ $namespace := .Release.Namespace }} + +{{- if .Values.metallb.ipAddressPools }} +{{- range .Values.metallb.ipAddressPools }} +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: {{ .addressPool.name }} + labels: + {{- include "tc.common.labels" $ | nindent 4 }} + annotations: + {{- include "tc.common.annotations" $ | nindent 4 }} +spec: + addresses: + {{- range .addressPool.addresses }} + - {{ . }} + {{- end }} + autoAssign: {{ .addressPool.autoAssign | default true }} + avoidBuggyIPs: {{ .addressPool.avoidBuggyIPs | default false }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/stable/metallb/templates/_l2advertisement.tpl b/charts/stable/metallb/templates/_l2advertisement.tpl new file mode 100644 index 00000000000..6bad0f050fc --- /dev/null +++ b/charts/stable/metallb/templates/_l2advertisement.tpl @@ -0,0 +1,30 @@ +{{- define "metallb.layer2adv" -}} + +{{ $namespace := .Release.Namespace }} + +{{- if .Values.metallb.L2Advertisements }} +{{- range .Values.metallb.L2Advertisements }} +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: {{ .name }} + labels: + {{- include "tc.common.labels" $ | nindent 4 }} + annotations: + {{- include "tc.common.annotations" $ | nindent 4 }} +spec: + ipAddressPools: + {{- range .addressPools }} + - {{ . }} + {{- end }} + {{- if .nodeSelectors }} + {{- range .nodeSelectors }} + nodeSelectors: + - matchLabels: + kubernetes.io/hostname: {{ . }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} + +{{- end -}} diff --git a/charts/stable/metallb/templates/_peers.tpl b/charts/stable/metallb/templates/_peers.tpl new file mode 100644 index 00000000000..1345cb42e94 --- /dev/null +++ b/charts/stable/metallb/templates/_peers.tpl @@ -0,0 +1,59 @@ +{{- define "metallb.peer" -}} + +{{ $namespace := .Release.Namespace }} + +{{- if .Values.metallb.Peers }} +{{- range .Values.metallb.Peers }} +apiVersion: metallb.io/v1beta2 +kind: BGPPeer +metadata: + name: {{ .name }} + labels: + {{- include "tc.common.labels" $ | nindent 4 }} + annotations: + {{- include "tc.common.annotations" $ | nindent 4 }} +spec: + {{- with .password }} + password: {{ . }} + {{- end }} + {{- with .routerID }} + routerID: {{ . }} + {{- end }} + {{- with .bfdProfile }} + bfdProfile: {{ . }} + {{- end }} + {{- with .ebgpMultiHop }} + ebgpMultiHop: {{ . }} + {{- end }} + {{- with .holdTime }} + holdTime: {{ . }} + {{- end }} + {{- with .keepaliveTime }} + keepaliveTime: {{ . }} + {{- end }} + {{- with .myASN }} + myASN: {{ . }} + {{- end }} + {{- with .peerASN }} + peerASN: {{ . | int }} + {{- end }} + {{- with .peerAddress }} + peerAddress: {{ . }} + {{- end }} + {{- with .peerPort }} + peerPort: {{ . | int }} + {{- end }} + {{- with .sourceAddress }} + sourceAddress: {{ . }} + {{- end }} + {{- if .nodeSelectors }} + nodeSelectors: + {{- range .nodeSelectors }} + - matchLabels: + kubernetes.io/hostname: {{ . }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} + +{{- end -}} diff --git a/charts/stable/metallb/templates/common.yaml b/charts/stable/metallb/templates/common.yaml new file mode 100644 index 00000000000..2973235b99c --- /dev/null +++ b/charts/stable/metallb/templates/common.yaml @@ -0,0 +1,12 @@ +{{/* Make sure all variables are set properly */}} +{{- include "tc.common.loader.init" . }} + +{{- include "metallb.ipAddressPool" . }} + +{{- include "metallb.layer2adv" . }} + +{{- include "metallb.bgpadv" . }} + +{{- include "metallb.community" . }} + +{{- include "metallb.peer" . }} diff --git a/charts/stable/metallb/values.yaml b/charts/stable/metallb/values.yaml index 64cb479e0b9..9458004cf92 100644 --- a/charts/stable/metallb/values.yaml +++ b/charts/stable/metallb/values.yaml @@ -1,18 +1,49 @@ image: repository: placeholder - # defaults to appVersion tag: upstream pullPolicy: IfNotPresent metallb: - # configInline specifies MetalLB's configuration directly, in yaml - # format. When configInline is used, Helm manages MetalLB's - # configuration ConfigMap as part of the release, and - # existingConfigMap is ignored. - # - # Refer to https://metallb.universe.tf/configuration/ for - # available options. - configInline: {} + ipAddressPools: + - addressPool: + name: pool1 + addresses: + - 192.168.1.0/24 + autoAssign: true + avoidBuggyIPs: false + # L2Advertisements: + # - name: l2adv + # addressPools: + # - pool1 + # nodeSelectors: + # - nodeA + # BGPAdvertisements: + # - name: bgpadv + # addressPools: + # - pool1 + # aggregationLength: 24 + # localpref: 100 + # communities: + # - 1234:1 + # peers: + # - peer1 + # Communities: + # - name: community1 + # value: 1234:1 + # Peers: + # - name: peer1 + # myASN: 1234 + # password: pass + # routerID: 1234 + # bfdProfile: profile + # ebgpMultiHop: false + # holdTime: 10 + # keepaliveTime: 10 + # peerAddress: 172.30.0.2 + # peerPort: 179 + # sourceAddress: 172.30.0.3 + # nodeSelectors: + # - nodeA portal: enabled: false diff --git a/cspell.config.yaml b/cspell.config.yaml index 2e9a5b79120..d26e2781ae7 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -41,6 +41,7 @@ words: - dockerized - duplicati - dynmap + - ebgp - entrypoints - eptgmk - fireshare @@ -74,6 +75,7 @@ words: - jacobalberty - jailman - javaprefs + - keepalive - killswitch - kjeld - kube @@ -92,6 +94,7 @@ words: - localcnamerecords - localdnsrecords - localdomain + - localpref - logfile - loolwsd - mailenabled