Skip to content

Commit

Permalink
Add deployment strategy to Profiles
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Jun 11, 2024
1 parent 1f38da1 commit f26da3a
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 115 deletions.
61 changes: 58 additions & 3 deletions artifacts/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,18 @@ spec:
- jsonPath: .spec.image
name: Image
type: string
- jsonPath: .status.conditions[?(@.type == "Ready")].status
- description: The function's desired state has been applied by the controller
jsonPath: .status.conditions[?(@.type == "Ready")].status
name: Ready
priority: 1
type: string
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
- description: All replicas of the function's desired state are available to serve
traffic
jsonPath: .status.conditions[?(@.type == "Healthy")].status
name: Healthy
type: string
- jsonPath: .status.replicas
- description: The desired number of replicas
jsonPath: .status.replicas
name: Replicas
type: integer
- jsonPath: .status.availableReplicas
Expand Down Expand Up @@ -1886,6 +1890,57 @@ spec:
copied to the Pod RunTimeClass, this will replace any existing value or previously
applied Profile.
type: string
strategy:
description: Strategy allows customizing the deployment strategy for
function deployments.
properties:
rollingUpdate:
description: |-
Rolling update config params. Present only if DeploymentStrategyType =
RollingUpdate.
---
TODO: Update this to follow our convention for oneOf, whatever we decide it
to be.
properties:
maxSurge:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be scheduled above the desired number of
pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
the rolling update starts, such that the total number of old and new pods do not exceed
130% of desired pods. Once old pods have been killed,
new ReplicaSet can be scaled up further, ensuring that total number of pods running
at any time during the update is at most 130% of desired pods.
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
that the total number of pods available at all times during the update is at
least 70% of desired pods.
x-kubernetes-int-or-string: true
type: object
type:
description: Type of deployment. Can be "Recreate" or "RollingUpdate".
Default is RollingUpdate.
type: string
type: object
tolerations:
description: |-
If specified, the function's pod tolerations.
Expand Down
10 changes: 7 additions & 3 deletions artifacts/crds/openfaas.com_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ spec:
- jsonPath: .spec.image
name: Image
type: string
- jsonPath: .status.conditions[?(@.type == "Ready")].status
- description: The function's desired state has been applied by the controller
jsonPath: .status.conditions[?(@.type == "Ready")].status
name: Ready
priority: 1
type: string
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
- description: All replicas of the function's desired state are available to serve
traffic
jsonPath: .status.conditions[?(@.type == "Healthy")].status
name: Healthy
type: string
- jsonPath: .status.replicas
- description: The desired number of replicas
jsonPath: .status.replicas
name: Replicas
type: integer
- jsonPath: .status.availableReplicas
Expand Down
51 changes: 51 additions & 0 deletions artifacts/crds/openfaas.com_profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,57 @@ spec:
copied to the Pod RunTimeClass, this will replace any existing value or previously
applied Profile.
type: string
strategy:
description: Strategy allows customizing the deployment strategy for
function deployments.
properties:
rollingUpdate:
description: |-
Rolling update config params. Present only if DeploymentStrategyType =
RollingUpdate.
---
TODO: Update this to follow our convention for oneOf, whatever we decide it
to be.
properties:
maxSurge:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be scheduled above the desired number of
pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
the rolling update starts, such that the total number of old and new pods do not exceed
130% of desired pods. Once old pods have been killed,
new ReplicaSet can be scaled up further, ensuring that total number of pods running
at any time during the update is at most 130% of desired pods.
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
that the total number of pods available at all times during the update is at
least 70% of desired pods.
x-kubernetes-int-or-string: true
type: object
type:
description: Type of deployment. Can be "Recreate" or "RollingUpdate".
Default is RollingUpdate.
type: string
type: object
tolerations:
description: |-
If specified, the function's pod tolerations.
Expand Down
61 changes: 58 additions & 3 deletions chart/openfaas/artifacts/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,18 @@ spec:
- jsonPath: .spec.image
name: Image
type: string
- jsonPath: .status.conditions[?(@.type == "Ready")].status
- description: The function's desired state has been applied by the controller
jsonPath: .status.conditions[?(@.type == "Ready")].status
name: Ready
priority: 1
type: string
- jsonPath: .status.conditions[?(@.type == "Healthy")].status
- description: All replicas of the function's desired state are available to serve
traffic
jsonPath: .status.conditions[?(@.type == "Healthy")].status
name: Healthy
type: string
- jsonPath: .status.replicas
- description: The desired number of replicas
jsonPath: .status.replicas
name: Replicas
type: integer
- jsonPath: .status.availableReplicas
Expand Down Expand Up @@ -1886,6 +1890,57 @@ spec:
copied to the Pod RunTimeClass, this will replace any existing value or previously
applied Profile.
type: string
strategy:
description: Strategy allows customizing the deployment strategy for
function deployments.
properties:
rollingUpdate:
description: |-
Rolling update config params. Present only if DeploymentStrategyType =
RollingUpdate.
---
TODO: Update this to follow our convention for oneOf, whatever we decide it
to be.
properties:
maxSurge:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be scheduled above the desired number of
pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
the rolling update starts, such that the total number of old and new pods do not exceed
130% of desired pods. Once old pods have been killed,
new ReplicaSet can be scaled up further, ensuring that total number of pods running
at any time during the update is at most 130% of desired pods.
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
that the total number of pods available at all times during the update is at
least 70% of desired pods.
x-kubernetes-int-or-string: true
type: object
type:
description: Type of deployment. Can be "Recreate" or "RollingUpdate".
Default is RollingUpdate.
type: string
type: object
tolerations:
description: |-
If specified, the function's pod tolerations.
Expand Down
9 changes: 1 addition & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,32 @@ require (
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
golang.org/x/mod v0.16.0 // indirect
Expand All @@ -75,12 +70,10 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.0 // indirect
k8s.io/gengo v0.0.0-20240310015720-9cff6334dab4 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
sigs.k8s.io/controller-tools v0.14.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit f26da3a

Please sign in to comment.