text stringlengths 0 59.1k |
|---|
# source: k8s_examples/guidelines.md type: docs |
# Kubernetes Example Guidelines |
Welcome to the `kubernetes/examples` repository! This repository serves as a |
community-driven collection of high-quality, educational examples demonstrating |
how to run a diverse range of applications, frameworks, and workloads on Kubernetes. |
Our goal is to provide a central place for users to discover practical examples, |
learn common patterns, and understand best practices for deploying applications, |
including general-purpose workloads and specialized AI/ML workloads and platforms. |
These guidelines are intended for contributors to ensure that all examples are |
consistent, maintainable, easy to understand, and valuable to the Kubernetes community. |
By adhering to these guidelines, we can build a rich and up-to-date resource. |
## An Example Is... |
An example demonstrates running an application, framework, or complex workload |
(such as AI/ML model serving, training pipelines, associated toolchains) on Kubernetes. |
It must be: |
* Meaningful: Solves or illustrates a recognizable, real-world (though potentially simplified) use case. |
* Educational: Helps users learn how to deploy and manage the specific type of application |
or pattern on Kubernetes. It should explain the "why" behind the "how." |
* Illustrative of Best Practices: Showcases current Kubernetes best practices for configuration, |
security, and application architecture where applicable. |
* Focused: While it can involve multiple components, it should illustrate a specific concept |
or setup without becoming overly broad. For very complex systems, consider breaking them into |
smaller, related examples or leveraging modular design, especially for platform blueprints. |
## Examples Are NOT... |
Examples are intended for educational purposes and should not be: |
* Minimalistic Feature Snippets: Examples should be more comprehensive than simple snippets |
designed to illustrate a single Kubernetes API field. Such content is better suited for |
the official [Kubernetes documentation](https://kubernetes.io/docs/home/). |
* Pure Kubernetes Feature Demonstrations: Examples should focus on the application running |
on Kubernetes, not solely on demonstrating a Kubernetes feature in isolation (e.g., showing |
high availability is a feature demo, not an application example unless it's core to |
understanding how that specific application achieves HA on Kubernetes). |
## An Example Includes... |
Each example must be well-structured and documented to ensure clarity and usability. |
### Structure and README |
* Directory: Each example MUST reside in its own clearly named subdirectory within a |
relevant category (e.g., `/ai/`, `/databases/`). |
* README.md: Every example MUST have a `README.md` file. This file is crucial for |
understandability and usability. It SHOULD follow a consistent structure. |
_(TBD: establish a `EXAMPLE_README_TEMPLATE.md` to guide contributors)._ Key sections include: |
* Title: Clear and descriptive title of the example. |
* Purpose / What You'll Learn: Briefly describe what the example demonstrates and what |
the user will learn by using it. |
* Table of Contents (ToC): For longer READMEs, a ToC is highly recommended. |
* Prerequisites, such as: |
* Required Kubernetes version. |
* Any necessary tools (e.g., `kubectl`, `kustomize`, `helm`, `git`). |
* Specific hardware requirements. This is especially important for AI/ML examples. |
* Quick Start / TL;DR: A concise set of commands to deploy the example with minimal effort, |
preferably without needing to clone the repository. |
* Detailed Steps & Explanation: |
* Walk through the deployment process. |
* Explain the key Kubernetes manifests and their roles within the example. |
* Describe important configuration choices. |
* Verification / Seeing it Work: Commands to verify the application is running correctly, |
along with expected output (console logs, screenshots, or how to access an endpoint). |
For AI/ML examples, this might include how to check training progress or send a test inference request. |
* Configuration Customization (Optional but Recommended): Guidance on how users can |
customize common parameters. |
* Cleanup: Commands to remove all resources created by the example. |
* Troubleshooting (Optional): Common issues and how to resolve them. |
* Further Reading / Next Steps: Links to relevant official documentation, related |
examples, or more advanced topics. |
* Maintainer(s) (Optional): GitHub username(s) of primary maintainers. |
* Last Validated Kubernetes Version (Recommended): The Kubernetes version against |
which the example was last successfully tested. |
### Manifests and Configuration |
* Clarity and Best Practices: Manifests should be well-commented where non-obvious. |
They must follow [Kubernetes configuration best practices](https://kubernetes.io/docs/concepts/configuration/overview/) |
and general [security best practices](https://kubernetes.io/docs/concepts/security/overview/). |
* Kubernetes API Usage: |
* Use stable APIs whenever possible. If beta or alpha features are used, they must |
be explicitly mentioned along with any necessary feature gates. |
* Avoid deprecated APIs or features. Reference API documentation for core or custom workload APIs. |
* Vendor neutral: Do not endorse one particular ecosystem tool or cloud-provider. |
* Individual manifests will inherently use specific tools to fulfill their purpose. |
However, examples will be open to manifests for a diverse set of tools, governed |
by community interest and contribution. |
* If an example *must* use cloud-provider-specific features (e.g., specific AI accelerators, |
managed database services critical to an AI workload/platform), this dependency MUST be |
clearly documented in the `README.md` under prerequisites. If possible, provide guidance |
for adapting to other environments or a generic setup. |
* Resource Requests and Limits: Define realistic resource requests and limits for all |
workloads. For resource-intensive examples, clearly document these and, if feasible, |
offer scaled-down versions for resource-constrained environments. |
* External Links in Manifests: All URLs used in manifests must point to reliable, versioned sources. |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 17