Skip to content

Commit 78729c8

Browse files
authored
chore: revert to use ReadWriteOnce as default accessMode to avoid breaking changes (#3070)
Signed-off-by: Derek Wang <[email protected]>
1 parent ac88964 commit 78729c8

File tree

2 files changed

+60
-37
lines changed

2 files changed

+60
-37
lines changed

docs/core-concepts/inter-step-buffer-service.md

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Inter-Step Buffer Service
22

3-
Inter-Step Buffer Service is the service to provide [Inter-Step Buffers](inter-step-buffer.md).
3+
Inter-Step Buffer Service is the service to provide
4+
[Inter-Step Buffers](inter-step-buffer.md).
45

5-
An Inter-Step Buffer Service is described by a [Custom Resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/). It is required to be existing in a namespace before
6-
Pipeline objects are created. A sample `InterStepBufferService` with JetStream implementation looks like below.
6+
An Inter-Step Buffer Service is described by a
7+
[Custom Resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/).
8+
It is required to be existing in a namespace before Pipeline objects are
9+
created. A sample `InterStepBufferService` with JetStream implementation looks
10+
like below.
711

812
```yaml
913
apiVersion: numaflow.numaproj.io/v1alpha1
@@ -15,9 +19,11 @@ spec:
1519
version: latest # Do NOT use "latest" but a specific version in your real deployment
1620
```
1721
18-
`InterStepBufferService` is a namespaced object. It can be used by all the Pipelines in the same namespace. By default,
19-
Pipeline objects look for an `InterStepBufferService` named `default`, so a common practice is to create an `InterStepBufferService`
20-
with the name `default`. If you give the `InterStepBufferService` a name other than `default`, then you need to give the
22+
`InterStepBufferService` is a namespaced object. It can be used by all the
23+
Pipelines in the same namespace. By default, Pipeline objects look for an
24+
`InterStepBufferService` named `default`, so a common practice is to create an
25+
`InterStepBufferService` with the name `default`. If you give the
26+
`InterStepBufferService` a name other than `default`, then you need to give the
2127
same name in the Pipeline spec.
2228

2329
```yaml
@@ -38,25 +44,29 @@ kubectl get isbsvc
3844

3945
## JetStream
4046

41-
`JetStream` is one of the supported `Inter-Step Buffer Service` implementations. A keyword `jetstream` under `spec` means
42-
a JetStream cluster will be created in the namespace.
47+
`JetStream` is one of the supported `Inter-Step Buffer Service` implementations.
48+
A keyword `jetstream` under `spec` means a JetStream cluster will be created in
49+
the namespace.
4350

44-
**For Production Setup**, please make sure you configure [replicas](#replicas), [persistence](#persistence),
45-
[anti-affinity](#anti-affinity), and [PDB](#pdb).
51+
**For Production Setup**, please make sure you configure [replicas](#replicas),
52+
[persistence](#persistence), [anti-affinity](#anti-affinity), and [PDB](#pdb).
4653

4754
### Version
4855

49-
Property `spec.jetstream.version` is required for a JetStream `InterStepBufferService`. Supported versions can be found
50-
from the ConfigMap [`numaflow-controller-config`](https://github.com/numaproj/numaflow/blob/main/config/base/controller-manager/numaflow-controller-config.yaml) in the control plane namespace.
56+
Property `spec.jetstream.version` is required for a JetStream
57+
`InterStepBufferService`. Supported versions can be found from the ConfigMap
58+
[`numaflow-controller-config`](https://github.com/numaproj/numaflow/blob/main/config/base/controller-manager/numaflow-controller-config.yaml)
59+
in the control plane namespace.
5160

5261
**Note**
5362

54-
The version `latest` in the ConfigMap should only be used for testing purpose. It's recommended that you always use a
55-
fixed version in your real workload.
63+
The version `latest` in the ConfigMap should only be used for testing purpose.
64+
It's recommended that you always use a fixed version in your real workload.
5665

5766
### Replicas
5867

59-
An optional property `spec.jetstream.replicas` (defaults to 3) can be specified, which gives the total number of nodes.
68+
An optional property `spec.jetstream.replicas` (defaults to 3) can be specified,
69+
which gives the total number of nodes.
6070

6171
### Persistence
6272

@@ -72,7 +82,7 @@ spec:
7282
version: latest # Do NOT use "latest" but a specific version in your real deployment
7383
persistence:
7484
storageClassName: standard # Optional, will use K8s cluster default storage class if not specified
75-
accessMode: ReadWriteOncePod # Optional, defaults to ReadWriteOncePod
85+
accessMode: ReadWriteOncePod # Optional, defaults to ReadWriteOnce
7686
volumeSize: 10Gi # Optional, defaults to 20Gi
7787
```
7888

@@ -104,7 +114,8 @@ spec:
104114

105115
### PDB
106116

107-
PDB (Pod Disruption Budget) is essential for running ISB in production to ensure availability.
117+
PDB (Pod Disruption Budget) is essential for running ISB in production to ensure
118+
availability.
108119

109120
#### Example PDB Configuration
110121

@@ -127,11 +138,13 @@ There are 2 places to configure JetStream settings:
127138

128139
- ConfigMap `numaflow-controller-config` in the control plane namespace.
129140

130-
This is the default configuration for all the JetStream `InterStepBufferService` created in the Kubernetes cluster.
141+
This is the default configuration for all the JetStream
142+
`InterStepBufferService` created in the Kubernetes cluster.
131143

132144
- Property `spec.jetstream.settings` in an `InterStepBufferService` object.
133145

134-
This optional property can be used to override the default configuration defined in the ConfigMap `numaflow-controller-config`.
146+
This optional property can be used to override the default configuration
147+
defined in the ConfigMap `numaflow-controller-config`.
135148

136149
A sample JetStream configuration:
137150

@@ -152,21 +165,27 @@ max_file_store: 1TB
152165

153166
### Buffer Configuration
154167

155-
For the Inter-Step Buffers created in JetStream ISB Service, there are 2 places to configure the default properties.
168+
For the Inter-Step Buffers created in JetStream ISB Service, there are 2 places
169+
to configure the default properties.
156170

157171
- ConfigMap `numaflow-controller-config` in the control plane namespace.
158172

159-
This is the place to configure the default properties for the streams and consumers created in all the Jet Stream ISB
173+
This is the place to configure the default properties for the streams and
174+
consumers created in all the Jet Stream ISB
160175

161176
- Services in the Kubernetes cluster.
162177

163178
- Field `spec.jetstream.bufferConfig` in an `InterStepBufferService` object.
164179

165-
This optional field can be used to customize the stream and consumer properties of that particular `InterStepBufferService`,
180+
This optional field can be used to customize the stream and consumer
181+
properties of that particular `InterStepBufferService`,
166182

167-
- and the configuration will be merged into the default one from the ConfigMap `numaflow-controller-config`. For example,
168-
- if you only want to change `maxMsgs` for created streams, then you only need to give `stream.maxMsgs` in the field, all
169-
- the rest config will still go with the default values in the control plane ConfigMap.
183+
- and the configuration will be merged into the default one from the ConfigMap
184+
`numaflow-controller-config`. For example,
185+
- if you only want to change `maxMsgs` for created streams, then you only need
186+
to give `stream.maxMsgs` in the field, all
187+
- the rest config will still go with the default values in the control plane
188+
ConfigMap.
170189

171190
Both these 2 places expect a YAML format configuration like below:
172191

@@ -191,23 +210,28 @@ bufferConfig: |
191210

192211
**Note**
193212

194-
Changing the buffer configuration either in the control plane ConfigMap or in the `InterStepBufferService` object does
195-
**NOT** make any change to the buffers (streams) already existing.
213+
Changing the buffer configuration either in the control plane ConfigMap or in
214+
the `InterStepBufferService` object does **NOT** make any change to the buffers
215+
(streams) already existing.
196216

197217
### TLS
198218

199-
`TLS` is optional to configure through `spec.jetstream.tls: true`. Enabling TLS will use a self signed CERT to encrypt
200-
the connection from Vertex Pods to JetStream service. By default `TLS` is not enabled.
219+
`TLS` is optional to configure through `spec.jetstream.tls: true`. Enabling TLS
220+
will use a self signed CERT to encrypt the connection from Vertex Pods to
221+
JetStream service. By default `TLS` is not enabled.
201222

202223
### Encryption At Rest
203224

204-
Encryption at rest can be enabled by setting `spec.jetstream.encryption: true`. Be aware this will impact the performance
205-
a bit, see the detail at [official doc](https://docs.nats.io/running-a-nats-service/nats_admin/jetstream_admin/encryption_at_rest).
225+
Encryption at rest can be enabled by setting `spec.jetstream.encryption: true`.
226+
Be aware this will impact the performance a bit, see the detail at
227+
[official doc](https://docs.nats.io/running-a-nats-service/nats_admin/jetstream_admin/encryption_at_rest).
206228

207-
Once a JetStream ISB Service is created, toggling the `encryption` field will cause problem for the exiting messages, so
208-
if you want to change the value, please delete and recreate the ISB Service, and you also need to restart all the Vertex
209-
Pods to pick up the new credentials.
229+
Once a JetStream ISB Service is created, toggling the `encryption` field will
230+
cause problem for the exiting messages, so if you want to change the value,
231+
please delete and recreate the ISB Service, and you also need to restart all the
232+
Vertex Pods to pick up the new credentials.
210233

211234
### Other Configuration
212235

213-
Check [here](../APIs.md#numaflow.numaproj.io/v1alpha1.JetStreamBufferService) for the full spec of `spec.jetstream`.
236+
Check [here](../APIs.md#numaflow.numaproj.io/v1alpha1.JetStreamBufferService)
237+
for the full spec of `spec.jetstream`.

pkg/apis/numaflow/v1alpha1/persistence_strategy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
)
2424

2525
var DefaultVolumeSize = apiresource.MustParse("20Gi")
26-
var DefaultAccessMode = corev1.ReadWriteOncePod
26+
var DefaultAccessMode = corev1.ReadWriteOnce
2727

2828
// PersistenceStrategy defines the strategy of persistence
2929
type PersistenceStrategy struct {
@@ -46,7 +46,6 @@ func (ps PersistenceStrategy) GetPVCSpec(name string) corev1.PersistentVolumeCla
4646
if ps.VolumeSize != nil {
4747
volSize = *ps.VolumeSize
4848
}
49-
// Default to ReadWriteOncePod
5049
accessMode := DefaultAccessMode
5150
if ps.AccessMode != nil {
5251
accessMode = *ps.AccessMode

0 commit comments

Comments
 (0)