Skip to content

Commit eec4281

Browse files
authored
Merge pull request #3 from kahirokunn/index-v0.21.3
🌱 Update helm chart index.yaml to v0.21.3
2 parents 594be36 + 9daf2d4 commit eec4281

Some content is hidden

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

43 files changed

+911
-393
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ about: Tell us about a problem you are experiencing
2424
- OS (e.g. from `/etc/os-release`):
2525

2626
/kind bug
27-
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-operator/labels?q=area for the list of labels]
28-
27+
[One or more /area label. See https://github.com/kahirokunn/cluster-api-operator/labels?q=area for the list of labels]

.github/workflows/smoke-test.yaml

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
name: Smoke Test
2+
3+
on:
4+
pull_request:
5+
branches: [main, 'release-*']
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
CLUSTER_NAME: capi-quickstart
15+
KIND_CLUSTER_NAME: capi-operator-smoke-test
16+
KUBERNETES_VERSION: v1.33.0
17+
CONTROLLER_IMG: cluster-api-operator
18+
TAG: smoke-test
19+
20+
jobs:
21+
smoke-test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version-file: 'go.mod'
33+
34+
- name: Install tools
35+
run: |
36+
# kubectl
37+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
38+
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
39+
40+
# yq
41+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
42+
chmod +x yq && sudo mv yq /usr/local/bin/
43+
44+
# helm
45+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
46+
47+
# clusterctl
48+
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/clusterctl-linux-amd64 -o clusterctl
49+
chmod +x clusterctl && sudo mv clusterctl /usr/local/bin/
50+
51+
- name: Build Docker image
52+
run: |
53+
make docker-build
54+
docker tag ${CONTROLLER_IMG}-amd64:${TAG} ${CONTROLLER_IMG}:${TAG}
55+
56+
- name: Build charts
57+
run: |
58+
make release-chart
59+
echo "HELM_CHART_TAG=$(make -s -f Makefile -p | grep '^HELM_CHART_TAG :=' | cut -d' ' -f3)" >> $GITHUB_ENV
60+
61+
- name: Create kind cluster
62+
run: |
63+
chmod +x ./hack/ensure-kind.sh
64+
./hack/ensure-kind.sh
65+
66+
cat <<EOF > /tmp/kind-config.yaml
67+
kind: Cluster
68+
apiVersion: kind.x-k8s.io/v1alpha4
69+
networking:
70+
ipFamily: ipv4
71+
nodes:
72+
- role: control-plane
73+
extraMounts:
74+
- hostPath: /var/run/docker.sock
75+
containerPath: /var/run/docker.sock
76+
containerdConfigPatches:
77+
- |-
78+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
79+
endpoint = ["https://mirror.gcr.io", "https://registry-1.docker.io"]
80+
EOF
81+
82+
kind create cluster --name ${KIND_CLUSTER_NAME} --config /tmp/kind-config.yaml --wait 5m
83+
kind load docker-image ${CONTROLLER_IMG}:${TAG} --name ${KIND_CLUSTER_NAME}
84+
85+
- name: Install cert-manager
86+
run: |
87+
helm repo add jetstack https://charts.jetstack.io
88+
helm repo update
89+
helm install cert-manager jetstack/cert-manager \
90+
--namespace cert-manager \
91+
--create-namespace \
92+
--set installCRDs=true \
93+
--wait \
94+
--timeout 5m
95+
96+
- name: Install Cluster API Operator
97+
run: |
98+
CHART_PACKAGE="out/package/cluster-api-operator-${HELM_CHART_TAG}.tgz"
99+
helm install capi-operator "$CHART_PACKAGE" \
100+
--create-namespace \
101+
-n capi-operator-system \
102+
--set image.manager.repository=${CONTROLLER_IMG} \
103+
--set image.manager.tag=${TAG} \
104+
--set image.manager.pullPolicy=IfNotPresent \
105+
--wait \
106+
--timeout 90s
107+
108+
- name: Deploy providers
109+
run: |
110+
cat <<EOF > /tmp/providers-values.yaml
111+
core:
112+
cluster-api:
113+
namespace: capi-system
114+
bootstrap:
115+
kubeadm:
116+
namespace: capi-kubeadm-bootstrap-system
117+
controlPlane:
118+
kubeadm:
119+
namespace: capi-kubeadm-control-plane-system
120+
infrastructure:
121+
docker:
122+
namespace: capd-system
123+
manager:
124+
featureGates:
125+
core:
126+
ClusterTopology: true
127+
ClusterResourceSet: true
128+
MachinePool: true
129+
kubeadm:
130+
ClusterTopology: true
131+
MachinePool: true
132+
docker:
133+
ClusterTopology: true
134+
EOF
135+
136+
PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz"
137+
helm install capi-providers "$PROVIDERS_CHART_PACKAGE" -f /tmp/providers-values.yaml --wait
138+
139+
- name: Wait for providers
140+
run: |
141+
kubectl wait --for=condition=Ready --timeout=300s -n capi-system coreprovider/cluster-api
142+
kubectl wait --for=condition=Ready --timeout=300s -n capi-kubeadm-bootstrap-system bootstrapprovider/kubeadm
143+
kubectl wait --for=condition=Ready --timeout=300s -n capi-kubeadm-control-plane-system controlplaneprovider/kubeadm
144+
kubectl wait --for=condition=Ready --timeout=300s -n capd-system infrastructureprovider/docker
145+
146+
kubectl wait --for=condition=Available --timeout=300s -n capi-system deployment/capi-controller-manager
147+
kubectl wait --for=condition=Available --timeout=300s -n capi-kubeadm-bootstrap-system deployment/capi-kubeadm-bootstrap-controller-manager
148+
kubectl wait --for=condition=Available --timeout=300s -n capi-kubeadm-control-plane-system deployment/capi-kubeadm-control-plane-controller-manager
149+
kubectl wait --for=condition=Available --timeout=300s -n capd-system deployment/capd-controller-manager
150+
151+
- name: Verify providers
152+
run: |
153+
kubectl get coreprovider,bootstrapprovider,controlplaneprovider,infrastructureprovider -A
154+
kubectl get pods -A | grep -E "(capi-|capd-)"
155+
156+
- name: Create workload cluster
157+
run: |
158+
clusterctl generate cluster ${CLUSTER_NAME} \
159+
--infrastructure docker:v1.10.0 \
160+
--flavor development \
161+
--kubernetes-version ${KUBERNETES_VERSION} \
162+
--control-plane-machine-count=1 \
163+
--worker-machine-count=2 \
164+
> capi-quickstart.yaml
165+
166+
kubectl apply -f capi-quickstart.yaml
167+
168+
- name: Get workload cluster kubeconfig
169+
run: |
170+
timeout 300s bash -c "until kubectl get secret ${CLUSTER_NAME}-kubeconfig -n default &>/dev/null; do sleep 2; done"
171+
clusterctl get kubeconfig ${CLUSTER_NAME} --namespace default > ${CLUSTER_NAME}.kubeconfig
172+
echo "KUBECONFIG=$(pwd)/${CLUSTER_NAME}.kubeconfig" >> $GITHUB_ENV
173+
174+
- name: Wait for workload cluster API server
175+
run: |
176+
timeout 300s bash -c "until kubectl cluster-info &>/dev/null; do sleep 5; done"
177+
178+
- name: Install CNI
179+
run: |
180+
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/calico.yaml
181+
kubectl wait --for=condition=Ready --timeout=300s pods -n tigera-operator -l app.kubernetes.io/name=tigera-operator || true
182+
kubectl wait --for=condition=Ready --timeout=300s pods -n calico-system --all || true
183+
184+
- name: Wait for nodes
185+
run: |
186+
kubectl wait --for=condition=Ready --timeout=300s nodes --all
187+
kubectl get nodes -o wide
188+
189+
- name: Verify cluster
190+
run: |
191+
kubectl get po -A
192+
kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l k8s-app=kube-proxy
193+
kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-apiserver
194+
kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-controller-manager
195+
kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-scheduler
196+
197+
- name: Collect logs on failure
198+
if: failure()
199+
run: |
200+
echo "=== Recent Events ==="
201+
kubectl get events -A --sort-by='.lastTimestamp' | tail -50
202+
203+
echo -e "\n=== Provider Logs ==="
204+
kubectl logs -n capi-operator-system deployment/capi-operator-cluster-api-operator --tail=50 || true
205+
kubectl logs -n capi-system deployment/capi-controller-manager --tail=50 || true
206+
kubectl logs -n capd-system deployment/capd-controller-manager --tail=50 || true
207+
208+
echo -e "\n=== Cluster Resources ==="
209+
kubectl get cluster,dockercluster,kubeadmcontrolplane,machine,dockermachine -A -o wide || true
210+
211+
echo -e "\n=== Failed Pods ==="
212+
kubectl get pods -A | grep -v Running | grep -v Completed || true
213+
214+
if [ -f "${CLUSTER_NAME}.kubeconfig" ]; then
215+
export KUBECONFIG=$(pwd)/${CLUSTER_NAME}.kubeconfig
216+
echo -e "\n=== Workload Cluster Status ==="
217+
kubectl get nodes -o wide || true
218+
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded || true
219+
fi
220+
221+
- name: Cleanup
222+
if: always()
223+
run: |
224+
kind delete cluster --name ${CLUSTER_NAME} || true
225+
kind delete cluster --name ${KIND_CLUSTER_NAME} || true

.krew.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: operator
55
spec:
66
version: {{ .TagName }}
7-
homepage: https://github.com/kubernetes-sigs/cluster-api-operator
7+
homepage: https://github.com/kahirokunn/cluster-api-operator
88
shortDescription: Use this clusterctl plugin to bootstrap a management cluster for Cluster API with the Cluster API Operator.
99
description: |
1010
Use this clusterctl plugin to bootstrap a management cluster for Cluster API with the Cluster API Operator.
@@ -13,30 +13,30 @@ spec:
1313
matchLabels:
1414
os: darwin
1515
arch: amd64
16-
{{addURIAndSha "https://github.com/kubernetes-sigs/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
16+
{{addURIAndSha "https://github.com/kahirokunn/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
1717
bin: bin/clusterctl-operator
1818
- selector:
1919
matchLabels:
2020
os: darwin
2121
arch: arm64
22-
{{addURIAndSha "https://github.com/kubernetes-sigs/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
22+
{{addURIAndSha "https://github.com/kahirokunn/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
2323
bin: bin/clusterctl-operator
2424
- selector:
2525
matchLabels:
2626
os: linux
2727
arch: amd64
28-
{{addURIAndSha "https://github.com/kubernetes-sigs/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
28+
{{addURIAndSha "https://github.com/kahirokunn/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
2929
bin: bin/clusterctl-operator
3030
- selector:
3131
matchLabels:
3232
os: linux
3333
arch: arm64
34-
{{addURIAndSha "https://github.com/kubernetes-sigs/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
34+
{{addURIAndSha "https://github.com/kahirokunn/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
3535
bin: bin/clusterctl-operator
3636
- selector:
3737
matchLabels:
3838
os: windows
3939
arch: amd64
40-
{{addURIAndSha "https://github.com/kubernetes-sigs/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
40+
{{addURIAndSha "https://github.com/kahirokunn/cluster-api-operator/releases/download/{{ .TagName }}/clusterctl-operator_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
4141
bin: bin/clusterctl-operator.exe
4242

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ endif
180180
RELEASE_ALIAS_TAG ?= $(PULL_BASE_REF)
181181
RELEASE_DIR := $(ROOT)/out
182182
CHART_DIR := $(RELEASE_DIR)/charts/cluster-api-operator
183+
CHART_PROVIDERS_DIR := $(RELEASE_DIR)/charts/cluster-api-operator-providers
183184
CHART_PACKAGE_DIR := $(RELEASE_DIR)/package
184185

185186
# Set --output-base for conversion-gen if we are not within GOPATH
@@ -312,7 +313,7 @@ lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported
312313

313314
.PHONY: apidiff
314315
apidiff: $(GO_APIDIFF) ## Check for API differences
315-
$(GO_APIDIFF) $(shell git rev-parse origin/main) --print-compatible
316+
$(GO_APIDIFF) $(shell git rev-parse fork/main) --print-compatible
316317

317318
.PHONY: verify
318319
verify:
@@ -455,6 +456,9 @@ $(CHART_DIR):
455456
$(CHART_PACKAGE_DIR):
456457
mkdir -p $(CHART_PACKAGE_DIR)
457458

459+
$(CHART_PROVIDERS_DIR):
460+
mkdir -p $(CHART_PROVIDERS_DIR)/templates
461+
458462
.PHONY: release
459463
release: clean-release $(RELEASE_DIR) ## Builds and push container images using the latest git tag for the commit.
460464
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
@@ -485,11 +489,16 @@ release-manifests: $(KUSTOMIZE) $(RELEASE_DIR) ## Builds the manifests to publis
485489
$(KUSTOMIZE) build ./config/default > $(RELEASE_DIR)/operator-components.yaml
486490

487491
.PHONY: release-chart
488-
release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PACKAGE_DIR) ## Builds the chart to publish with a release
492+
release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PROVIDERS_DIR) $(CHART_PACKAGE_DIR) ## Builds the chart to publish with a release
493+
# cluster-api-operator チャートの処理
489494
cp -rf $(ROOT)/hack/charts/cluster-api-operator/. $(CHART_DIR)
490495
$(KUSTOMIZE) build ./config/chart > $(CHART_DIR)/templates/operator-components.yaml
491496
$(HELM) package $(CHART_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
492497

498+
# cluster-api-operator-providers チャートの処理
499+
cp -rf $(ROOT)/hack/charts/cluster-api-operator-providers/. $(CHART_PROVIDERS_DIR)
500+
$(HELM) package $(CHART_PROVIDERS_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
501+
493502
.PHONY: release-staging
494503
release-staging: ## Builds and push container images and manifests to the staging bucket.
495504
$(MAKE) docker-build-all

cmd/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
244244
Client: mgr.GetClient(),
245245
Config: mgr.GetConfig(),
246246
WatchConfigSecretChanges: watchConfigSecretChanges,
247+
WatchCoreProviderChanges: true,
247248
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
248249
setupLog.Error(err, "unable to create controller", "controller", "InfrastructureProvider")
249250
os.Exit(1)
@@ -255,6 +256,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
255256
Client: mgr.GetClient(),
256257
Config: mgr.GetConfig(),
257258
WatchConfigSecretChanges: watchConfigSecretChanges,
259+
WatchCoreProviderChanges: true,
258260
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
259261
setupLog.Error(err, "unable to create controller", "controller", "BootstrapProvider")
260262
os.Exit(1)
@@ -266,6 +268,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
266268
Client: mgr.GetClient(),
267269
Config: mgr.GetConfig(),
268270
WatchConfigSecretChanges: watchConfigSecretChanges,
271+
WatchCoreProviderChanges: true,
269272
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
270273
setupLog.Error(err, "unable to create controller", "controller", "ControlPlaneProvider")
271274
os.Exit(1)
@@ -277,6 +280,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
277280
Client: mgr.GetClient(),
278281
Config: mgr.GetConfig(),
279282
WatchConfigSecretChanges: watchConfigSecretChanges,
283+
WatchCoreProviderChanges: true,
280284
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
281285
setupLog.Error(err, "unable to create controller", "controller", "AddonProvider")
282286
os.Exit(1)
@@ -288,6 +292,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
288292
Client: mgr.GetClient(),
289293
Config: mgr.GetConfig(),
290294
WatchConfigSecretChanges: watchConfigSecretChanges,
295+
WatchCoreProviderChanges: true,
291296
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
292297
setupLog.Error(err, "unable to create controller", "controller", "IPAMProvider")
293298
os.Exit(1)
@@ -299,6 +304,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, watchConfigSecretCh
299304
Client: mgr.GetClient(),
300305
Config: mgr.GetConfig(),
301306
WatchConfigSecretChanges: watchConfigSecretChanges,
307+
WatchCoreProviderChanges: true,
302308
}).SetupWithManager(ctx, mgr, concurrency(concurrencyNumber)); err != nil {
303309
setupLog.Error(err, "unable to create controller", "controller", "RuntimeExtensionProvider")
304310
os.Exit(1)

cmd/plugin/cmd/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var initCmd = &cobra.Command{
7979
Some providers require secrets to be created before running 'capioperator init'.
8080
Refer to the provider documentation, or use 'clusterctl config provider [name]' to get a list of required variables.
8181
82-
See https://cluster-api.sigs.k8s.io and https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/docs/README.md for more details.`),
82+
See https://cluster-api.sigs.k8s.io and https://github.com/kahirokunn/cluster-api-operator/blob/main/docs/README.md for more details.`),
8383

8484
Example: Examples(`
8585
# Initialize CAPI operator only without installing any providers.

cmd/plugin/cmd/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747
const (
4848
// We have to specify a version here, because if we set "latest", clusterctl libs will try to fetch metadata.yaml file for the latest
4949
// release and fail since CAPI operator doesn't provide this file.
50-
capiOperatorManifestsURL = "https://github.com/kubernetes-sigs/cluster-api-operator/releases/v0.1.0/operator-components.yaml"
50+
capiOperatorManifestsURL = "https://github.com/kahirokunn/cluster-api-operator/releases/v0.1.0/operator-components.yaml"
5151
)
5252

5353
var capiOperatorLabels = map[string]string{

0 commit comments

Comments
 (0)