Skip to content

Commit 48cf5b0

Browse files
committed
Copy Function with conditions/status into Helm chart
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent d94b9b9 commit 48cf5b0

File tree

1 file changed

+71
-15
lines changed

1 file changed

+71
-15
lines changed

chart/openfaas/templates/function-crd.yaml

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
22
{{- if .Values.operator.create }}
33
{{- if .Values.createCRDs }}
4-
54
apiVersion: apiextensions.k8s.io/v1
65
kind: CustomResourceDefinition
76
metadata:
87
annotations:
9-
controller-gen.kubebuilder.io/version: v0.14.0
8+
controller-gen.kubebuilder.io/version: v0.11.3
9+
creationTimestamp: null
1010
name: functions.openfaas.com
1111
spec:
1212
group: openfaas.com
@@ -21,6 +21,18 @@ spec:
2121
- jsonPath: .spec.image
2222
name: Image
2323
type: string
24+
- jsonPath: .status.conditions[?(@.type == "Ready")].status
25+
name: Ready
26+
type: string
27+
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
28+
name: Healthy
29+
type: string
30+
- jsonPath: .status.replicas
31+
name: Replicas
32+
type: string
33+
- jsonPath: .status.availableReplicas
34+
name: Available
35+
type: string
2436
name: v1
2537
schema:
2638
openAPIV3Schema:
@@ -30,19 +42,10 @@ spec:
3042
- spec
3143
properties:
3244
apiVersion:
33-
description: |-
34-
APIVersion defines the versioned schema of this representation of an object.
35-
Servers should convert recognized schemas to the latest internal value, and
36-
may reject unrecognized values.
37-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
45+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
3846
type: string
3947
kind:
40-
description: |-
41-
Kind is a string value representing the REST resource this object represents.
42-
Servers may infer this from the endpoint the client submits requests to.
43-
Cannot be updated.
44-
In CamelCase.
45-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
48+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
4649
type: string
4750
metadata:
4851
type: object
@@ -97,10 +100,63 @@ spec:
97100
type: array
98101
items:
99102
type: string
103+
status:
104+
type: object
105+
properties:
106+
availableReplicas:
107+
type: integer
108+
format: int32
109+
conditions:
110+
description: Conditions contains observations of the resource's state.
111+
type: array
112+
items:
113+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
114+
type: object
115+
required:
116+
- lastTransitionTime
117+
- message
118+
- reason
119+
- status
120+
- type
121+
properties:
122+
lastTransitionTime:
123+
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
124+
type: string
125+
format: date-time
126+
message:
127+
description: message is a human readable message indicating details about the transition. This may be an empty string.
128+
type: string
129+
maxLength: 32768
130+
observedGeneration:
131+
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
132+
type: integer
133+
format: int64
134+
minimum: 0
135+
reason:
136+
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
137+
type: string
138+
maxLength: 1024
139+
minLength: 1
140+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
141+
status:
142+
description: status of the condition, one of True, False, Unknown.
143+
type: string
144+
enum:
145+
- "True"
146+
- "False"
147+
- Unknown
148+
type:
149+
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
150+
type: string
151+
maxLength: 316
152+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
153+
replicas:
154+
type: integer
155+
format: int32
100156
served: true
101157
storage: true
102-
subresources: {}
103-
158+
subresources:
159+
status: {}
104160

105161
{{- end }}
106162
{{- end }}

0 commit comments

Comments
 (0)