Skip to content

K8s: Add YAML examples #1872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
Jul 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f64f63f
Add comprehensive YAML examples subsection for Kubernetes reference d…
kaitlynmichael Jul 24, 2025
847ed14
Fix navigation order in logs section
kaitlynmichael Jul 24, 2025
9b4d5e9
Add links to YAML examples in log collector documentation
kaitlynmichael Jul 24, 2025
0d8da15
Remove unnecessary 'File:' labels from YAML examples
kaitlynmichael Jul 24, 2025
2443841
Move log collector changes to DOC-5485 branch
kaitlynmichael Jul 24, 2025
5c369ef
edits
kaitlynmichael Jul 24, 2025
6f9c84d
Add log-collector-rbac.md with RBAC configurations
kaitlynmichael Jul 24, 2025
9683c0e
api section
kaitlynmichael Jul 24, 2025
acbfaf1
copy edits
kaitlynmichael Jul 24, 2025
37caa05
download button
kaitlynmichael Jul 24, 2025
f7daf5c
deployment links
kaitlynmichael Jul 24, 2025
3d1f5c5
copy edits
kaitlynmichael Jul 24, 2025
ba19a2f
fix download button
kaitlynmichael Jul 24, 2025
7a262d6
download button adjustments
kaitlynmichael Jul 24, 2025
a538390
formatting cleanup
kaitlynmichael Jul 24, 2025
793f6d4
active voice edits
kaitlynmichael Jul 24, 2025
e1e97fd
Update content/operate/kubernetes/reference/_index.md
kaitlynmichael Jul 28, 2025
0bc65c4
Update content/operate/kubernetes/reference/yaml/_index.md
kaitlynmichael Jul 28, 2025
9e6e393
Update content/operate/kubernetes/reference/yaml/active-active.md
kaitlynmichael Jul 28, 2025
8c0d1ff
Update content/operate/kubernetes/reference/api/_index.md
kaitlynmichael Jul 28, 2025
127e506
fix relrefs to yaml folder
kaitlynmichael Jul 28, 2025
78c68bf
update api relrefs
kaitlynmichael Jul 28, 2025
3c83384
Update content/operate/kubernetes/reference/yaml/rack-awareness.md
kaitlynmichael Jul 29, 2025
f22ba58
formatting all and restricted as code
kaitlynmichael Jul 29, 2025
14e361c
add role binding config info
kaitlynmichael Jul 29, 2025
1ce48c4
avoid passive voice
kaitlynmichael Jul 29, 2025
4b840b1
review edits
kaitlynmichael Jul 29, 2025
09560a6
remove duplicate log rbac page
kaitlynmichael Jul 29, 2025
542c463
review edits
kaitlynmichael Jul 29, 2025
8ee1637
RC: Remove retention policy requirement and implement tabs for Import…
cmilesb Jul 8, 2025
ff42138
K8s: Add log collector options (#1873)
kaitlynmichael Jul 24, 2025
c228477
k8s: fixing 404 errors between versions (#1870)
kaitlynmichael Jul 24, 2025
a718fb1
Quick .gitignore update (#1877)
dwdougherty Jul 25, 2025
8e10e9a
DEV: add RESP2/3 return information to the RQE commands (#1874)
dwdougherty Jul 25, 2025
c173698
Remove retention policy
cmilesb Jul 25, 2025
63ff3e8
DOC-5498 updated command line info
andy-stark-redis Jul 25, 2025
1b363a4
DOC-5498 updates to config details
andy-stark-redis Jul 25, 2025
232248a
Update content/integrate/redis-mcp/client-conf.md
andy-stark-redis Jul 28, 2025
7caebd0
Update maxlength for redis copilot input box (#1879)
paoloredis Jul 28, 2025
4335ef7
DOC-5501 Python prob examples
andy-stark-redis Jul 28, 2025
b2bb14a
DOC-5501 C# prob examples
andy-stark-redis Jul 28, 2025
30ff0f1
DOC-5501 C# trans/pipe examples
andy-stark-redis Jul 28, 2025
d4c6dc6
DOC-5501 Jedis prob examples
andy-stark-redis Jul 28, 2025
e2251e8
DEV: add RESP2/3 return information to the JSON commands (#1878)
dwdougherty Jul 28, 2025
a28321d
DEV: a better explanation for the XCLAIM RETRYCOUNT option (#1883)
dwdougherty Jul 29, 2025
ef14a9d
Upload versioned products to different paths for cloud connector (#1888)
paoloredis Jul 29, 2025
d2f00b5
Update rs-prometheus-metrics-v2.md (#1890)
maayanagranat Jul 29, 2025
58d3507
DOC-5503 David's local examples build
andy-stark-redis Jul 29, 2025
3c1d721
DOC-5503 New param to override default tab name
andy-stark-redis Jul 29, 2025
d4bfda2
DOC-5503 allow custom name and link for first tab
andy-stark-redis Jul 29, 2025
69900ec
DOC-5503 hide GitHub icon when example is local
andy-stark-redis Jul 29, 2025
c0141e9
DOC-5503 deleted test files
andy-stark-redis Jul 29, 2025
f9c4fe2
DOC-5510 added temporary data type examples
andy-stark-redis Jul 29, 2025
d16e8b2
DOC-5510 local C# client-specific examples
andy-stark-redis Jul 29, 2025
2518df3
DOC-5510 Python and Jedis probabilistic examples
andy-stark-redis Jul 29, 2025
74c86c2
Update rs-prometheus-metrics-v2.md (#1887)
maayanagranat Jul 29, 2025
b5ff4b7
DOC-3222 RS: Clarified formula and examples for disk sizing for heavy…
rrelledge Jul 29, 2025
edab195
RS 7.22.0 July maintenance release notes (#1844)
rrelledge Jul 29, 2025
1f7674b
remove link to downloads page
mich-elle-luna Jul 28, 2025
594e8b5
Update apt.md
mich-elle-luna Jul 28, 2025
35be4c7
Add 8 new notebook links to AI notebook collection
mich-elle-luna Jul 28, 2025
b983e61
Update content/develop/ai/notebook-collection.md
mich-elle-luna Jul 29, 2025
5c1c419
Update content/develop/ai/notebook-collection.md
mich-elle-luna Jul 29, 2025
fd3b087
Update content/develop/ai/notebook-collection.md
mich-elle-luna Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@ jobs:
then
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
for versioned_build in "${versioned_builds[@]}"; do
product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
read product version <<< "$(awk -F- '{print $1 " " $2}' <<<"$versioned_build")"

if [[ "${product}" == "redis-data-integration" ]]; then
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${versioned_build}/integrate/${product}"
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/docs/${versioned_build}/integrate/${product}"
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}/${version}" "gs://${BUCKET}/docs/$bucket_path/integrate/${product}/${version}"
else
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/docs/${versioned_build}/operate/${product}"
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}/${version}" "gs://${BUCKET}/docs/$bucket_path/operate/${product}/${version}"
fi
done
fi
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/data/versions.json
/data/components_local/
/examples
build/components/__pycache__/
**/__pycache__/
venv/**
node_modules/
package-lock.json
Expand Down
35 changes: 35 additions & 0 deletions assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,41 @@ select {
@apply w-10 h-10;
}

/* YAML embed download button styles */
.download-yaml-btn {
@apply transition-colors;
}

.download-yaml-btn:disabled {
@apply opacity-75 cursor-not-allowed;
}

.download-yaml-btn svg {
@apply w-4 h-4;
}

/* Make long code blocks scrollable */
.yaml-embed-container .highlight {
max-height: 800px;
overflow-y: auto;
}

.yaml-embed-container .highlight::-webkit-scrollbar {
width: 8px;
}

.yaml-embed-container .highlight::-webkit-scrollbar-track {
@apply bg-slate-700 rounded;
}

.yaml-embed-container .highlight::-webkit-scrollbar-thumb {
@apply bg-slate-500 rounded;
}

.yaml-embed-container .highlight::-webkit-scrollbar-thumb:hover {
@apply bg-slate-400;
}

#download-redis > h3,
#download-redis-stack > h3 {
@apply mt-2;
Expand Down
158 changes: 158 additions & 0 deletions build/local_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""
Local Examples Processor

This script processes local examples from the local_examples/ directory
and integrates them into the existing examples system.

Works like remote examples - each file contains an EXAMPLE: header
and can be any supported language.
"""

import os
import glob
import shutil
import logging
from typing import Dict, Any

from components.example import Example
from components.util import mkdir_p
from components.structured_data import load_dict, dump_dict


# File extension to language mapping
EXTENSION_TO_LANGUAGE = {
'.py': 'python',
'.js': 'node.js',
'.go': 'go',
'.cs': 'c#',
'.java': 'java',
'.php': 'php'
}

# Language to client name mapping (from config.toml clientsExamples)
LANGUAGE_TO_CLIENT = {
'python': 'Python',
'node.js': 'Node.js',
'go': 'Go',
'c#': 'C#',
'java': 'Java-Sync', # Default to sync, could be overridden
'php': 'PHP',
'redisvl': 'RedisVL'
}


def get_language_from_extension(filename: str) -> str:
"""Get language from file extension."""
_, ext = os.path.splitext(filename)
return EXTENSION_TO_LANGUAGE.get(ext.lower())


def get_client_name_from_language(language: str) -> str:
"""Get client name from language."""
return LANGUAGE_TO_CLIENT.get(language, language.title())


def get_example_id_from_file(path: str) -> str:
"""Extract example ID from the first line of a file."""
try:
with open(path, 'r') as f:
first_line = f.readline().strip()
if 'EXAMPLE:' in first_line:
return first_line.split(':')[1].strip()
except Exception as e:
logging.error(f"Error reading example ID from {path}: {e}")
return None


def process_local_examples(local_examples_dir: str = 'local_examples',
examples_dir: str = 'examples',
examples_json: str = 'data/examples.json') -> None:
"""
Process local examples and integrate them into the examples system.

Works like remote examples - each file contains an EXAMPLE: header
and can be any supported language.

Args:
local_examples_dir: Directory containing local example source files
examples_dir: Target directory for processed examples
examples_json: Path to examples.json file
"""

if not os.path.exists(local_examples_dir):
logging.info(f"Local examples directory {local_examples_dir} not found, skipping")
return

# Load existing examples data
examples_data = {}
if os.path.exists(examples_json):
examples_data = load_dict(examples_json)

# Process each file in local_examples directory
for filename in os.listdir(local_examples_dir):
source_file = os.path.join(local_examples_dir, filename)

if not os.path.isfile(source_file):
continue

# Get language from file extension
language = get_language_from_extension(filename)
if not language:
logging.warning(f"Unknown file extension for: {filename}")
continue

# Get example ID from file content
example_id = get_example_id_from_file(source_file)
if not example_id:
logging.warning(f"No EXAMPLE: header found in {filename}")
continue

logging.info(f"Processing local example: {example_id} ({language})")

# Create target directory
target_dir = os.path.join(examples_dir, example_id)
mkdir_p(target_dir)

# Initialize example data
if example_id not in examples_data:
examples_data[example_id] = {}

# Copy file to target directory with local_ prefix
base_name = os.path.splitext(filename)[0]
ext = os.path.splitext(filename)[1]
target_filename = f"local_{base_name}{ext}"
target_file = os.path.join(target_dir, target_filename)
shutil.copy2(source_file, target_file)

# Process with Example class
example = Example(language, target_file)

# Get client name
client_name = get_client_name_from_language(language)

# Create metadata
example_metadata = {
'source': source_file,
'language': language,
'target': target_file,
'highlight': example.highlight,
'hidden': example.hidden,
'named_steps': example.named_steps,
'sourceUrl': None # Local examples don't have source URLs
}

examples_data[example_id][client_name] = example_metadata
logging.info(f"Processed {client_name} example for {example_id}")

# Save updated examples data
dump_dict(examples_json, examples_data)
logging.info(f"Updated examples data saved to {examples_json}")


if __name__ == '__main__':
logging.basicConfig(level=logging.INFO,
format='%(levelname)s: %(message)s')

process_local_examples()
print("Local examples processing complete")
17 changes: 9 additions & 8 deletions build/make.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import argparse
from datetime import datetime
import logging
import sys
import tempfile

from components.component import All
from components.util import mkdir_p
from local_examples import process_local_examples


def parse_args() -> argparse.Namespace:
Expand All @@ -30,20 +32,19 @@ def parse_args() -> argparse.Namespace:
ARGS = parse_args()
mkdir_p(ARGS.tempdir)

# Configure logging BEFORE creating objects
log_level = getattr(logging, ARGS.loglevel.upper())
logging.basicConfig(
level=log_level,
format='%(message)s %(filename)s:%(lineno)d - %(funcName)s',
force=True # Force reconfiguration in case logging was already configured
)

# Load settings
ALL = All(ARGS.stack, None, ARGS.__dict__)

# Make the stack
logging.basicConfig(
level=ARGS.loglevel, format=f'{sys.argv[0]}: %(levelname)s %(asctime)s %(message)s')
print(f'Applying all configured components"{ALL._name}"')
start = datetime.now()
ALL.apply()

# Process local examples
print('Processing local examples')
process_local_examples()

total = datetime.now() - start
print(f'+OK ({total.microseconds / 1000} ms)')
4 changes: 2 additions & 2 deletions content/apis/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ If you have installed Redis Enterprise Software, you can automate operations wit

If you need to install Redis Enterprise on Kubernetes, then you can use the [Redis Enterprise for Kubernetes Operators]({{< relref "/operate/Kubernetes/" >}}). You can find the resource definitions here:

- [Redis Enterprise Cluster API]({{<relref "/operate/kubernetes/reference/redis_enterprise_cluster_api">}})
- [Redis Enterprise Database API]({{<relref "/operate/kubernetes/reference/redis_enterprise_database_api">}})
- [Redis Enterprise Cluster API]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_cluster_api">}})
- [Redis Enterprise Database API]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_database_api">}})
2 changes: 2 additions & 0 deletions content/commands/cf.exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ redis> CF.EXISTS cf item2
(integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="cf-exists-return-info"
tab1="RESP2"
tab2="RESP3" >}}
Expand Down
2 changes: 2 additions & 0 deletions content/commands/cms.info.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ redis> CMS.INFO test
6) (integer) 0
```

## Return information

{{< multitabs id=“cms-info-return-info"
tab1="RESP2"
tab2="RESP3" >}}
Expand Down
2 changes: 2 additions & 0 deletions content/commands/cms.query.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ redis> CMS.QUERY test foo bar
2) (integer) 42
```

## Return information

{{< multitabs id=“cms-merge-return-info"
tab1="RESP2"
tab2="RESP3" >}}
Expand Down
20 changes: 15 additions & 5 deletions content/commands/ft._list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,25 @@ In the future, a [`SCAN`]({{< relref "/commands/scan" >}}) type of command will
contains a large number of indices.
{{% /alert %}}

## Return

[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with index names.

## Examples

```sql
FT._LIST
1) "idx"
2) "movies"
3) "imdb"
```
```

## Return information

{{< multitabs id="ft-_list-return-info"
tab1="RESP2"
tab2="RESP3" >}}

[Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of index names as [simple strings]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}).

-tab-sep-

[Set]({{< relref "/develop/reference/protocol-spec#sets" >}}) of index names as [simple strings]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}).

{{< /multitabs >}}
33 changes: 25 additions & 8 deletions content/commands/ft.aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,7 @@ You can use `@__score` in a pipeline as shown in the following example:
selects the dialect version under which to execute the query. If not specified, the query will execute under the default dialect version set during module initial loading or via [`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) command.
</details>

## Return

FT.AGGREGATE returns an array reply where each row is an array reply and represents a single aggregate result.
The [integer reply]({{< relref "develop/reference/protocol-spec#resp-integers" >}}) at position `1` does not represent a valid value.

### Return multiple values
## Return multiple values

See [Return multiple values]({{< relref "commands/ft.search#return-multiple-values/" >}}) in [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})
The `DIALECT` can be specified as a parameter in the FT.AGGREGATE command. If it is not specified, the `DEFAULT_DIALECT` is used, which can be set using [`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) or by passing it as an argument to the `redisearch` module when it is loaded.
Expand Down Expand Up @@ -489,13 +484,35 @@ Next, count GitHub events by user (actor), to produce the most active users.

</details>

## Return information

{{< multitabs id="ft-aggregate-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with the first element being the total number of results, followed by result rows as [arrays]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of field-value pairs.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: incorrect number of arguments, non-existent index, invalid query syntax.

-tab-sep-

One of the following:
* [Map]({{< relref "/develop/reference/protocol-spec#maps" >}}) with the following fields:
- `attributes`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of attribute names.
- `format`: [Simple string]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - result format.
- `results`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [maps]({{< relref "/develop/reference/protocol-spec#maps" >}}) containing aggregated data.
- `total_results`: [Integer]({{< relref "/develop/reference/protocol-spec#integers" >}}) - total number of results.
- `warning`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of warning messages.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: incorrect number of arguments, non-existent index, invalid query syntax.

{{< /multitabs >}}

## See also

[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})
[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})

## Related topics

- [Aggregations]({{< relref "/develop/ai/search-and-query/advanced-concepts/aggregations" >}})
- [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}})
- [RediSearch]({{< relref "/develop/ai/search-and-query" >}})

Loading