Skip to content

Commit 72ee772

Browse files
committed
Add unavailableReplicas to Function CRD
The unavailableReplicas helps show when a function cannot fully progress due to some issue in the cluster. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 7ffa78b commit 72ee772

File tree

6 files changed

+60
-15
lines changed

6 files changed

+60
-15
lines changed

artifacts/crds/crds.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,21 @@ spec:
455455
type: string
456456
- jsonPath: .status.conditions[?(@.type == "Ready")].status
457457
name: Ready
458+
priority: 1
458459
type: string
459460
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
460461
name: Healthy
461462
type: string
462463
- jsonPath: .status.replicas
463464
name: Replicas
464-
type: string
465+
type: integer
465466
- jsonPath: .status.availableReplicas
466467
name: Available
467-
type: string
468+
type: integer
469+
- jsonPath: .status.unavailableReplicas
470+
name: Unavailable
471+
priority: 1
472+
type: integer
468473
name: v1
469474
schema:
470475
openAPIV3Schema:
@@ -618,6 +623,9 @@ spec:
618623
replicas:
619624
format: int32
620625
type: integer
626+
unavailableReplicas:
627+
format: int32
628+
type: integer
621629
type: object
622630
required:
623631
- spec

artifacts/crds/openfaas.com_functions.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@ spec:
2222
type: string
2323
- jsonPath: .status.conditions[?(@.type == "Ready")].status
2424
name: Ready
25+
priority: 1
2526
type: string
2627
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
2728
name: Healthy
2829
type: string
2930
- jsonPath: .status.replicas
3031
name: Replicas
31-
type: string
32+
type: integer
3233
- jsonPath: .status.availableReplicas
3334
name: Available
34-
type: string
35+
type: integer
36+
- jsonPath: .status.unavailableReplicas
37+
name: Unavailable
38+
priority: 1
39+
type: integer
3540
name: v1
3641
schema:
3742
openAPIV3Schema:
@@ -185,6 +190,9 @@ spec:
185190
replicas:
186191
format: int32
187192
type: integer
193+
unavailableReplicas:
194+
format: int32
195+
type: integer
188196
type: object
189197
required:
190198
- spec

chart/openfaas/artifacts/crds.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,21 @@ spec:
455455
type: string
456456
- jsonPath: .status.conditions[?(@.type == "Ready")].status
457457
name: Ready
458+
priority: 1
458459
type: string
459460
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
460461
name: Healthy
461462
type: string
462463
- jsonPath: .status.replicas
463464
name: Replicas
464-
type: string
465+
type: integer
465466
- jsonPath: .status.availableReplicas
466467
name: Available
467-
type: string
468+
type: integer
469+
- jsonPath: .status.unavailableReplicas
470+
name: Unavailable
471+
priority: 1
472+
type: integer
468473
name: v1
469474
schema:
470475
openAPIV3Schema:
@@ -618,6 +623,9 @@ spec:
618623
replicas:
619624
format: int32
620625
type: integer
626+
unavailableReplicas:
627+
format: int32
628+
type: integer
621629
type: object
622630
required:
623631
- spec

chart/openfaas/templates/openfaas.com_functions-crd.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,21 @@ spec:
2424
type: string
2525
- jsonPath: .status.conditions[?(@.type == "Ready")].status
2626
name: Ready
27+
priority: 1
2728
type: string
2829
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
2930
name: Healthy
3031
type: string
3132
- jsonPath: .status.replicas
3233
name: Replicas
33-
type: string
34+
type: integer
3435
- jsonPath: .status.availableReplicas
3536
name: Available
36-
type: string
37+
type: integer
38+
- jsonPath: .status.unavailableReplicas
39+
name: Unavailable
40+
priority: 1
41+
type: integer
3742
name: v1
3843
schema:
3944
openAPIV3Schema:
@@ -187,6 +192,9 @@ spec:
187192
replicas:
188193
format: int32
189194
type: integer
195+
unavailableReplicas:
196+
format: int32
197+
type: integer
190198
type: object
191199
required:
192200
- spec

pkg/apis/openfaas/v1/types.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import (
99
// +kubebuilder:subresource:status
1010
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1111
// +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image`
12-
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status`
13-
// +kubebuilder:printcolumn:name="Healthy",type=string,JSONPath=`.status.conditions[?(@.type == "Healthy")].status`
14-
// +kubebuilder:printcolumn:name="Replicas",type=string,JSONPath=`.status.replicas`
15-
// +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.availableReplicas`
12+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status`,priority=1,description="The function's desired state has been applied by the controller"
13+
// +kubebuilder:printcolumn:name="Healthy",type=string,JSONPath=`.status.conditions[?(@.type == "Healthy")].status`,description="All replicas of the function's desired state are available to serve traffic"
14+
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="The desired number of replicas"
15+
// +kubebuilder:printcolumn:name="Available",type=integer,JSONPath=`.status.availableReplicas`
16+
// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=`.status.unavailableReplicas`,priority=1
1617

1718
// Function describes an OpenFaaS function
1819
type Function struct {
@@ -78,6 +79,9 @@ type FunctionStatus struct {
7879

7980
// +optional
8081
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
82+
83+
// +optional
84+
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`
8185
}
8286

8387
// +genclient

pkg/client/applyconfiguration/openfaas/v1/functionstatus.go

+12-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)