Skip to content

Commit 4b92bce

Browse files
committed
Merge branch 'main' into feat/support-scs2
2 parents fdcb677 + 1fb643b commit 4b92bce

9 files changed

Lines changed: 66 additions & 8 deletions

04-cloud-secret.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fi
1313
# Read settings -- make sure you can trust it
1414
source "$SET"
1515
# Read helper
16-
THISDIR=$(dirname 0)
16+
THISDIR=$(dirname $0)
1717
source "$THISDIR/_yaml_parse.sh"
1818

1919
# Create namespace
@@ -44,6 +44,7 @@ fi
4444
RAW_CLOUD=$(extract_yaml clouds.$OS_CLOUD <$CLOUDS_YAML)
4545
if ! echo "$RAW_CLOUD" | grep -q '^\s*project_id:' && echo "$RAW_CLOUD" | grep -q '^\s*project_name:'; then
4646
# Need openstack CLI for this
47+
echo "# Using openstack tools to determine project_id ..."
4748
PROJECT_NAME=$(echo "$RAW_CLOUD" | grep '^\s*project_name:' | sed 's/^\s*project_name: //')
4849
PROJECT_ID=$(openstack project show $PROJECT_NAME -c id -f value | tr -d '\r')
4950
INDENT=$(echo "$RAW_CLOUD" | grep '^\s*project_name:' | sed 's/^\(\s*\)project_name:.*$/\1/')
@@ -53,6 +54,7 @@ fi
5354
# We need a region_name, add it in
5455
if ! echo "$RAW_CLOUD" | grep -q '^\s*region_name:'; then
5556
# Need openstack CLI for this
57+
echo "# Using openstack tools to determine region_name ..."
5658
REGION=$(openstack region list -c Region -f value | head -n1 | tr -d '\r')
5759
INDENT=$(echo "$RAW_CLOUD" | grep '^\s*auth:' | sed 's/^\(\s*\)auth:.*$/\1/')
5860
export INSERT="${INDENT}region_name: $REGION"

07-cluster-secret.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
source "$SET"
1616
if test -z "$CS_SERIES"; then echo "Configure CS_SERIES, default to scs2"; CS_SERIES=scs2; fi
1717
# Read helper
18-
THISDIR=$(dirname 0)
18+
THISDIR=$(dirname $0)
1919
source "$THISDIR/_yaml_parse.sh"
2020

2121
# Create namespace

20-install-gateway-api-crd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# (c) Kurt Garloff <s7n@garloff.de>, 5/2025
33
# SPDX-License-Identifier: CC-BY-SA-4.0
44
set -e
5-
THISDIR=$(dirname 0)
5+
THISDIR=$(dirname $0)
66
# We need settings
77
unset KUBECONFIG
88
if test -n "$1"; then

21-deploy-kube-dashboard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# (c) Kurt Garloff <s7n@garloff.de>, 5/2025
33
# SPDX-License-Identifier: CC-BY-SA-4.0
44
set -e
5-
THISDIR=$(dirname 0)
5+
THISDIR=$(dirname $0)
66
# We need settings
77
unset KUBECONFIG
88
if test -n "$1"; then

50-remove-kube-dashboard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# (c) Kurt Garloff <s7n@garloff.de>, 5/2025
33
# SPDX-License-Identifier: CC-BY-SA-4.0
44
set -e
5-
THISDIR=$(dirname 0)
5+
THISDIR=$(dirname $0)
66
# We need settings
77
unset KUBECONFIG
88
if test -n "$1"; then

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ The fix has been accepted upstream and will be in the cinder-csi-2.33 driver.
7474
Note that the workaround is also not required any longer for the new
7575
`clouds.yaml` configuration style of scs2 series cluster stacks.
7676

77+
### OVN loadbalancer fixup
78+
The new way on configuring OCCM's credentials for the cloud consist
79+
of setting `use-clouds = true` in the `[Global]` swection of `cloud.conf`.
80+
The `cloud.conf` is auto-generated, and I have not yet found a way to
81+
tweak the process. The script `_11-fixup-ovn-lb.sh` does change the
82+
`ccm-cloud-config` secret to enable the ovn LB provider and restarts
83+
the OCCM.
84+
7785
### Testing and utilities
7886
* `20-install-gateway-api-crd.sh`: Install gateway API CRDs.
7987
You will need to reinstall Cilium with the right settings to get

_04-old-cloud-secret.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fi
1313
# Read settings -- make sure you can trust it
1414
source "$SET"
1515
# Read helper
16-
THISDIR=$(dirname 0)
16+
THISDIR=$(dirname $0)
1717
source "$THISDIR/_yaml_parse.sh"
1818

1919
# Create namespace

_10-old-fixup-cinder.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# 09-fixup-cinder.sh: Patch Cinder-CSI config path from /etc/kubernetes/
3+
# _10-fixup-cinder.sh: Patch Cinder-CSI config path from /etc/kubernetes/
44
# de
55
# to /etc/config/, so the reference ca-file=/etc/config/cacert in the
66
# file cloud.conf points to an existing place again.
@@ -10,7 +10,7 @@
1010
# (c) Kurt Garloff <s7n@garloff.de>, 5/2025
1111
# SPDX-License-Identifier: CC-BY-SA-4.0
1212
set -e
13-
THISDIR=$(dirname 0)
13+
THISDIR=$(dirname $0)
1414
# We need settings
1515
#unset KUBECONFIG
1616
if test -n "$1"; then

_11-fixup-ovn-lb.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
#
3+
# 11-fixup-ovn-lb.sh: Patch ccm-cloud-config secret to use ovn LB provider
4+
#
5+
# This is required to make the OCCM create octavia-ovn LBs for workloads.
6+
# This is a temporary solution. We should have a proper setting in cluster-settings.env
7+
# that gets passed down and is being consumed when the creaton of ccm-cloud-config
8+
# happens.
9+
#
10+
# (c) Kurt Garloff <s7n@garloff.de>, 7/2025
11+
# SPDX-License-Identifier: CC-BY-SA-4.0
12+
set -e
13+
THISDIR=$(dirname $0)
14+
# We need settings
15+
#unset KUBECONFIG
16+
if test -n "$1"; then
17+
SET="$1"
18+
else
19+
if test -e cluster-settings.env; then SET=cluster-settings.env;
20+
else echo "You need to pass a cluster-settings.env file as parameter"; exit 1
21+
fi
22+
fi
23+
# Read settings -- make sure you can trust it
24+
source "$SET"
25+
# Do this on the workload cluster, ensure we have a config
26+
#clusterctl get kubeconfig -n $CS_NAMESPACE $CL_NAME > ~/.kube/$CS_NAMESPACE.$CL_NAME
27+
export KUBECONFIG=~/.kube/$CS_NAMESPACE.$CL_NAME
28+
CCONF_SECRET="$(kubectl get -n kube-system secrets ccm-cloud-config -o yaml)"
29+
CCONF=$(echo "$CCONF_SECRET" | grep '^\s*cloud.conf:' | sed 's/^\s*cloud.conf: //')
30+
NCCONF=$(LB=0; while read line; do
31+
if test $LB = 0; then echo "$line"; fi
32+
if test "$line" != "[LoadBalancer]" -a $LB = 0; then continue; fi
33+
if test "${line:0:1}" = "[" -a $LB = 1; then LB=0; echo "$line"; continue; fi
34+
if test "$line" = "[LoadBalancer]"; then LB=1; continue; fi
35+
# If we got here, we are in the Loadbalancer section
36+
if test -z "$line"; then echo -e "enabled = true\nlb-provider = ovn\nlb-method = SOURCE_IP_PORT\ncreate-monitor = true\n"; fi
37+
# Don't output anything else here
38+
done < <(echo "$CCONF" | base64 -d) | base64 -w0)
39+
NCONF_SECRET=$(while IFS="" read line; do
40+
if echo "$line" | grep '^\s*cloud.conf' >/dev/null 2>&1; then
41+
echo "$line" | sed "s/cloud.conf: .*\$/cloud.conf: $NCCONF/"
42+
else
43+
echo "$line"
44+
fi
45+
done < <(echo "$CCONF_SECRET"))
46+
# echo echo "$NCONF_SECRET" "| kubectl apply -f -"
47+
echo "$NCONF_SECRET" | kubectl apply -f -
48+
kubectl rollout restart -n kube-system daemonset openstack-cloud-controller-manager

0 commit comments

Comments
 (0)