<p>I have K0s in single node mode on AlmaLinux 9 (SELinux disabled). I'm trying to install MetalLB to expose apps via single external IP.</p>
<ul>
<li>Public IP: <code>51.159.174.224</code></li>
<li>Private IP: <code>10.200.106.35</code></li>
</ul>
<h4>K0s config</h4>
<pre class="lang-yaml prettyprint-override"><code>[alma@scw-k8s ~]$ cat /etc/k0s/k0s.yaml
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
  creationTimestamp: null
  name: k0s
spec:
  api:
    address: 51.159.174.224
    k0sApiPort: 9443
    port: 6443
    sans:
    - 10.200.106.35
    - 10.244.0.1
    - 2001:bc8:1202:ca11::1
    - fe80::dc3c:54ff:fe06:5012
    - fe80::c8df:81ff:fe0d:811d
    - fe80::cc9e:7cff:fe1c:9da3
    - fe80::f80c:35ff:fefe:c5e2
    tunneledNetworkingMode: false
  controllerManager: {}
  extensions:
    helm:
      charts: null
      repositories: null
    storage:
      create_default_storage_class: true
      type: openebs_local_storage
  images:
    calico:
      cni:
        image: docker.io/calico/cni
        version: v3.24.1
      kubecontrollers:
        image: docker.io/calico/kube-controllers
        version: v3.24.1
      node:
        image: docker.io/calico/node
        version: v3.24.1
    coredns:
      image: docker.io/coredns/coredns
      version: 1.9.4
    default_pull_policy: IfNotPresent
    konnectivity:
      image: quay.io/k0sproject/apiserver-network-proxy-agent
      version: 0.0.32-k0s1
    kubeproxy:
      image: k8s.gcr.io/kube-proxy
      version: v1.25.2
    kuberouter:
      cni:
        image: docker.io/cloudnativelabs/kube-router
        version: v1.5.1
      cniInstaller:
        image: quay.io/k0sproject/cni-node
        version: 1.1.1-k0s.0
    metricsserver:
      image: k8s.gcr.io/metrics-server/metrics-server
      version: v0.6.1
    pushgateway:
      image: quay.io/k0sproject/pushgateway-ttl
      version: edge@sha256:7031f6bf6c957e2fdb496161fe3bea0a5bde3de800deeba7b2155187196ecbd9
  installConfig:
    users:
      etcdUser: etcd
      kineUser: kube-apiserver
      konnectivityUser: konnectivity-server
      kubeAPIserverUser: kube-apiserver
      kubeSchedulerUser: kube-scheduler
  konnectivity:
    adminPort: 8133
    agentPort: 8132
  network:
    calico: null
    clusterDomain: cluster.local
    dualStack: {}
    kubeProxy:
      mode: iptables
    kuberouter:
      autoMTU: true
      hairpinMode: false
      metricsPort: 8080
      mtu: 0
      peerRouterASNs: &quot;&quot;
      peerRouterIPs: &quot;&quot;
    podCIDR: 10.244.0.0/16
    provider: kuberouter
    serviceCIDR: 10.96.0.0/12
  scheduler: {}
  storage:
    etcd:
      externalCluster: null
      peerAddress: 10.200.106.35
    type: etcd
  telemetry:
    enabled: true
status: {}
</code></pre>
<p>MetalLB and nginx ingress controller are installed via Helm Charts:</p>
<ul>
<li>MetalLB into <code>metallb-system</code> namespace</li>
<li>nginx-ingress-controller into <code>default</code> namespace:</li>
</ul>
<p><code>metallb-system</code> namespace has all needed annotations:</p>
<p><a href="https://i.stack.imgur.com/WxX6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WxX6C.png" alt="enter image description here" /></a></p>
<p>I've created ConfigMap with allocation addresses:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: production-public-ips
      protocol: layer2
      addresses:
      - 51.159.174.224
</code></pre>
<p>Added a new service:</p>
<pre class="lang-yaml prettyprint-override"><code>...
￼---
apiVersion: v1
kind: Service
metadata:
  name: web-server-service
  namespace: web
  annotations:
    metallb.universe.tf/address-pool: production-public-ips
spec:
  selector:
    app: web
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: LoadBalancer
</code></pre>
<p>But services with <strong>LoadBalancer</strong> type can't get any external IP:</p>
<pre><code>➜  kubectl get services --all-namespaces
NAMESPACE        NAME                                                  TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
default          kubernetes                                            ClusterIP      10.96.0.1       &lt;none&gt;        443/TCP                      28h
default          nginx-ingress-controller-1664428090                   LoadBalancer   10.104.57.67    &lt;pending&gt;     80:30762/TCP,443:30274/TCP   13h
default          nginx-ingress-controller-1664428090-default-backend   ClusterIP      10.103.23.177   &lt;none&gt;        80/TCP                       13h
kube-system      kube-dns                                              ClusterIP      10.96.0.10      &lt;none&gt;        53/UDP,53/TCP,9153/TCP       28h
kube-system      metrics-server                                        ClusterIP      10.101.214.5    &lt;none&gt;        443/TCP                      28h
metallb-system   metallb-webhook-service                               ClusterIP      10.105.95.57    &lt;none&gt;        443/TCP                      14h
web              web-server-service                                    LoadBalancer   10.110.222.82   &lt;pending&gt;     80:31936/TCP                 2m4s
</code></pre>
<p>Any ideas, why LoadBalancer services can't get external IPs?
Thank you.</p>

f1nn
<p>No ideas and I don't think this will work but can you try <code>51.159.174.224/32</code> at <strong>ConfigMap</strong> instead of <code>51.159.174.224</code>.</p>
