Skip to content

Commit b126e42

Browse files
committed
Merge branch 'main' into kubernetes-1.34
2 parents 51bd2ee + 41a6462 commit b126e42

19 files changed

Lines changed: 394 additions & 43 deletions

File tree

.github/local_action/start_ccm_e2e/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ runs:
8080
OSC_ACCESS_KEY: ${{ inputs.osc_access_key }}
8181
OSC_SECRET_KEY: ${{ inputs.osc_secret_key }}
8282
OSC_REGION: ${{ inputs.osc_region }}
83+
CCM_IMAGE: "${{ inputs.registry }}/outscale/cloud-provider-osc:${{ inputs.version }}"
8384
- name: 📝 Get CCM logs
8485
run: |
8586
kubectl logs -l app=osc-cloud-controller-manager -n kube-system --tail=-1

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ RUN make build
5353
# Copy the manager into the distroless image.
5454
FROM ${DISTROLESS_IMAGE}
5555
COPY --from=builder /build/osc-cloud-controller-manager /bin/osc-cloud-controller-manager
56+
COPY --from=builder /build/osc-labeler /bin/osc-labeler
5657
ENTRYPOINT [ "/bin/osc-cloud-controller-manager" ]

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ DEPLOY_NAME := "k8s-osc-ccm"
2424
SOURCES := $(shell find ./ccm -name '*.go')
2525
GOOS ?= $(shell go env GOOS)
2626
VERSION ?= $(shell git describe --tags --always --dirty)
27-
LDFLAGS := "-w -s -X 'github.com/outscale/cloud-provider-osc/cloud-controller-manager/utils.version=$(VERSION)'"
27+
LDFLAGS := "-w -s -X 'github.com/outscale/cloud-provider-osc/ccm/utils.version=$(VERSION)'"
2828

2929
ARTIFACTS ?= ./single_az_test_e2e_report
3030
GINGKO_VERSION ?= v2.23.4
@@ -59,11 +59,21 @@ help:
5959
@echo " - trivy-scan : run CVE check on Docker images"
6060
@echo " - helm-docs : generate helm doc"
6161
.PHONY: build
62-
build: $(SOURCES)
62+
build: build-ccm build-labeler
63+
64+
.PHONY: build-ccm
65+
build-ccm: $(SOURCES)
6366
CGO_ENABLED=0 GOOS=$(GOOS) go build $(GO_ADD_OPTIONS) \
6467
-ldflags $(LDFLAGS) \
6568
-o osc-cloud-controller-manager \
66-
ccm/cmd/osc-cloud-controller-manager/main.go
69+
cmd/osc-cloud-controller-manager/*.go
70+
71+
.PHONY: build-labeler
72+
build-labeler: $(SOURCES)
73+
CGO_ENABLED=0 GOOS=$(GOOS) go build $(GO_ADD_OPTIONS) \
74+
-ldflags $(LDFLAGS) \
75+
-o osc-labeler \
76+
cmd/osc-labeler/*.go
6777

6878
.PHONY: verify
6979
verify: verify-fmt vet

ccm/options.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
SPDX-FileCopyrightText: 2025 Outscale SAS <opensource@outscale.com>
3+
4+
SPDX-License-Identifier: BSD-3-Clause
5+
*/
16
package ccm
27

38
import (

ccm/cmd/osc-cloud-controller-manager/main.go renamed to cmd/osc-cloud-controller-manager/main.go

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
/*
2-
Copyright 2018 The Kubernetes Authors.
2+
SPDX-FileCopyrightText: 2025 Outscale SAS <opensource@outscale.com>
33
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
4+
SPDX-License-Identifier: BSD-3-Clause
155
*/
16-
17-
// osc-cloud-controller-manager is responsible for running controller loops
18-
// that create, delete and monitor cloud resources on 3DS outscale. These cloud
19-
// resources include FCU instances and autoscaling groups, along with network
20-
// load balancers (LBU) The cloud
21-
// resources help provide a place for both control plane components -- e.g. FCU
22-
// instances might house Kubernetes worker nodes -- as well as data plane
23-
// components.
24-
256
package main
267

278
import (
@@ -37,15 +18,15 @@ import (
3718
"k8s.io/cloud-provider/names"
3819
"k8s.io/cloud-provider/options"
3920
cliflag "k8s.io/component-base/cli/flag"
40-
"k8s.io/component-base/logs"
21+
_ "k8s.io/component-base/logs/json/register"
4122
_ "k8s.io/component-base/metrics/prometheus/clientgo" // for client metric registration
4223
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
4324
"k8s.io/klog/v2"
4425
)
4526

4627
func main() {
47-
logs.InitLogs()
48-
defer logs.FlushLogs()
28+
klog.EnableContextualLogging(true)
29+
defer klog.Flush()
4930

5031
opts, err := options.NewCloudControllerManagerOptions()
5132
if err != nil {

cmd/osc-labeler/main.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
SPDX-FileCopyrightText: 2025 Outscale SAS <opensource@outscale.com>
3+
4+
SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
package main
7+
8+
import (
9+
"context"
10+
"os"
11+
"os/signal"
12+
"runtime"
13+
14+
"github.com/outscale/cloud-provider-osc/labeler"
15+
"github.com/spf13/pflag"
16+
"k8s.io/component-base/logs"
17+
logsv1 "k8s.io/component-base/logs/api/v1"
18+
_ "k8s.io/component-base/logs/json/register"
19+
"k8s.io/klog/v2"
20+
)
21+
22+
func main() {
23+
fs := pflag.CommandLine
24+
logOptions := logs.NewOptions()
25+
logsv1.AddFlags(logOptions, fs)
26+
opts := Options{}
27+
opts.AddFlags(fs)
28+
pflag.Parse()
29+
30+
ctx := context.Background()
31+
hostname := os.Getenv("NODE_NAME")
32+
33+
err := labeler.SetLabels(ctx, hostname)
34+
if err != nil {
35+
klog.Error(err, "Unable to set labels")
36+
klog.Flush()
37+
os.Exit(1)
38+
}
39+
if opts.Wait {
40+
c := make(chan os.Signal, 1)
41+
signal.Notify(c)
42+
runtime.GC()
43+
<-c
44+
}
45+
klog.Flush()
46+
}

cmd/osc-labeler/options.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
SPDX-FileCopyrightText: 2025 Outscale SAS <opensource@outscale.com>
3+
4+
SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
package main
7+
8+
import (
9+
"github.com/spf13/pflag"
10+
)
11+
12+
type Options struct {
13+
Wait bool
14+
}
15+
16+
func (o *Options) AddFlags(fs *pflag.FlagSet) {
17+
fs.BoolVar(&o.Wait, "wait", false, "wait for a kill signal")
18+
}

docs/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [v1.34.4-beta.1] - 2026-02-03
4+
5+
No change since v1.34.4-alpha.1
6+
7+
## [v1.33.4-beta.1] - 2026-02-03
8+
9+
No change since v1.33.4-alpha.1
10+
11+
## [v1.32.4-beta.1] - 2026-02-03
12+
13+
No change since v1.32.4-alpha.1
14+
315
## [v1.34.4-alpha.1] - 2026-01-21
416

517
The CCM has switched to a new Outscale SDK. It now handles backoff on retryable API errors.

docs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,24 @@ More details on the [cloud-controller role](https://kubernetes.io/docs/concepts/
3939

4040
### Features
4141
- Node controller: manages nodes and node metadata,
42-
- Service controller: allows creation of LoadBalancer services, based on [Load Balancer Units (LBU)](https://docs.outscale.com/en/userguide/About-Load-Balancers.html).
42+
- Service controller: allows creation of LoadBalancer services, based on [Load Balancer Units (LBU)](https://docs.outscale.com/en/userguide/About-Load-Balancers.html),
43+
- Node labeler: a separate binary that can be executed on nodes to add cluster/physical host server labels on nodes ([see example](../examples/node-labels/README.md))
4344

4445
---
4546

4647
## ⚙ Installation
4748

4849
### Kubernetes version support
4950

50-
Each Kubernetes version requires a specific CCM version.
51+
Each CCM version targets a specific Kubernetes version. It is recommended to run the CCM version matching your Kubernetes version, but higher versions are expected to work.
5152

5253
CCM versions use the same major and minor version numbers as their corresponding Kubernetes releases. Patch version numbering is specific to the Outscale CCM and does not match Kubernetes patch releases.
5354

5455
E.g. Kubernetes v1.32.x will need CCM v1.32.y.
5556

5657
CCM v0.2.8 can be safely used with Kubernetes 1.30.x, and CCM v1.0.x can be safely used with Kubernetes 1.32.x.
5758

58-
CCM versions are available for Kubernetes 1.31, 1.32, and 1.33. As Kubernetes 1.31 has reached end of life (EOL), CCM v1.31 releases will be discontinued in the near future. Support for Kubernetes 1.34 will be added soon.
59+
CCM versions will be released for Kubernetes 1.32, 1.32, 1.33 and 1.34. As Kubernetes 1.31 has reached its end of life (EOL), no CCM releases are planned. In case of a critical issue with CCM v1.31.3, the latest CCM version for 1.32 may be used instead.
5960

6061
### Support matrix
6162

examples/node-labels/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Node labels
2+
3+
This example shows how to label nodes with the following topology labels:
4+
* `topology.outscale.com/cluster`
5+
* `topology.outscale.com/server`
6+
7+
This allows deployments scenarios where:
8+
* latency is critical, and pods should be deployed in the same cluster/on the same server,
9+
* redundancy is critical, and pods should be deployed in different clusters/on different servers.
10+
11+
It is expected that nodes are deployed using [attract/repulse placement contraints](https://docs.outscale.com/en/userguide/Configuring-a-VM-with-User-Data-and-OUTSCALE-Tags.html#_adding_outscale_tags_in_user_data).
12+
13+
The example deploys `osc-labeler` as a daemonset.
14+
15+
- Deploy the example
16+
```shell
17+
kubectl apply -f examples/node-labels/example.yaml
18+
```
19+
20+
- View cluster/server node labels
21+
```shell
22+
kubectl get nodes -o custom-columns=NAME:.metadata.name,CLUSTER:.metadata.labels.topology\\.outscale\\.com/cluster,SERVER:.metadata.labels.topology\\.outscale\\.com/server
23+
```
24+

0 commit comments

Comments
 (0)