Skip to content

cluster-components: Migrate metallb configuration to swh-charts

Antoine R. Dumont requested to merge migrate-metallb-declaration into production

(Better reviewed one commit at a time)

This allows to centralize the metallb configuration for all clusters (the installation of metallb is dealt with in cluster-configuration).

This explicitely adds the means to allocate specific ips to service. This is required for postgresql managed dbs in kubernetes to keep the psql access to dbs (as it is currently done for the staff).

[1] https://metallb.io/configuration/_advanced_ipaddresspool_configuration/

[2] helm diff
[cluster-components] Comparing changes between branches production and migrate-metallb-declaration...
Your branch is up to date with 'origin/production'.
[cluster-components] Generate config in production branch for cluster-components/values/admin-rke2.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/archive-production-rke2.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/archive-staging-rke2.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/default.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/gitlab-production.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/gitlab-staging.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/minikube.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/rancher.yaml...
[cluster-components] Generate config in production branch for cluster-components/values/test-staging-rke2.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/admin-rke2.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/archive-production-rke2.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/archive-staging-rke2.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/default.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/gitlab-production.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/gitlab-staging.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/minikube.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/rancher.yaml...
[cluster-components] Generate config in migrate-metallb-declaration branch for cluster-components/values/test-staging-rke2.yaml...


------------- diff for cluster-components/values/admin-rke2.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/admin-rke2.yaml.before, 29 documents
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/admin-rke2.yaml.after, 29 documents
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/archive-production-rke2.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/archive-production-rke2.yaml.before, 15 documents
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/archive-production-rke2.yaml.after, 15 documents
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/archive-staging-rke2.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/archive-staging-rke2.yaml.before, 16 documents
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/archive-staging-rke2.yaml.after, 16 documents
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/default.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/default.yaml.before
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/default.yaml.after
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/gitlab-production.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/gitlab-production.yaml.before
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/gitlab-production.yaml.after
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/gitlab-staging.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/gitlab-staging.yaml.before
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/gitlab-staging.yaml.after
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/minikube.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/minikube.yaml.before
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/minikube.yaml.after
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/rancher.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/rancher.yaml.before
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/rancher.yaml.after
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned no differences
        |___/



------------- diff for cluster-components/values/test-staging-rke2.yaml -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.cluster-components.WKUKJaa8/test-staging-rke2.yaml.before, six documents
 / _' | | | | |_| |_       and /tmp/swh-chart.cluster-components.WKUKJaa8/test-staging-rke2.yaml.after, eleven documents
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned one difference
        |___/

(file level)
    ---
    # Source: cluster-config/templates/metallb/ipaddresspools.yaml
    apiVersion: metallb.io/v1beta1
    kind: IPAddressPool
    metadata:
      name: test-staging-rke2-metallb-pool-ingress
      namespace: metallb
    spec:
      addresses:
      - 192.168.130.209/32
      serviceAllocation:
        namespaces:
        - ingress-nginx
        priority: 50
    # Source: cluster-config/templates/metallb/ipaddresspools.yaml
    apiVersion: metallb.io/v1beta1
    kind: IPAddressPool
    metadata:
      name: test-staging-rke2-metallb-pool-ingress-pooler
      namespace: metallb
    spec:
      addresses:
      - 192.168.130.208/32
      serviceAllocation:
        namespaces:
        - cnpg
        priority: 50
        serviceSelectors:
        - matchExpressions:
          - key: app
            operator: In
            values:
            - staging-secondary-dbs-pooler-ro
    # Source: cluster-config/templates/metallb/ipaddresspools.yaml
    apiVersion: metallb.io/v1beta1
    kind: L2Advertisement
    metadata:
      name: l2-advertisement-ingress
      namespace: metallb
    spec:
      ipAddressPools:
      - test-staging-rke2-metallb-pool-ingress
    # Source: cluster-config/templates/metallb/ipaddresspools.yaml
    apiVersion: metallb.io/v1beta1
    kind: L2Advertisement
    metadata:
      name: l2-advertisement-ingress-pooler
      namespace: metallb
    spec:
      ipAddressPools:
      - test-staging-rke2-metallb-pool-ingress-pooler
    # Source: cluster-config/templates/cloudnative-pg/pooler.yaml
    apiVersion: postgresql.cnpg.io/v1
    kind: Pooler
    metadata:
      name: staging-secondary-dbs-pooler-ro
      namespace: cnpg
    spec:
      instances: 1
      type: ro
      cluster:
        name: staging-secondary-dbs
      serviceTemplate:
        metadata:
          labels:
            app: staging-secondary-dbs-pooler
          annotations:
            # To be able to share the same ip for several services
    # https://metallb.org/usage/#ip-address-sharing
    metallb.universe.tf/allow-shared-ip: clusterIP
        spec:
          type: LoadBalancer
          externalTrafficPolicy: Cluster
      pgbouncer:
        poolMode: session
        parameters:
          max_client_conn: 1000
          default_pool_size: 10

Depends on swh/infra/sysadm-environment#5342 (closed)

Refs. swh/infra/sysadm-environment#5311 (closed)

Edited by Antoine R. Dumont

Merge request reports