Skip to content

Single node cluster adjustments

Update the following changes, then commit and push.

Reduce Longhorn replica count

Set the defaultClassReplicaCount to 1:

system/longhorn-system/values.yaml
---
# Copyright The Ubiquity Authors.
#
# Licensed under the Apache License, Version 2.0. Previously licensed under the Functional Source License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://github.com/ubiquitycluster/ubiquity/blob/main/LICENSE
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# This software was previously licensed under the Functional Source License but has now transitioned to an Apache 2.0 License
# as of June 2025.
# See the License for the specific language governing permissions and
# limitations under the License.

longhorn:
#  global:
#    nodeSelector:
#      node-role.kubernetes.io/master: "true"
  annotations:
    prometheus.io/scrape: 'true'
  defaultSettings:
    defaultReplicaCount: 3
    disableSchedulingOnCordonedNode: true
    nodeDownPodDeletionPolicy: delete-both-statefulset-and-deployment-pod
    replicaAutoBalance: best-effort
    replicaSoftAntiAffinity: false
    storageMinimalAvailablePercentage: 10
    taintToleration: StorageNode=true:PreferNoSchedule
  ingress:
    annotations:
      cert-manager.io/cluster-issuer: pebble-issuer
      hajimari.io/appName: Longhorn
      hajimari.io/icon: harddisk
    enabled: true
    host: longhorn.ubiquitycluster.uk
    ingressClassName: nginx
    path: /
    secureBackends: true
    tls: true
    tlsSecret: longhorn-local-tls
#  csi:
#    attacher:
#      nodeSelector:
#        node-role.kubernetes.io/master: "true"
  longhornRecoveryBackend:
    replicas: 1
#    nodeSelector: 
#      node-role.kubernetes.io/master: "true"
  longhornAdmissionWebhook:
    replicas: 3
#    nodeSelector:
#      node-role.kubernetes.io/master: "true"
  longhornConversionWebhook:
    replicas: 3
#    nodeSelector:
#      node-role.kubernetes.io/master: "true"
  longhornDriver:
#    nodeSelector:
#      node-role.kubernetes.io/master: "true"
    tolerations:
    - effect: PreferNoSchedule
      key: StorageNode
      operator: Equal
      value: 'true'
  longhornManager:
#    nodeSelector:
#      node-role.kubernetes.io/master: "true"
    tolerations:
    - effect: PreferNoSchedule
      key: StorageNode
      operator: Equal
      value: 'true'
  longhornUI:
    nodeSelector:
      node-role.kubernetes.io/master: "true"
    tolerations:
    - effect: PreferNoSchedule
      key: StorageNode
      operator: Equal
      value: 'true'
  persistence:
    defaultClass: true
    defaultClassReplicaCount: 3
    defaultFsType: ext4
    defaultMkfsParams: ''
    defaultReplicaAutoBalance: best-effort
    replicaSoftAntiAffinity: false

Disable automatic upgrade for OS and k3s

Because they will try to drain the only node, the pods will have no place to go. Remove them entirely:

mv system/kured disabled/system/kured
mv system/system-upgrade disabled/system/system-upgrade

Commit and push the change. You can revert it later when you add more nodes by just moving them back:

mv disabled/system/kured system/kured
mv disabled/system/system-upgrade system/system-upgrade

This process of enabling/disabling is the same for all the other components and makes it easy to add/remove them.