Skip to content

Commit c4ed6da

Browse files
committed
Refactor example and override doc to not require container field
1 parent 657324e commit c4ed6da

File tree

4 files changed

+29
-59
lines changed

4 files changed

+29
-59
lines changed

src/current/v26.1/cockroachdb-operator-performance.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,10 @@ cockroachdb:
179179
crdbCluster:
180180
podTemplate:
181181
spec:
182-
containers:
183-
- name: cockroachdb
184-
resources:
185-
requests:
186-
cpu: 3500m
187-
memory: 12300Mi
182+
resources:
183+
requests:
184+
cpu: 3500m
185+
memory: 12300Mi
188186
~~~
189187

190188
When you initialize the cluster, check that all the CockroachDB pods are scheduled successfully. If you see any get stuck in the pending state, run `kubectl describe pod {podname}` and check the `Events` for information about why they're still pending. You may need to manually preempt pods on one or more nodes by running `kubectl delete pod` on them to make room for the CockroachDB pods. As long as the pods you delete were created by a higher-level Kubernetes object such as a `Deployment`, they'll be safely recreated on another node.
@@ -200,14 +198,12 @@ cockroachdb:
200198
crdbCluster:
201199
podTemplate:
202200
spec:
203-
containers:
204-
- name: cockroachdb
205-
resources:
206-
requests:
207-
cpu: 3500m
208-
memory: 12300Mi
209-
limits:
210-
memory: 12300Mi
201+
resources:
202+
requests:
203+
cpu: 3500m
204+
memory: 12300Mi
205+
limits:
206+
memory: 12300Mi
211207
~~~
212208

213209
Pods will be limited to their reserved resources and are unlikely to be preempted, except in rare cases. This will not improve performance on an underutilized Kubernetes cluster, but provides more predictable performance as other workloads run.

src/current/v26.1/configure-cockroachdb-operator.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ You can set the CPU and memory resources allocated to the CockroachDB container
2727
1 CPU in Kubernetes is equivalent to 1 vCPU or 1 hyperthread. For best practices on provisioning CPU and memory for CockroachDB, refer to the [Production Checklist]({% link {{ page.version.version }}/recommended-production-settings.md %}#hardware).
2828
{{site.data.alerts.end}}
2929

30-
Specify CPU and memory values in `cockroachdb.crdbCluster.podTemplate.spec.containers.resources.limits` and `cockroachdb.crdbCluster.podTemplate.spec.containers.resources.requests` in the values file used to [deploy the cluster]({% link {{ page.version.version }}/deploy-cockroachdb-with-cockroachdb-operator.md %}#initialize-the-cluster):
30+
Specify CPU and memory values in `cockroachdb.crdbCluster.podTemplate.spec.resources.limits` and `cockroachdb.crdbCluster.podTemplate.spec.resources.requests` in the values file used to [deploy the cluster]({% link {{ page.version.version }}/deploy-cockroachdb-with-cockroachdb-operator.md %}#initialize-the-cluster):
3131

3232
~~~ yaml
3333
cockroachdb:
3434
crdbCluster:
3535
podTemplate:
3636
spec:
37-
containers:
38-
- name: cockroachdb
39-
resources:
40-
limits:
41-
cpu: 4000m
42-
memory: 16Gi
43-
requests:
44-
cpu: 4000m
45-
memory: 16gi
37+
resources:
38+
limits:
39+
cpu: 4000m
40+
memory: 16Gi
41+
requests:
42+
cpu: 4000m
43+
memory: 16gi
4644
~~~
4745

4846
Apply the new settings to the cluster:

src/current/v26.1/deploy-cockroachdb-with-cockroachdb-operator.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,20 @@ For bare metal deployments, the specific Kubernetes infrastructure deployment st
252252
If you intend to deploy CockroachDB nodes across multiple different regions, follow the additional steps described in [Deploy across multiple regions](#deploy-across-multiple-regions).
253253
{{site.data.alerts.callout_end}}
254254

255-
1. Modify `cockroachdb.crdbCluster.podTemplate.spec.containers.resources` in the values file with the CPU and memory limits and requests for each node to use. For example, to define default values of 4vCPU and 16GiB of memory:
255+
1. Modify `cockroachdb.crdbCluster.podTemplate.spec.resources` in the values file with the CPU and memory limits and requests for each node to use. For example, to define default values of 4vCPU and 16GiB of memory:
256256

257257
~~~ yaml
258258
cockroachdb:
259259
crdbCluster:
260260
podTemplate:
261261
spec:
262-
containers:
263-
- name: cockroachdb
264-
resources:
265-
limits:
266-
cpu: 4000m
267-
memory: 16Gi
268-
requests:
269-
cpu: 4000m
270-
memory: 16gi
262+
resources:
263+
limits:
264+
cpu: 4000m
265+
memory: 16Gi
266+
requests:
267+
cpu: 4000m
268+
memory: 16gi
271269
~~~
272270

273271
For more information on configuring node resource allocation, refer to [Resource management]({% link {{ page.version.version }}/configure-cockroachdb-operator.md %})

src/current/v26.1/override-templates-cockroachdb-operator.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ This page describes advanced configurations that override the supported default
2424

2525
The `cockroachdb.crdbCluster.podTemplate` field allows you to override the default pod metadata and specification configured by the {{ site.data.products.cockroachdb-operator }}. The values in this field are merged with the default pod specification, where settings in `podTemplate` override any values in the default.
2626

27+
The `podTemplate` field includes a `containers` field that specifies the container name and image that the template is applied to. By default, this resolves to the `cockroachdb` container name and can be excluded from modifications to the CockroachDB pod template YAML. For advanced configurations, you may need to provide specific images for the `containers` and `initContainers`. For example, the following `podTemplate` configuration specifies a default `cockroachdb/cockroach:v25.4.0` container image:
28+
2729
~~~ yaml
2830
cockroachdb:
2931
crdbCluster:
@@ -35,7 +37,7 @@ cockroachdb:
3537
# initContainers captures the list of init containers for CockroachDB pods.
3638
initContainers:
3739
- name : cockroachdb-init
38-
image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/init-container@sha256:c3e4ba851802a429c7f76c639a64b9152d206cebb31162c1760f05e98f7c4254
40+
image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/init-container@sha256:example1234567890abcdefghijklmnopqrstuvwxyz
3941
# containers captures the list of containers for CockroachDB pods.
4042
containers:
4143
- name: cockroachdb
@@ -44,30 +46,6 @@ cockroachdb:
4446
imagePullSecrets: []
4547
~~~
4648

47-
At least one value for `containers` must be specified if any part of `podTemplate` is being modified. For example, the following `podTemplate` configuration specifies a default `cockroachdb/cockroach:v25.4.0` container image:
48-
49-
~~~ yaml
50-
cockroachdb:
51-
crdbCluster:
52-
podTemplate:
53-
spec:
54-
affinity:
55-
podAntiAffinity:
56-
preferredDuringSchedulingIgnoredDuringExecution:
57-
- weight: 100
58-
podAffinityTerm:
59-
labelSelector:
60-
matchExpressions:
61-
- key: app.kubernetes.io/component
62-
operator: In
63-
values:
64-
- cockroachdb
65-
topologyKey: kubernetes.io/hostname
66-
containers:
67-
- name: cockroachdb
68-
image: cockroachdb/cockroach:v25.4.0
69-
~~~
70-
7149
## Override the default `cockroach start` flags
7250

7351
The `cockroachdb.crdbCluster.startFlags` field allows you to customize the [`cockroach start` flags]({% link {{ page.version.version }}/cockroach-start.md %}#flags) used when initializing the CockroachDB cluster.

0 commit comments

Comments
 (0)