Skip to content

Commit b7eae1e

Browse files
committed
fixes for unsupported partitions field in CRD metadata block
1 parent e298f50 commit b7eae1e

File tree

3 files changed

+88
-11
lines changed

3 files changed

+88
-11
lines changed

website/content/docs/connect/config-entries/ingress-gateway.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ spec:
8888
</Tab>
8989

9090
<Tab heading="Consul Enterprise">
91+
92+
For Kubernetes environments, the CRD inherits the partition from the cluster hosting the pods.
93+
9194
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
9295

9396
```hcl
@@ -117,7 +120,6 @@ kind: IngressGateway
117120
metadata:
118121
name: <name for the gateway>
119122
namespace: <namespace containing the gateway>
120-
partition: <partition containing the gateway namespace>
121123

122124
spec:
123125
listeners:

website/content/docs/connect/config-entries/service-defaults.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ The following outline shows how to format the service splitter configuration ent
8282
- [`metadata`](#metadata): map | no default
8383
- [`name`](#name): string | no default
8484
- [`namespace`](#namespace): string | no default | <EnterpriseAlert inline />
85-
- [`partition`](#partition): string | no default | <EnterpriseAlert inline />
8685
- [`spec`](#spec): map | no default
8786
- [`protocol`](#protocol): string | default: `tcp`
8887
- [`balanceInboundConnections`](#balanceinboundconnections): string | no default
@@ -239,7 +238,6 @@ kind: ServiceDefaults
239238
metadata:
240239
name: <name of the service you are configuring>
241240
namespace: <Consul Enterprise namespace>
242-
partition: <Consul Enterprise admin partition>
243241
spec:
244242
protocol: tcp
245243
balanceInboundConnnections: exact_balance
@@ -802,13 +800,6 @@ Specifies the Consul namespace that the configuration entry applies to. Refer to
802800
- Default: `default`
803801
- Data type: string
804802

805-
### `metadata.partition` <Enterprise/>
806-
807-
Specifies the name of the name of the Consul admin partition that the configuration entry applies to. Refer to [Consul Enterprise](/consul/docs/k8s/crds#consul-enterprise) for information about how Consul Enterprise on Kubernetes. Consul OSS distributions ignore the `metadata.partition` configuration.
808-
809-
- Default: `default`
810-
- Data type: string
811-
812803
### `spec`
813804

814805
Map that contains the details about the `ServiceDefaults` configuration entry. The `apiVersion`, `kind`, and `metadata` fields are siblings of the `spec` field. All other configurations are children.

website/content/docs/services/usage/define-services.mdx

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You must tell Consul about the services deployed to your network if you want the
1515

1616
You can define multiple services individually using `service` blocks or group multiple services into the same `services` configuration block. Refer to [Define multiple services in a single file](#define-multiple-services-in-a-single-file) for additional information.
1717

18-
If Consul service mesh is enabled in your network, you can use the `service-defaults` configuration entry to specify default global values for services. The configuraiton entry lets you define common service parameter, such as upstreams, namespaces, and partitions. Refer to [Define service defaults](#define-service-defaults) for additional information.
18+
If Consul service mesh is enabled in your network, you can use the [service defaults configuration entry](/consul/docs/connect/config-entries/service-defaults) to specify default global values for services. The configuration entry lets you define common service parameter, such as upstreams, namespaces, and partitions. Refer to [Define service defaults](#define-service-defaults) for additional information.
1919

2020
## Requirements
2121

@@ -145,6 +145,9 @@ If Consul service mesh is enabled in your network, you can define default values
145145

146146
Create a file for the configuration entry and specify the required fields. If you are authoring `service-defaults` in HCL or JSON, the `Kind` and `Name` fields are required. On Kubernetes, the `apiVersion`, `kind`, and `metadata.name` fields are required. Refer to [Service Defaults Reference](/consul/docs/connect/config-entries/service-defaults) for details about the configuration options.
147147

148+
If you use Consul Enterprise, you can also specify the `Namespace` and `Partition` fields to apply the configuration to services in specific network areas. In Kubernetes environments, For Kubernetes environments, the CRD inherits the partition from the cluster hosting the pods.
149+
150+
### Consul OSS example
148151
The following example instructs services named `counting` to send up to `512` concurrent requests to a mesh gateway:
149152

150153
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
@@ -222,6 +225,87 @@ spec:
222225
```
223226
</CodeTabs>
224227

228+
### Consul Enterprise example
229+
The following example instructs services named `counting` in the `prod` namespace to send up to `512` concurrent requests to a mesh gateway:
230+
231+
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
232+
233+
```hcl
234+
Kind = "service-defaults"
235+
Name = "counting"
236+
Namespace = "prod"
237+
238+
UpstreamConfig = {
239+
Defaults = {
240+
MeshGateway = {
241+
Mode = "local"
242+
}
243+
Limits = {
244+
MaxConnections = 512
245+
MaxPendingRequests = 512
246+
MaxConcurrentRequests = 512
247+
}
248+
}
249+
250+
Overrides = [
251+
{
252+
Name = "dashboard"
253+
MeshGateway = {
254+
Mode = "remote"
255+
}
256+
}
257+
]
258+
}
259+
```
260+
```yaml
261+
apiVersion: consul.hashicorp.com/v1alpha1
262+
kind: ServiceDefaults
263+
metadata:
264+
name: counting
265+
namespace: prod
266+
spec:
267+
upstreamConfig:
268+
defaults:
269+
meshGateway:
270+
mode: local
271+
limits:
272+
maxConnections: 512
273+
maxPendingRequests: 512
274+
maxConcurrentRequests: 512
275+
overrides:
276+
- name: dashboard
277+
meshGateway:
278+
mode: remote
279+
```
280+
```json
281+
{
282+
"Kind": "service-defaults",
283+
"Name": "counting",
284+
"Namespace" : "prod",
285+
"UpstreamConfig": {
286+
"Defaults": {
287+
"MeshGateway": {
288+
"Mode": "local"
289+
},
290+
"Limits": {
291+
"MaxConnections": 512,
292+
"MaxPendingRequests": 512,
293+
"MaxConcurrentRequests": 512
294+
}
295+
},
296+
"Overrides": [
297+
{
298+
"Name": "dashboard",
299+
"MeshGateway": {
300+
"Mode": "remote"
301+
}
302+
}
303+
]
304+
}
305+
}
306+
```
307+
</CodeTabs>
308+
225309
### Apply service defaults
226310

227311
You can apply your `service-defaults` configuration entry using the [`consul config` command](/consul/commands/config) or by calling the [`/config` API endpoint](/consul/api-docs/config). In Kubernetes environments, apply the `service-defaults` custom resource definitions (CRD) to implement and manage Consul configuration entries.

0 commit comments

Comments
 (0)