Skip to content

Commit c5f6b13

Browse files
barkbaypebrceedugonkilfoyleshainaraskas
authored
[ECK] Update documentation for 3.1.0 (#2019)
This PR is to update the documentation for the next ECK release. **Do not merge before ECK 3.1.0 release** Related ECK release issue: elastic/k8s-dev#538 --------- Co-authored-by: Peter Brachwitz <[email protected]> Co-authored-by: Edu González de la Herrán <[email protected]> Co-authored-by: David Kilfoyle <[email protected]> Co-authored-by: shainaraskas <[email protected]>
1 parent b9086cc commit c5f6b13

File tree

5 files changed

+117
-1
lines changed

5 files changed

+117
-1
lines changed

deploy-manage/deploy/cloud-on-k8s.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,23 @@ This section outlines the supported Kubernetes and {{stack}} versions for ECK. C
6969

7070
ECK is compatible with the following Kubernetes distributions and related technologies:
7171

72+
::::{tab-set}
73+
74+
:::{tab-item} ECK 3.1
75+
* Kubernetes 1.29-1.33
76+
* OpenShift 4.15-4.19
77+
* Google Kubernetes Engine (GKE), Azure Kubernetes Service (AKS), and Amazon Elastic Kubernetes Service (EKS)
78+
* Helm: {{eck_helm_minimum_version}}+
79+
:::
80+
81+
:::{tab-item} ECK 3.0
7282
* Kubernetes 1.28-1.32
7383
* OpenShift 4.14-4.18
7484
* Google Kubernetes Engine (GKE), Azure Kubernetes Service (AKS), and Amazon Elastic Kubernetes Service (EKS)
7585
* Helm: {{eck_helm_minimum_version}}+
86+
:::
87+
88+
::::
7689

7790
ECK should work with all conformant **installers** listed in these [FAQs](https://github.com/cncf/k8s-conformance/blob/master/faq.md#what-is-a-distribution-hosted-platform-and-an-installer). Distributions include source patches and so may not work as-is with ECK.
7891

deploy-manage/deploy/cloud-on-k8s/configuration-fleet.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,23 @@ By default, every reference targets all instances in your {{es}}, {{kib}} and {{
146146

147147
## Customize {{agent}} configuration [k8s-elastic-agent-fleet-configuration-custom-configuration]
148148

149-
In contrast to {{agents}} in standalone mode, the configuration is managed through {{fleet}}, and it cannot be defined through `config` or `configRef` elements.
149+
In contrast to {{agents}} in standalone mode, the configuration is managed through {{fleet}}, and it cannot be defined through `config` or `configRef` elements with a few exceptions.
150150

151+
One of those exceptions is the configuration of providers as described in [advanced Agent configuration managed by Fleet](/reference/fleet/advanced-kubernetes-managed-by-fleet.md). When {{agent}} is managed by {{fleet}} and is orchestrated by ECK, the configuration of providers can simply be done through the `.spec.config` element in the Agent resource as of {applies_to}`stack: ga 8.13`:
152+
153+
```yaml
154+
apiVersion: agent.k8s.elastic.co/v1alpha1
155+
kind: Agent
156+
metadata:
157+
name: elastic-agent
158+
spec:
159+
config:
160+
fleet:
161+
enabled: true
162+
providers.kubernetes:
163+
add_resource_metadata:
164+
deployment: true
165+
```
151166

152167
## Upgrade the {{agent}} specification [k8s-elastic-agent-fleet-configuration-upgrade-specification]
153168

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
applies_to:
3+
deployment:
4+
eck: preview 3.1
5+
products:
6+
- id: cloud-kubernetes
7+
---
8+
9+
# Propagate Labels and Annotations [k8s-propagate-labels-annotations]
10+
11+
Starting with version `3.1.0`, {{eck}} supports propagating labels and annotations from the parent resource to the child resources it creates. This can be used on all custom resources managed by ECK, such as {{eck_resources_list}}.
12+
13+
The example below demonstrates how to use this feature on a {{es}} cluster, however, as mentioned above, this can be also applied to any custom resource managed by {{eck}}.
14+
15+
```yaml
16+
apiVersion: elasticsearch.k8s.elastic.co/v1
17+
kind: Elasticsearch
18+
metadata:
19+
annotations:
20+
# Some custom annotations to be propagated to resources created by the operator.
21+
my-annotation1: "my-annotation1-value"
22+
my-annotation2: "my-annotation2-value"
23+
# Instructions for the operator to propagate these annotations and labels to resources it creates.
24+
eck.k8s.alpha.elastic.co/propagate-annotations: "my-annotation1, my-annotation2"
25+
eck.k8s.alpha.elastic.co/propagate-labels: "my-label1, my-label2"
26+
labels:
27+
# Some custom labels to be propagated to resources created by the operator.
28+
my-label1: "my-label1-value"
29+
my-label2: "my-label2-value"
30+
name: elasticsearch-sample
31+
spec:
32+
version: 9.1.0
33+
nodeSets:
34+
- name: default
35+
config:
36+
# this allows ES to run on nodes even if their vm.max_map_count has not been increased, at a performance cost
37+
node.store.allow_mmap: false
38+
count: 1
39+
```
40+
41+
The custom labels and annotations specified in the `metadata` section of the parent resource will be propagated to all child resources created by {{eck}}, such as StatefulSets, Pods, Services, and Secrets. This ensures that all resources have consistent metadata, which can be useful for filtering, monitoring, and managing resources in Kubernetes:
42+
43+
```sh
44+
kubectl get sts,pods,svc -l my-label1=my-label1-value,my-label2=my-label2-value
45+
```
46+
47+
```sh
48+
NAME READY AGE
49+
statefulset.apps/elasticsearch-sample-es-default 1/1 4m10s
50+
51+
NAME READY STATUS RESTARTS AGE
52+
pod/elasticsearch-sample-es-default-0 1/1 Running 0 4m9s
53+
54+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
55+
service/elasticsearch-sample-es-default ClusterIP None <none> 9200/TCP 4m12s
56+
service/elasticsearch-sample-es-http ClusterIP XX.XX.XX.XX <none> 9200/TCP 4m14s
57+
service/elasticsearch-sample-es-internal-http ClusterIP XX.XX.XX.XX <none> 9200/TCP 4m14s
58+
service/elasticsearch-sample-es-transport ClusterIP None <none> 9300/TCP 4m14s
59+
```
60+
61+
It is possible to use `*` as a wildcard to propagate all labels and annotations from the parent resource to the child resources. For example:
62+
63+
```yaml
64+
apiVersion: elasticsearch.k8s.elastic.co/v1
65+
kind: Elasticsearch
66+
metadata:
67+
annotations:
68+
# Instructions for the operator to propagate all the annotations and labels to resources it creates.
69+
eck.k8s.alpha.elastic.co/propagate-annotations: "*"
70+
eck.k8s.alpha.elastic.co/propagate-labels: "*"
71+
name: elasticsearch-sample
72+
spec:
73+
version: 9.1.0
74+
nodeSets:
75+
- name: default
76+
config:
77+
# this allows ES to run on nodes even if their vm.max_map_count has not been increased, at a performance cost
78+
node.store.allow_mmap: false
79+
count: 1
80+
```
81+
82+
::::{note}
83+
Note the following considerations when using this feature:
84+
* Propagated labels and annotations are not automatically deleted. If you want to remove them from the child resources, you need to do so manually or use a cleanup script.
85+
* To prevent conflicts, some labels and annotations reserved for internal use by ECK or Kubernetes are not propagated. This is the case for labels and annotations that match `*.k8s.*.elastic.co/` and also `kubectl.kubernetes.io/last-applied-configuration`.
86+
::::

deploy-manage/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ toc:
225225
- file: deploy/cloud-on-k8s/k8s-kibana-advanced-configuration.md
226226
- file: deploy/cloud-on-k8s/k8s-kibana-plugins.md
227227
- file: deploy/cloud-on-k8s/customize-pods.md
228+
- file: deploy/cloud-on-k8s/propagate-labels-annotations.md
228229
- file: deploy/cloud-on-k8s/manage-compute-resources.md
229230
- file: deploy/cloud-on-k8s/recipes.md
230231
- file: deploy/cloud-on-k8s/connect-to-external-elastic-resources.md

reference/fleet/advanced-kubernetes-managed-by-fleet.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,5 @@ volumes:
106106

107107
1. By default the manifests for {{agent}} managed by {{fleet}} have `hostNetwork:true`. In order to support multiple installations of {{agent}}s in the same node you should set `hostNetwork:false`. See this relevant [example](https://github.com/elastic/elastic-agent/tree/main/docs/manifests/hostnetwork) as described in [{{agent}} Manifests in order to support Kube-State-Metrics Sharding](https://github.com/elastic/elastic-agent/blob/main/docs/elastic-agent-ksm-sharding.md).
108108
2. The volume `/usr/share/elastic-agent/state` must remain mounted in [elastic-agent-managed-kubernetes.yaml](https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml), otherwise custom config map provided above will be overwritten.
109+
3. If {{agent}} is deployed through ECK, you can define the provider configuration in the `spec.config` field of the Kubernetes custom resource. Refer to [{{fleet}}-managed {{agent}} on ECK](/deploy-manage/deploy/cloud-on-k8s/configuration-fleet.md) for details.
109110

0 commit comments

Comments
 (0)