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

2.x multi cluster improvements #3618

Open
wants to merge 25 commits into
base: 2.x-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dc732f8
support ha services in extendedServiceReference (#3560)
charanm08 Sep 23, 2024
d378057
#3536 show resource status for VS, TS and IL (#3564)
vidyasagar-m Sep 23, 2024
ee769a2
Rename extendedServiceReferences as multiClusterServices (#3567)
arzzon Sep 23, 2024
96ebcb8
support discovery modes for Transport Server multicluster (#3576)
vidyasagar-m Oct 3, 2024
e32fd42
Add validations for default mode in multiCluster (#3571)
arzzon Oct 3, 2024
1243808
Add support custom partition and pool settings for ServiceTypeLB (#3577)
arzzon Oct 3, 2024
736a569
Support for traffic distribution with weights in multiClusterServices…
charanm08 Oct 3, 2024
1111625
Minor fixes for multiCluster improvement (#3580)
arzzon Oct 3, 2024
8ad0298
Updating the path in RELEASE-NOTES.rst
vklohiya Oct 3, 2024
61cc4ba
Adding the error status for resource status (#3582)
vklohiya Oct 3, 2024
0c4b1a7
Improve error message for Transport server CR misconfiguration (#3583)
arzzon Oct 3, 2024
f6b48ff
update monitor name for TS (#3584)
vidyasagar-m Oct 4, 2024
b90f52e
Fix for namespace label issues (#3585)
arzzon Oct 4, 2024
628ee3d
Fix issue of nodeinformer for secondary cluster in default mode (#3586)
arzzon Oct 4, 2024
8fc4883
add UTs for default discovery mode and update monitor name for TS (#3…
vidyasagar-m Oct 9, 2024
beebcfe
Fix for pool members not updating when service port and target ports …
vklohiya Oct 9, 2024
30678fc
Support for service discovery of non multi-cluster resources in defau…
vklohiya Oct 10, 2024
f58be2f
Support for the namespace removal for svcTypeLB
vklohiya Oct 10, 2024
354802e
Merge pull request #3591 from vklohiya/2.x-MultiCluster-improvements
vklohiya Oct 16, 2024
c97b705
svcLB support for external clusters in default mode (#3603)
lavanya-f5 Oct 24, 2024
72e5c5a
use irule for traffic distribution in TS (#3602)
vidyasagar-m Oct 24, 2024
069a015
Remove false error log in default mode (#3592)
arzzon Oct 24, 2024
748756c
Updating the example to be cluster independent
vklohiya Oct 24, 2024
24c214e
show cluster name in the pool for TS (#3609)
vidyasagar-m Oct 25, 2024
fadd076
fix duplicate pool members for multiple pools (#3611)
vidyasagar-m Oct 25, 2024
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
3 changes: 2 additions & 1 deletion build-tools/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 as builder
FROM golang:1.21.12 as builder

ARG REPOPATH=$GOPATH/src/github.com/F5Networks/k8s-bigip-ctlr
ARG RUN_TESTS
Expand All @@ -8,6 +8,7 @@ ARG BUILD_INFO

WORKDIR $REPOPATH
ENV GO111MODULE on
ENV CGO_ENABLED=0
COPY . .

RUN $REPOPATH/build-tools/rel-build.sh
Expand Down
21 changes: 14 additions & 7 deletions config/apis/cis/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ type VirtualServer struct {

// VirtualServerStatus is the status of the VirtualServer resource.
type VirtualServerStatus struct {
VSAddress string `json:"vsAddress,omitempty"`
StatusOk string `json:"status,omitempty"`
VSAddress string `json:"vsAddress,omitempty"`
Status string `json:"status,omitempty"`
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
Error string `json:"error,omitempty"`
}

// VirtualServerSpec is the spec of the VirtualServer resource.
Expand Down Expand Up @@ -121,7 +123,7 @@ type VSPool struct {
HostRewrite string `json:"hostRewrite,omitempty"`
Weight *int32 `json:"weight,omitempty"`
AlternateBackends []AlternateBackend `json:"alternateBackends"`
MultiClusterServices []MultiClusterServiceReference `json:"extendedServiceReferences,omitempty"`
MultiClusterServices []MultiClusterServiceReference `json:"multiClusterServices,omitempty"`
}

// TSPool defines a pool object for Transport Server in BIG-IP.
Expand All @@ -142,7 +144,7 @@ type TSPool struct {
HostRewrite string `json:"hostRewrite,omitempty"`
Weight *int32 `json:"weight,omitempty"`
AlternateBackends []AlternateBackend `json:"alternateBackends,omitempty"`
MultiClusterServices []MultiClusterServiceReference `json:"extendedServiceReferences,omitempty"`
MultiClusterServices []MultiClusterServiceReference `json:"multiClusterServices,omitempty"`
}

// AlternateBackends lists backend svc of A/B
Expand Down Expand Up @@ -257,7 +259,10 @@ type IngressLink struct {

// IngressLinkStatus is the status of the ingressLink resource.
type IngressLinkStatus struct {
VSAddress string `json:"vsAddress,omitempty"`
VSAddress string `json:"vsAddress,omitempty"`
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
Error string `json:"error,omitempty"`
Status string `json:"status,omitempty"`
}

// IngressLinkSpec is Spec for IngressLink
Expand Down Expand Up @@ -297,8 +302,10 @@ type TransportServer struct {

// TransportServerStatus is the status of the VirtualServer resource.
type TransportServerStatus struct {
VSAddress string `json:"vsAddress,omitempty"`
StatusOk string `json:"status,omitempty"`
VSAddress string `json:"vsAddress,omitempty"`
Status string `json:"status,omitempty"`
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
Error string `json:"error,omitempty"`
}

// TransportServerSpec is the spec of the VirtualServer resource.
Expand Down
10 changes: 8 additions & 2 deletions docs/RELEASE-NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Next Release
Added Functionality
```````````````````
**What's new:**
* Multi Cluster
* Support to add HA services in multiClusterServices for Transport Servers.
* Support for traffic distribution with weights in multiClusterServices in default mode for TS
* CRD
* `Issue 3536 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/3536>`_: Support CRD status for VS, TS and IngressLink
* Support for custom partition and Pool settings for ServiceTypeLB service. `Examples <https://github.com/F5Networks/k8s-bigip-ctlr/tree/2.x-master/docs/config_examples/customResource/serviceTypeLB>`_


Bug Fixes
````````````
Expand Down Expand Up @@ -112,7 +118,7 @@ Added Functionality
```````````````````
**What's new:**
* Multi Cluster
* Support Alternate backend and cluster Ratio for Transport Server. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/customResource/transportServer/ts-with-weight-extended-service.yaml>`_.
* Support Alternate backend and cluster Ratio for Transport Server. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/customResource/transportServer/>`_.
* CRD
* `Issue 3337 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/3337>`_: Support for access profile and per request policy in policy CRD and VS CRD. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/customResource/Policy/policy-with-profileAccess.yaml>`_.
* `Issue 3352 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/3352>`_: Add support for alternate backend,weight and ratio for transport server. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/customResource/TransportServer/ts-with-weight-alternate-backend/ts-with-weight-alternate-backend.yaml>`_.
Expand Down Expand Up @@ -177,7 +183,7 @@ Added Functionality
* Multi Cluster
* `Issue 3284 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/3284>`_: Add support to avoid service pool creation for clusters under maintenance. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/extendedConfigmap/>`_
* Streamline the naming convention for extended service references and multi cluster references annotations.
* See `Example with the updated field names for extendedServiceReferences in VS CRD: <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/customResource/virtualServer/vs-with-extended-services.yaml>`_
* See `Example with the updated field names for extendedServiceReferences in VS CRD: <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/customResource/virtualServer/>`_
* See `Example the updated field names for multiClusterServices annotation in NextGenRoutes: <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/multicluster/routes/route-with-multicluster-service-annotation.yaml>`_
* CRD
* `Issue 3225 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/3225>`_: Support for Host Persistence to configure and disable the Persistence in VS Policy Rule action based on host in VirtualServer. See `Example <https://github.com/F5Networks/k8s-bigip-ctlr/blob/2.x-master/docs/config_examples/customResource/VirtualServer/virtual-server-with-hostPersistence/>`_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CIS supports a/b with the alternate backed. Weight can be specified for default
- service: svc-1-external-service
serviceNamespace: default
weight: 20
extendedServiceReferences:
multiClusterServices:
- clusterName: cluster3
namespace: default
service: svc-1-external-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
- service: svc-1-external-service
serviceNamespace: default
weight: 20
extendedServiceReferences:
multiClusterServices:
- clusterName: cluster3
namespace: default
service: svc-1-external-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Annotation supported for service type LoadBalancer:
| cis.f5.com/policyName | Optional | Name of Policy CR to attach profiles/policies defined in it. | service-type-lb-with-policyname.yaml |
| cis.f5.com/ip | Mandatory | Specify the ip address for the ltm virtual server. | example-service-type-lb-staic-ip.yaml |
| cis.f5.com/host | Optional | Specify the hostname for configuring the WideIP pools on the GTM server, It works along with the EDNS CR. | service-type-lb-with-hostname.yaml |
| cis.f5.com/partition | Optional | The BIG-IP partition in which the Controller should create/update/delete objects for this ServiceTypeLB. | service-type-lb-with-custom-partition.yaml |

Note:-

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: cis.f5.com/v1
kind: Policy
metadata:
labels:
f5cr: "true"
name: test-policy
namespace: default
spec:
poolSettings:
# reselectTries specifies the maximum number of attempts to find a responsive member for a connection
# Supported values: [0, 65535]
reselectTries: 1
# serviceDownAction specifies connection handling when member is non-responsive
# Supported values: “drop”, “none”, “reselect”, “reset”
serviceDownAction: reselect
# BIG-IP AS3 sets the connection rate to a newly-active member slowly during this interval (seconds)
# Supported values: [0, 900]
slowRampTime: 20
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
cis.f5.com/ip: 10.1.1.1
cis.f5.com/policyName: test-policy
labels:
app: svc-lb1
name: svc-lb1
namespace: default
spec:
ports:
- name: svc-lb1-80
port: 80
protocol: TCP
targetPort: 80
selector:
app: svc-lb1
type: LoadBalancer
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
cis.f5.com/ip: 10.10.1.66
cis.f5.com/partition: newPartition
labels:
app: svc-lb1
name: svc-lb1
namespace: default
spec:
ports:
- name: svc-lb1-80
port: 80
protocol: TCP
targetPort: 80
selector:
app: svc-lb1
type: LoadBalancer
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ spec:
maximum: 65535
serviceDownAction:
type: string
extendedServiceReferences:
multiClusterServices:
type: array
items:
type: object
Expand Down Expand Up @@ -425,6 +425,10 @@ spec:
status:
type: string
default: Pending
lastUpdated:
type: string
error:
type: string
additionalPrinterColumns:
- name: host
type: string
Expand Down Expand Up @@ -766,7 +770,7 @@ spec:
maximum: 65535
serviceDownAction:
type: string
extendedServiceReferences:
multiClusterServices:
type: array
items:
type: object
Expand All @@ -787,9 +791,11 @@ spec:
type: integer
minimum: 0
maximum: 100
required:
- service
- servicePort
required:
- clusterName
- service
- namespace
- servicePort
required:
- virtualServerPort
- pool
Expand All @@ -806,6 +812,10 @@ spec:
status:
type: string
default: Pending
lastUpdated:
type: string
error:
type: string
additionalPrinterColumns:
- name: virtualServerAddress
type: string
Expand Down Expand Up @@ -1027,6 +1037,13 @@ spec:
properties:
vsAddress:
type: string
status:
type: string
default: pending
lastUpdated:
type: string
error:
type: string
additionalPrinterColumns:
- name: IPAMVSAddress
type: string
Expand Down
53 changes: 12 additions & 41 deletions docs/config_examples/multicluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Multi-Cluster Support in CIS allows users to expose multiple apps spread across

### Standalone CIS

In a Standalone deployment of CIS, CIS is only deployed in one cluster, then create a route resource with a Multi-Cluster annotation or CRD resource with extendedServiceReferences to expose the apps in different OpenShift/K8s clusters.
In a Standalone deployment of CIS, CIS is only deployed in one cluster, then create a route resource with a Multi-Cluster annotation or CRD resource with multiClusterServices to expose the apps in different OpenShift/K8s clusters.

![architecture](images/standaloneMultiCluster.png)

Expand Down Expand Up @@ -365,7 +365,7 @@ Health probe parameters are provided in highAvailabilityCIS in extended configma


### Route Annotation for Multi-ClusterServices
Services running in any other OpenShift clusters, apart from the HA cluster pair, can be referenced in the route annotations as mentioned below:
Services running in any other OpenShift clusters, as mentioned below:
```
virtual-server.f5.com/multiClusterServices:
'[
Expand Down Expand Up @@ -426,31 +426,13 @@ Following is the sample deployment for primary CIS deployment:


### Virutal Server Pool with Multi-ClusterServices
Services running in any other OpenShift/Kubernetes clusters, apart from the HA cluster pair, can be referenced in the VS Pool as mentioned below:
```
pools:
- path: /tea
serviceNamespace: tea
service: svc-2
servicePort: 80
extendedServiceReferences:
- clusterName: cluster2
namespace: ns1
servicePort: 8080
service: svc-1
- clusterName: cluster3
namespace: ns2
servicePort: 80
service: svc-ext-1
```
This is not supported as of now. It will be supported soon.

### Transport Server Pool with Multi-ClusterServices
Services running in any other OpenShift/Kubernetes clusters, apart from the HA cluster pair, can be referenced in the TS Pool as mentioned below:
Services running in any other OpenShift/Kubernetes clusters those are monitored by CIS, can be referenced in the TS Pool as mentioned below:
```
pool:
service: svc-1
servicePort: 8181
extendedServiceReferences:
multiClusterServices:
- clusterName: cluster2
service: svc-1
namespace: ns1
Expand Down Expand Up @@ -663,14 +645,8 @@ Ok[root@cluster-1-worker0 ~]#
where 10.244.1.213 is the CIS PodIP.


### How extendedServiceReferences is different from multiClusterServices?
extendedServiceReferences is applicable for Virtual Server CR or Transport Server CR and multiClusterServices is applicable for NextGen Routes.
extendedServiceReferences is used to refer the services running in any other OpenShift/Kubernetes clusters, apart from the HA cluster pair, in the VS Pool or TS Pool.
multiClusterServices is used to refer the services running in any other OpenShift/Kubernetes clusters, apart from the HA cluster pair, in the Route annotation.

### How multiClusterServices and extendedServiceReferences are similar?
multiClusterServices and extendedServiceReferences are similar in terms of referring the services running in any other OpenShift/Kubernetes clusters, apart from the HA cluster pair.
Both are applicable to refer services running in external Clusters, apart from the HA cluster pair
### Which services can be provided as multiClusterServices?
Any service running in any OpenShift/Kubernetes clusters which are part of the multiCluster setup can be provided as multiClusterServices.

### How to configure multiClusterServices in Route annotation?
multiClusterServices is a Route annotation. Below is the sample Route annotation with multiClusterServices:
Expand All @@ -690,15 +666,11 @@ where clusterName is the name of the cluster where the service is running, names
where cluster2 is the external cluster apart from the HA cluster pair.
Note: External Clusters doesn't need to install CIS

### How to configure extendedServiceReferences in Virtual Server CR or Transport Server CR?
extendedServiceReferences is a field in Virtual Server CR or Transport Server CR. Below is the sample Virtual Server CR with extendedServiceReferences:
### How to configure multiClusterServices in Virtual Server CR or Transport Server CR?
multiClusterServices is not supported in VirutalServer CR yet. It's supported in Transport Server CR only when CIS is running in "default" mode. Below is the sample Transport Server CR with multiClusterServices:
```
pools:
- path: /tea
serviceNamespace: tea
service: svc-2
servicePort: 80
extendedServiceReferences:
multiClusterServices:
- clusterName: cluster3
namespace: ns1
servicePort: 8080
Expand All @@ -709,8 +681,7 @@ extendedServiceReferences is a field in Virtual Server CR or Transport Server CR
service: svc-ext-1
```
where clusterName is the name of the cluster where the service is running, namespace is the namespace where the service is running, servicePort is the port of the service and service is the name of the service.
where cluster3 and cluster4 are the external clusters apart from the HA cluster pair.
Note: External Clusters doesn't need to install CIS

### Can I specify the services running in CIS HA cluster in extendedServiceReferences/multiClusterServices?
No. ExtendedServiceReferences/multiClusterServices is only applicable to refer the services running in K8S/Openshift clusters which are not part of the HA cluster(Primary/Secondary Cluster).
### Can I specify the services running in CIS HA cluster in multiClusterServices?
Yes. multiClusterServices is applicable to refer the services running in K8S/Openshift clusters which are part of the HA cluster(Primary/Secondary Cluster) as well.
Loading