Skip to content

Commit 18a6a7e

Browse files
chore: backport 2025-11-03 (#1218)
2 parents 0b60f33 + 2e52483 commit 18a6a7e

File tree

168 files changed

+4058
-23010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+4058
-23010
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ The main idea is that we are creating a multi-cluster application management sol
4949
- `test/apis` - The tests for the CRDs.
5050
- `test/upgrade` - The tests for the upgrade tests to test compatibility between versions.
5151
- `test/e2e` - The end to end tests for the member and hub agent.
52-
- `test/integration` - The integration tests for the v1alpha1 member and hub agent.
5352
- `test/scheduler` - The integration tests for the scheduler.
5453
- `test/utils` - folder contains the utils code which is used to provide common functions for tests
5554
- The `tools/` folder contains client-side tools for helping manage the fleet.

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
## Repository upload token - get it from codecov.io. Required only for private repositories
5656
token: ${{ secrets.CODECOV_TOKEN }}
5757
## Comma-separated list of files to upload
58-
files: ./it-coverage.xml;./ut-coverage.xml
58+
files: ./ut-coverage.xml
5959

6060
e2e-tests:
6161
strategy:
@@ -84,13 +84,6 @@ jobs:
8484
]
8585
if: needs.detect-noop.outputs.noop != 'true'
8686
steps:
87-
- name: Remove unnecessary files
88-
run: |
89-
sudo rm -rf /usr/share/dotnet
90-
sudo rm -rf /opt/ghc
91-
sudo rm -rf "/usr/local/share/boost"
92-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
93-
9487
- name: Set up Go
9588
uses: actions/setup-go@v6
9689
with:
@@ -153,15 +146,18 @@ jobs:
153146

154147
- name: Collect logs
155148
if: always()
149+
# Wait for a bit before log collection; this gives the agent pods some time to shut down
150+
# gracefully and flush their logs.
156151
run: |
152+
sleep 30
157153
make collect-e2e-logs
158154
env:
159155
KUBECONFIG: '/home/runner/.kube/config'
160156
LOG_DIR: 'logs-${{ matrix.customized-settings }}'
161157

162158
- name: Upload logs
163159
if: always()
164-
uses: actions/upload-artifact@v4
160+
uses: actions/upload-artifact@v5
165161
with:
166162
name: e2e-logs-${{ matrix.customized-settings }}
167163
path: test/e2e/logs-${{ matrix.customized-settings }}/

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ All controllers follow standard Kubernetes controller patterns:
209209
- Custom properties supported for scheduling decisions
210210

211211
### Multi-API Version Support
212-
- v1alpha1 APIs maintained for backward compatibility
213212
- v1beta1 APIs are current stable version
214213
- Feature flags control API version enablement
215214

Makefile

Lines changed: 3 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ MEMBER_CLUSTER_COUNT ?= 3
5555
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
5656
TOOLS_DIR := hack/tools
5757
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin)
58-
CLUSTER_CONFIG := $(abspath test/e2e/v1alpha1/kind-config.yaml)
5958

6059
# Binaries
6160
# Note: Need to use abspath so we can invoke these from subdirectories
@@ -174,25 +173,6 @@ fmt: $(GOIMPORTS) ## Run go fmt against code.
174173
vet: ## Run go vet against code.
175174
go vet ./...
176175

177-
## --------------------------------------
178-
## Kind
179-
## --------------------------------------
180-
181-
# Note that these targets are only used for E2E tests of the v1alpha1 API.
182-
183-
create-hub-kind-cluster:
184-
kind create cluster --name $(HUB_KIND_CLUSTER_NAME) --image=$(KIND_IMAGE) --config=$(CLUSTER_CONFIG) --kubeconfig=$(KUBECONFIG)
185-
186-
create-member-kind-cluster:
187-
kind create cluster --name $(MEMBER_KIND_CLUSTER_NAME) --image=$(KIND_IMAGE) --config=$(CLUSTER_CONFIG) --kubeconfig=$(KUBECONFIG)
188-
189-
load-hub-docker-image:
190-
kind load docker-image --name $(HUB_KIND_CLUSTER_NAME) $(REGISTRY)/$(HUB_AGENT_IMAGE_NAME):$(HUB_AGENT_IMAGE_VERSION)
191-
192-
load-member-docker-image:
193-
kind load docker-image --name $(MEMBER_KIND_CLUSTER_NAME) $(REGISTRY)/$(REFRESH_TOKEN_IMAGE_NAME):$(REFRESH_TOKEN_IMAGE_VERSION)
194-
kind load docker-image --name $(MEMBER_KIND_CLUSTER_NAME) $(REGISTRY)/$(MEMBER_AGENT_IMAGE_NAME):$(MEMBER_AGENT_IMAGE_VERSION)
195-
196176
## --------------------------------------
197177
## test
198178
## --------------------------------------
@@ -201,87 +181,23 @@ load-member-docker-image:
201181
test: manifests generate fmt vet local-unit-test integration-test ## Run tests.
202182

203183
##
204-
## workaround to bypass the pkg/controllers/workv1alpha1 tests failure
205-
## rollout controller tests need a bit longer to complete, so we increase the timeout
206-
##
207-
# Set up the timeout parameters as some of the test lengths have exceeded the default 10 minute mark.
184+
# Set up the timeout parameters as some of the tests (rollout controller) lengths have exceeded the default 10 minute mark.
208185
# TO-DO (chenyu1): enable parallelization for single package integration tests.
209186
.PHONY: local-unit-test
210187
local-unit-test: $(ENVTEST) ## Run tests.
211188
export CGO_ENABLED=1 && \
212189
export KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" && \
213-
go test ./pkg/controllers/workv1alpha1 -race -coverprofile=ut-coverage.xml -covermode=atomic -v && \
214-
go test `go list ./pkg/... ./cmd/... | grep -v pkg/controllers/workv1alpha1` -race -coverpkg=./... -coverprofile=ut-coverage.xml -covermode=atomic -v -timeout=20m
190+
go test `go list ./pkg/... ./cmd/...` -race -coverpkg=./... -coverprofile=ut-coverage.xml -covermode=atomic -v -timeout=20m
215191

216192
.PHONY: integration-test
217193
integration-test: $(ENVTEST) ## Run tests.
218194
export CGO_ENABLED=1 && \
219195
export KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" && \
220196
ginkgo -v -p --race --cover --coverpkg=./pkg/scheduler/... ./test/scheduler && \
221-
ginkgo -v -p --race --cover --coverpkg=./... ./test/apis/... ./test/crdinstaller && \
222-
go test ./test/integration/... -coverpkg=./... -race -coverprofile=it-coverage.xml -v
197+
ginkgo -v -p --race --cover --coverpkg=./... ./test/apis/...
223198

224199
## local tests & e2e tests
225200

226-
install-hub-agent-helm:
227-
kind export kubeconfig --name $(HUB_KIND_CLUSTER_NAME)
228-
helm install hub-agent ./charts/hub-agent/ \
229-
--set image.pullPolicy=Never \
230-
--set image.repository=$(REGISTRY)/$(HUB_AGENT_IMAGE_NAME) \
231-
--set image.tag=$(HUB_AGENT_IMAGE_VERSION) \
232-
--set logVerbosity=5 \
233-
--set namespace=fleet-system \
234-
--set enableWebhook=true \
235-
--set webhookServiceName=fleetwebhook \
236-
--set webhookClientConnectionType=service \
237-
--set enableV1Alpha1APIs=true \
238-
--set enableV1Beta1APIs=false \
239-
--set enableClusterInventoryAPI=true \
240-
--set logFileMaxSize=1000000
241-
242-
.PHONY: e2e-v1alpha1-hub-kubeconfig-secret
243-
e2e-v1alpha1-hub-kubeconfig-secret:
244-
kind export kubeconfig --name $(HUB_KIND_CLUSTER_NAME)
245-
kubectl apply -f test/e2e/v1alpha1/hub-agent-sa-secret.yaml
246-
TOKEN=$$(kubectl get secret hub-kubeconfig-secret -n fleet-system -o jsonpath='{.data.token}' | base64 -d) ;\
247-
kind export kubeconfig --name $(MEMBER_KIND_CLUSTER_NAME) ;\
248-
kubectl delete secret hub-kubeconfig-secret --ignore-not-found ;\
249-
kubectl create secret generic hub-kubeconfig-secret --from-literal=token=$$TOKEN
250-
251-
install-member-agent-helm: install-hub-agent-helm e2e-v1alpha1-hub-kubeconfig-secret
252-
kind export kubeconfig --name $(HUB_KIND_CLUSTER_NAME)
253-
## Get kind cluster IP that docker uses internally so we can talk to the other cluster. the port is the default one.
254-
HUB_SERVER_URL="https://$$(docker inspect $(HUB_KIND_CLUSTER_NAME)-control-plane --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'):6443" ;\
255-
kind export kubeconfig --name $(MEMBER_KIND_CLUSTER_NAME) ;\
256-
helm install member-agent ./charts/member-agent/ \
257-
--set config.hubURL=$$HUB_SERVER_URL \
258-
--set image.repository=$(REGISTRY)/$(MEMBER_AGENT_IMAGE_NAME) \
259-
--set image.tag=$(MEMBER_AGENT_IMAGE_VERSION) \
260-
--set refreshtoken.repository=$(REGISTRY)/$(REFRESH_TOKEN_IMAGE_NAME) \
261-
--set refreshtoken.tag=$(REFRESH_TOKEN_IMAGE_VERSION) \
262-
--set image.pullPolicy=Never \
263-
--set refreshtoken.pullPolicy=Never \
264-
--set config.memberClusterName="kind-$(MEMBER_KIND_CLUSTER_NAME)" \
265-
--set logVerbosity=5 \
266-
--set namespace=fleet-system
267-
# to make sure member-agent reads the token file.
268-
kubectl delete pod --all -n fleet-system
269-
270-
build-e2e-v1alpha1:
271-
go test -c ./test/e2e/v1alpha1
272-
273-
run-e2e-v1alpha1: build-e2e-v1alpha1
274-
KUBECONFIG=$(KUBECONFIG) HUB_SERVER_URL="https://$$(docker inspect $(HUB_KIND_CLUSTER_NAME)-control-plane --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'):6443" ./v1alpha1.test -test.v -ginkgo.v
275-
276-
.PHONY: create-kind-cluster
277-
create-kind-cluster: create-hub-kind-cluster create-member-kind-cluster install-helm
278-
279-
.PHONY: install-helm
280-
install-helm: load-hub-docker-image load-member-docker-image install-member-agent-helm
281-
282-
.PHONY: e2e-tests-v1alpha1
283-
e2e-tests-v1alpha1: create-kind-cluster run-e2e-v1alpha1
284-
285201
# E2E test label filter (can be overridden)
286202
LABEL_FILTER ?= !custom
287203

@@ -462,30 +378,6 @@ clean-bin: ## Remove all generated binaries
462378
rm -rf $(TOOLS_BIN_DIR)
463379
rm -rf ./bin
464380

465-
# Note that these targets are only used for E2E tests of the v1alpha1 API.
466-
467-
.PHONY: uninstall-helm
468-
uninstall-helm: clean-testing-resources
469-
kind export kubeconfig --name $(HUB_KIND_CLUSTER_NAME)
470-
helm uninstall hub-agent
471-
472-
kind export kubeconfig --name $(MEMBER_KIND_CLUSTER_NAME)
473-
helm uninstall member-agent
474-
475-
.PHONY: clean-testing-resources
476-
clean-testing-resources:
477-
kind export kubeconfig --name $(HUB_KIND_CLUSTER_NAME)
478-
kubectl delete ns fleet-member-kind-member-testing --ignore-not-found
479-
kubectl delete memberclusters.fleet.azure.com kind-$(MEMBER_KIND_CLUSTER_NAME) --ignore-not-found
480-
481-
kind export kubeconfig --name $(MEMBER_KIND_CLUSTER_NAME)
482-
kubectl delete ns fleet-member-kind-member-testing --ignore-not-found
483-
484-
.PHONY: clean-e2e-tests-v1alpha1
485-
clean-e2e-tests-v1alpha1:
486-
kind delete cluster --name $(HUB_KIND_CLUSTER_NAME)
487-
kind delete cluster --name $(MEMBER_KIND_CLUSTER_NAME)
488-
489381
.PHONY: clean-e2e-tests
490382
clean-e2e-tests:
491383
cd ./test/e2e && chmod +x ./stop.sh && ./stop.sh $(MEMBER_CLUSTER_COUNT)

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,44 @@ For any questions, please see the [KubeFleet discussion board](https://github.co
1515
For any issues, please open an issue in the [KubeFleet](https://github.com/kubefleet-dev/kubefleet/issues)
1616

1717

18-
[1]: https://img.shields.io/github/v/release/Azure/fleet
18+
## Quickstart
19+
20+
* [Get started here](https://kubefleet-dev.github.io/website/docs/getting-started/kind/)
21+
22+
## Documentation
23+
24+
To learn more about KubeFleet go to the [KubeFleet documentation](https://kubefleet-dev.github.io/website/).
25+
26+
## Community
27+
28+
You can reach the KubeFleet community and developers via the following channels:
29+
30+
* Q & A: [GitHub Discussions](https://github.com/kubefleet-dev/kubefleet/discussions)
31+
* Slack: [The #KubeFleet Slack channel](https://cloud-native.slack.com/archives/C08KR7589R8)
32+
* Mailing list: [mailing list](https://groups.google.com/g/kubefleet-dev)
33+
34+
## Community Meetings
35+
36+
We host bi-weekly community meetings that alternate between US/EU and APAC friendly time. In these sessions the community will showcase demos and discuss the current and future state of the project.
37+
38+
Please refer to the [calendar](https://zoom-lfx.platform.linuxfoundation.org/meetings/kubefleet?view=month) for the latest schedule:
39+
* Wednesdays at 09:30am PT [US/EU](https://zoom-lfx.platform.linuxfoundation.org/meeting/93624014488?password=27667a5c-9238-4b5a-b4d8-96daadaa9fa4) (weekly). [Convert to your timezone](https://dateful.com/convert/pacific-time-pt?t=930am).
40+
* Thursday at 9:00am CST [APAC](https://zoom-lfx.platform.linuxfoundation.org/meeting/98901589453?password=9ab588fd-1214-40c3-84c2-757c124e984f) (biweekly). [Convert to your timezone](https://dateful.com/convert/beijing-china?t=9am).
41+
42+
For more meeting information, minutes and recordings, please see the [KubeFleet community meeting doc](https://docs.google.com/document/d/1iMcHn11fPlb9ZGoMHiGEBvdIc44W1CjZvsPH3eBg6pA/edit?usp=sharing).
43+
44+
## Code of Conduct
45+
Participation in KubeFleet is governed by the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See the [Code of Conduct](CODE_OF_CONDUCT.md) for more information.
46+
47+
## Contributing
48+
49+
The [contribution guide](CONTRIBUTING.md) covers everything you need to know about how you can contribute to KubeFleet.
50+
51+
## Support
52+
For more information, see [SUPPORT](SUPPORT.md).
53+
54+
55+
[1]: https://img.shields.io/github/v/release/kubefleet-dev/kubefleet
1956
[2]: https://goreportcard.com/badge/go.goms.io/fleet
2057
[3]: https://goreportcard.com/report/go.goms.io/fleet
2158
[4]: https://codecov.io/gh/Azure/fleet/branch/main/graph/badge.svg?token=D3mtbzACjC

apis/cluster/v1/membercluster_types.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,20 @@ type MemberClusterSpec struct {
7575
Taints []Taint `json:"taints,omitempty"`
7676
}
7777

78-
// PropertyName is the name of a cluster property; it should be a Kubernetes label name.
78+
// PropertyName is the name of a cluster property.
79+
//
80+
// A valid name should be a string of one or more segments, separated by slashes (/) if applicable.
81+
//
82+
// Each segment must be 63 characters or less, start and end with an alphanumeric character,
83+
// and can include dashes (-), underscores (_), dots (.), and alphanumerics in between.
84+
//
85+
// Optionally, the property name can have a prefix, which must be a DNS subdomain up to 253 characters,
86+
// followed by a slash (/).
87+
//
88+
// Examples include:
89+
// - "avg-resource-pressure"
90+
// - "kubernetes-fleet.io/node-count"
91+
// - "kubernetes.azure.com/vm-sizes/Standard_D2s_v3/count"
7992
type PropertyName string
8093

8194
// PropertyValue is the value of a cluster property.

0 commit comments

Comments
 (0)