Calico charm doesn't support advertising service's Cluster IP or External IP for the K8s services

Bug #1920034 reported by Nikolay Vinogradov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Calico Charm
Fix Released
Wishlist
George Kraft

Bug Description

Hi!

I've deployed Charmed Kubernetes on top of OpenStack with calico and openstack-integrator charms.

I'm aware that advertisement of the service IP and service external IP is not supported by the calico charm. So I tried to configure calico directly as described in [1]:

ubuntu@kubernetes-worker-0:~$ sudo calicoctl get bgpconfig -o yaml
apiVersion: projectcalico.org/v3
items:
- apiVersion: projectcalico.org/v3
  kind: BGPConfiguration
  metadata:
    creationTimestamp: 2021-03-14T13:27:29Z
    name: default
    resourceVersion: "749731"
    uid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  spec:
    asNumber: <pvt_as_number>
    logSeverityScreen: Debug
    nodeToNodeMeshEnabled: true
    serviceClusterIPs:
    - cidr: 192.168.132.128/26
    serviceExternalIPs:
    - cidr: 192.168.132.192/26
kind: BGPConfigurationList
metadata:
  resourceVersion: "991445"

With this configuration after I create a service using Kubernetes manifest I don't see the service IP advertised.

Also when modify the service to "type: LoadBalancer" I see that K8s creates OpenStack LB, but Calico does not advertise the external IP to the peers as described in [2].

$ kubectl get svc -o yaml hello
apiVersion: v1
kind: Service
...
  name: hello
  namespace: default
...
  uid: ...
spec:
  clusterIP: 192.168.132.139
  clusterIPs:
  - 192.168.132.139
  externalTrafficPolicy: Cluster
  ports:
  - nodePort: 30391
    port: 80
    protocol: TCP
    targetPort: http
  selector:
    app: nginx-svc-test
    tier: backend
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer: {}

$ openstak loadbalancer list | grep hello
... | kube_service_kubernetes-..._default_hello | ... | 192.168.9.245 | ACTIVE | amphora

Same happens also if I manually assign the external IP to the service, i.e. not changing the type to LoadBalancer, but just patching the service via kubectl.

So to summarize: the functionality described in [2] and [1] cannot be enabled in charmed Calico deployment by following the described steps.

Please fix / implement this functionality.

[1] https://docs.projectcalico.org/networking/advertise-service-ips#advertise-service-external-ip-addresses
[2] https://docs.projectcalico.org/networking/advertise-service-ips

George Kraft (cynerva)
Changed in charm-calico:
importance: Undecided → Wishlist
status: New → Triaged
summary: - Calico charm doesn't support calico loadbalancer for the K8s services
+ Calico charm doesn't support advertising service's External IP for the
+ K8s services
summary: - Calico charm doesn't support advertising service's External IP for the
- K8s services
+ Calico charm doesn't support advertising service's Cluster IP or
+ External IP for the K8s services
description: updated
Revision history for this message
George Kraft (cynerva) wrote :

In a test deployment, I was able to verify that passing a kubeconfig to calico-node causes Calico to advertise service IPs properly.

To fully support this, we will need to:

1) Define a system:calico-node user with appropriate RBAC rules.
2) Configure calico-node with KUBECONFIG using the system:calico-node user.
3) Add charm config options for serviceClusterIPs, serviceExternalIPs, and serviceLoadBalancerIPs.

Revision history for this message
Cory Johns (johnsca) wrote :

https://github.com/charmed-kubernetes/layer-calico/pull/70 has been available in edge for a week or so now.

Changed in charm-calico:
status: Triaged → Fix Committed
assignee: nobody → George Kraft (cynerva)
milestone: none → 1.22
Changed in charm-calico:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.