Skip to content

Commit

Permalink
Doc updates for k8s incremental adoption features (#791)
Browse files Browse the repository at this point in the history
* update container schema

Signed-off-by: Will Tsai <[email protected]>

* spelling corrections

Signed-off-by: Will Tsai <[email protected]>

* update snippets

Signed-off-by: Will Tsai <[email protected]>

* add new operations page

Signed-off-by: Will Tsai <[email protected]>

* add new operations page

Signed-off-by: Will Tsai <[email protected]>

* fix link

Signed-off-by: Will Tsai <[email protected]>

* redo where content goes

Signed-off-by: Will Tsai <[email protected]>

* spelling corrections

Signed-off-by: Will Tsai <[email protected]>

* spelling corrections

Signed-off-by: Will Tsai <[email protected]>

* rename sidecar.yaml to base-container.yaml

Signed-off-by: Will Tsai <[email protected]>

* address @AaronCrawfis feedback

Signed-off-by: Will Tsai <[email protected]>

* correcting some specs

Signed-off-by: Will Tsai <[email protected]>

* Apply suggestions from code review

Co-authored-by: Aaron Crawfis <[email protected]>

---------

Signed-off-by: Will Tsai <[email protected]>
Co-authored-by: Aaron Crawfis <[email protected]>
  • Loading branch information
willtsai and AaronCrawfis authored Oct 4, 2023
1 parent dff70be commit 86d5f8b
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,7 @@ WirelessGateway
WorkGroup
Workgroup
XRay
PodSpec
ConfigMap
CRD
composable
22 changes: 22 additions & 0 deletions docs/content/guides/author-apps/containers/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ Radius containers are portable across container runtimes, allowing you to define

Containers are deployed to the same Kubernetes cluster as your Radius installation, into the namespace that is defined in your application. For more information on how Radius resources map to Kubernetes objects, refer to the [Kubernetes mapping guide]({{< ref "/guides/operations/kubernetes/overview#resource-mapping" >}}).

#### Customize Kubernetes configurations

Radius provides a way to apply custom Kubernetes configurations to container resources that are created by Radius. This allows you to make use of Kubernetes configurations or features that are not supported by Radius, yet remain composable with other Radius features like [Connections]({{< ref "guides/author-apps/containers/overview#connections" >}}). Additionally, it provides a way to migrate your existing Kubernetes applications into Radius without having to rewrite your Kubernetes configurations, while giving you the option to incrementally adopt Radius features over time. The customizations are applied to the container resource via the [`runtimes`]({{< ref "reference/resource-schema/core-schema/container-schema/_index.md#runtimes" >}}) property within the container resource definition.

##### Base Kubernetes YAML

You can provide a Kubernetes YAML definition as a base or foundation upon which Radius will build your containers, enabling you to incrementally adopting Radius by starting with your existing YAML definition and use applying Radius customizations on top. The provided YAML is fully passed through to Kubernetes when Radius creates the container resource, which means that you may even provide a definition for a CRD that Radius has no visibility into. <!-- For more information on how to onboard existing Kubernetes resources into Radius, refer to the [base Kubernetes YAML guide]("guides/author-apps/kubernetes/how-to-yaml-base-support"). -->

Radius currently supports the following Kubernetes resource types for the `base` property:

| Kubernetes Resource Types | Number of resources | Limitation |
|---------------------------|---------------------|------------|
| Deployment | 1 | Deployment name must match the name of the Radius container |
| ServiceAccount | 1 | ServiceAccount name must match the name of the Radius container using the correct namespace |
| Service | 1 | ServiceAccount name must match the name of the Radius container using the correct namespace |
| Secrets | Multiple | No limitation except within the respective namespace |
| ConfigMap | Multiple config maps | No limitation except within the respective namespace |

##### Pod patching

You can also "patch" the Kubernetes containers created and deployed by Radius using [PodSpec](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec) definitions. This allows for setting Kubernetes-specific configurations, as well as overriding Radius behaviors, which means that you may access all Kubernetes Pod features, even if they are not supported by Radius. <!-- For more information on how to patch Kubernetes pods, refer to the [Kubernetes pod patching guide]("guides/author-apps/kubernetes/how-to-patch-pod"). -->

## Container definition

Radius containers allow you to specify your image, ports, environment variables, volumes, and more. Refer to the [container resource schema]({{< ref "container-schema" >}}) for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ weight: 300
| [container](#container) | y | Container configuration. | [See below](#container)
| [connections](#connections) | n | List of connections to other resources. | [See below](#connections)
| [extensions](#extensions) | n | List of extensions on the container. | [See below](#extensions)
| [runtimes](#runtimes) | n | Runtime specific configurations for the container. | [See below](#runtimes)

### Container

Expand Down Expand Up @@ -165,3 +166,15 @@ The `manualScaling` extension configures the number of replicas of a compute ins
| kind | y | The kind of extension. | `manualScaling`
| replicas | Y | The number of replicas to run | `5` |

### Runtimes

| Key | Required | Description | Example |
|------|:--------:|-------------|---------|
| kubernetes | n | Kubernetes specific configuration for the container. | [See below](#kubernetes)

#### Kubernetes

| Key | Required | Description | Example |
|------|:--------:|-------------|---------|
| base | n | The base Kubernetes resource manifest on top of which Radius specified properties will be applied. Supported resource types are documented [here]({{<ref "guides/author-apps/containers/overview#base-kubernetes-yaml">}}). | `loadTextContent('manifest/base-container.yaml')`
| pod | n | The pod specifications to apply to the Kubernetes resource created by Radius. Any field defined on [PodSpec](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec) can be set here. | [`topologySpreadConstraints`](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: radiusdev.azurecr.io/magpie:latest
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
}
}
]
runtimes: {
kubernetes: {
base: loadTextContent('base-container.yaml')
pod: {
containers: [
{
name: 'log-collector'
image: 'radiusdev.azurecr.io/fluent/fluent-bit:2.1.8'
}
]
hostNetwork: true
}
}
}
}
}
//CONTAINER
Expand Down

0 comments on commit 86d5f8b

Please sign in to comment.