Skip to content

Commit 04d3e68

Browse files
committed
chart修复:将crd使用template渲染,避免升级时无法更新crd
参考helm官方说明:https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations There is no support at this time for upgrading or deleting CRDs using Helm. This was an explicit decision after much community discussion due to the danger for unintentional data loss. Furthermore, there is currently no community consensus around how to handle CRDs and their lifecycle. As this evolves, Helm will add support for those use cases.
1 parent ba5dae0 commit 04d3e68

4 files changed

+124
-129
lines changed

charts/tke-extend-network-controller/crds/networking.cloud.tencent.com_dedicatedclblisteners.yaml

Lines changed: 0 additions & 125 deletions
This file was deleted.

charts/tke-extend-network-controller/crds/networking.cloud.tencent.com_clblistenerconfigs.yaml renamed to charts/tke-extend-network-controller/templates/networking.cloud.tencent.com_clblistenerconfigs.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
cert-manager.io/inject-ca-from: kube-system/tke-extend-network-controller-serving-cert
6-
controller-gen.kubebuilder.io/version: v0.15.0
5+
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "tke-extend-network-controller.fullname" . }}-serving-cert
76
name: clblistenerconfigs.networking.cloud.tencent.com
87
spec:
98
group: networking.cloud.tencent.com
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "tke-extend-network-controller.fullname" . }}-serving-cert
6+
name: dedicatedclblisteners.networking.cloud.tencent.com
7+
spec:
8+
conversion:
9+
strategy: Webhook
10+
webhook:
11+
clientConfig:
12+
service:
13+
name: {{ include "tke-extend-network-controller.fullname" . }}-webhook-service
14+
namespace: {{ .Release.Namespace | quote }}
15+
path: /convert
16+
conversionReviewVersions:
17+
- v1
18+
group: networking.cloud.tencent.com
19+
names:
20+
kind: DedicatedCLBListener
21+
listKind: DedicatedCLBListenerList
22+
plural: dedicatedclblisteners
23+
singular: dedicatedclblistener
24+
scope: Namespaced
25+
versions:
26+
- additionalPrinterColumns:
27+
- description: CLB ID
28+
jsonPath: .spec.lbId
29+
name: LbId
30+
type: string
31+
- description: Port of CLB Listener
32+
jsonPath: .spec.lbPort
33+
name: LbPort
34+
type: integer
35+
- description: State of the dedicated clb listener
36+
jsonPath: .status.state
37+
name: State
38+
type: string
39+
name: v1alpha1
40+
schema:
41+
openAPIV3Schema:
42+
description: DedicatedCLBListener is the Schema for the dedicatedclblisteners
43+
API
44+
properties:
45+
apiVersion:
46+
description: |-
47+
APIVersion defines the versioned schema of this representation of an object.
48+
Servers should convert recognized schemas to the latest internal value, and
49+
may reject unrecognized values.
50+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
51+
type: string
52+
kind:
53+
description: |-
54+
Kind is a string value representing the REST resource this object represents.
55+
Servers may infer this from the endpoint the client submits requests to.
56+
Cannot be updated.
57+
In CamelCase.
58+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
59+
type: string
60+
metadata:
61+
type: object
62+
spec:
63+
description: DedicatedCLBListenerSpec defines the desired state of DedicatedCLBListener
64+
properties:
65+
lbId:
66+
type: string
67+
x-kubernetes-validations:
68+
- message: Value is immutable
69+
rule: self == oldSelf
70+
lbPort:
71+
format: int64
72+
type: integer
73+
x-kubernetes-validations:
74+
- message: Value is immutable
75+
rule: self == oldSelf
76+
lbRegion:
77+
type: string
78+
x-kubernetes-validations:
79+
- message: Value is immutable
80+
rule: self == oldSelf
81+
listenerConfig:
82+
type: string
83+
protocol:
84+
enum:
85+
- TCP
86+
- UDP
87+
type: string
88+
x-kubernetes-validations:
89+
- message: Value is immutable
90+
rule: self == oldSelf
91+
targetPod:
92+
properties:
93+
podName:
94+
type: string
95+
targetPort:
96+
format: int64
97+
type: integer
98+
required:
99+
- podName
100+
- targetPort
101+
type: object
102+
required:
103+
- lbId
104+
- lbPort
105+
- protocol
106+
type: object
107+
status:
108+
description: DedicatedCLBListenerStatus defines the observed state of
109+
DedicatedCLBListener
110+
properties:
111+
address:
112+
type: string
113+
listenerId:
114+
type: string
115+
state:
116+
type: string
117+
type: object
118+
type: object
119+
served: true
120+
storage: true
121+
subresources:
122+
status: {}

charts/tke-extend-network-controller/crds/networking.cloud.tencent.com_dedicatedclbservices.yaml renamed to charts/tke-extend-network-controller/templates/networking.cloud.tencent.com_dedicatedclbservices.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
cert-manager.io/inject-ca-from: kube-system/tke-extend-network-controller-serving-cert
6-
controller-gen.kubebuilder.io/version: v0.15.0
5+
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "tke-extend-network-controller.fullname" . }}-serving-cert
76
name: dedicatedclbservices.networking.cloud.tencent.com
87
spec:
98
group: networking.cloud.tencent.com

0 commit comments

Comments
 (0)