Skip to content

Commit f6ccb5b

Browse files
committed
cozyplane-apiserver: self-registered APIService takeover (flags + RBAC)
The deployed artifact was built with this template change but it was left out of the bump commit. The server registers (or takes over from CRD autoregistration) its own APIService at startup; the chart manifest is gone because Helm cannot adopt the object the kube-apiserver has already auto-created for the bootstrap CRDs. Assisted-by: LLM Signed-off-by: Timofei Larkin <[email protected]>
1 parent 2d4fb94 commit f6ccb5b

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

‎packages/system/cozyplane-apiserver/templates/apiserver.yaml‎

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ rules:
6767
- apiGroups: ["flowcontrol.apiserver.k8s.io"]
6868
resources: ["flowschemas", "prioritylevelconfigurations"]
6969
verbs: ["get", "list", "watch"]
70+
# The server registers (or takes over from CRD autoregistration) its own
71+
# APIService at startup — a chart manifest can't: the kube-apiserver has
72+
# already auto-created the object for the bootstrap CRDs, and Helm refuses
73+
# to adopt an object it does not own.
74+
- apiGroups: ["apiregistration.k8s.io"]
75+
resources: ["apiservices"]
76+
verbs: ["get", "create", "patch"]
7077
---
7178
apiVersion: rbac.authorization.k8s.io/v1
7279
kind: ClusterRoleBinding
@@ -233,6 +240,9 @@ spec:
233240
command: ["/usr/local/bin/cozyplane-apiserver"]
234241
args:
235242
- --serve-sdn
243+
# Register/take over the group's APIService (see the RBAC note).
244+
- --ensure-apiservice-service={{ $ns }}/cozyplane-apiserver
245+
- --ensure-apiservice-ca-injection={{ $ns }}/cozyplane-apiserver-serving
236246
{{- if .Values.etcd.operator.enabled }}
237247
# The v1alpha2 operator's client Service (members carry
238248
# operator-assigned names, so dial the Service, not per-member DNS).
@@ -293,21 +303,3 @@ spec:
293303
- port: 443
294304
targetPort: 6443
295305
name: https
296-
---
297-
apiVersion: apiregistration.k8s.io/v1
298-
kind: APIService
299-
metadata:
300-
name: v1alpha1.sdn.cozystack.io
301-
labels:
302-
{{- include "cozyplane-apiserver.labels" . | nindent 4 }}
303-
annotations:
304-
cert-manager.io/inject-ca-from: {{ $ns }}/cozyplane-apiserver-serving
305-
spec:
306-
group: sdn.cozystack.io
307-
version: v1alpha1
308-
groupPriorityMinimum: 1000
309-
versionPriority: 15
310-
service:
311-
name: cozyplane-apiserver
312-
namespace: {{ $ns }}
313-
port: 443

0 commit comments

Comments
 (0)