Skip to content

Commit

Permalink
Describe how to connect domains to containers
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Jan 13, 2025
1 parent 5ac923b commit fa2b8b8
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This command can be used to declare the desired state of a container stack.

:::important Idempotent operation

This operation is idempotent and can be used to add/update or remove containers and volumes from a stack. To remove a container, replace the container definition with an empty object.
This operation is idempotent and can be used to add/update or remove containers and volumes from a stack. To remove a container, remove it from the definition list when replacing the container stack.

:::

Expand Down
7 changes: 7 additions & 0 deletions generator/overlays/v2/container.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ Containers are run as part of a container stack. A container stack is a collecti
- <OperationLink operation="container-list-stacks" apiVersion="v2-preview" /> to list available stacks (use the `default` stack)
- <OperationLink operation="container-declare-stack" apiVersion="v2-preview" /> to declare the desired state of a container stack; this operation is idempotent and can be used to add/update or remove containers and volumes from a stack

### Connecting domains to containers

To connect a domain to a running container, you can specify the container as target of an ingress resource. Use the following API operation to create an ingress connected to a container:

<!-- prettier-ignore -->
- <OperationLink operation="ingress-create-ingress" apiVersion="v2" /> to connect a domain to a container

## Operational tasks

To manage a container stack's lifecycle, you can use the following API operations:
Expand Down
58 changes: 57 additions & 1 deletion generator/overlays/v2/overlay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,60 @@ actions:
update:
summary: Resets A records to managed for a specific zone
description: >
This operation is deprecated. Use the `POST /v2/dns/zones/{zoneId}/record-sets/{recordSet}/actions/set-managed` endpoint instead.
This operation is deprecated. Use the `POST /v2/dns/zones/{zoneId}/record-sets/{recordSet}/actions/set-managed` endpoint instead.
- target: $.paths['/v2/ingresses'].post.requestBody.content['application/json'].schema.properties.paths
update:
example:
- path: /
target:
useDefaultPage: true
- path: /redirect
target:
url: https://some-redirect.example
- path: /path-to-dir
target:
directory: /public
- path: /path-to-app
target:
installationId: e1ccfde2-8983-4529-ae66-23a7e34c1177
- path: /path-to-container
target:
container:
id: ead3223c-6f23-4eaf-8250-392f10b49a35
portProtocol: 80/tcp
- target: $.components.schemas['de.mittwald.v1.ingress.TargetDirectory']
update:
description: Serve files from a specific directory
properties:
directory:
description: The directory from which to serve files.
example: /public
- target: $.components.schemas['de.mittwald.v1.ingress.TargetUrl']
update:
description: Redirect requests to this path to another URL
properties:
url:
description: The URL to which requests should be forwarded.
example: https://redirect-target.example
- target: $.components.schemas['de.mittwald.v1.ingress.TargetInstallation']
update:
description: Serve a specific app installation
properties:
installationId:
description: The ID of an app installation within the same project to which requests should be forwarded.
- target: $.components.schemas['de.mittwald.v1.ingress.TargetUseDefaultPage']
update:
description: Serve a generic default page
properties:
useDefaultPage:
description: Set this to `true` to serve a generic default site at this path.
- target: $.components.schemas['de.mittwald.v1.ingress.TargetContainer']
update:
description: Forward requests to this path to a specific container.
properties:
container:
descriptions: References a specific port/container combination within the same project.
properties:
portProtocol:
example: 80/tcp
7 changes: 7 additions & 0 deletions src/components/openapi/OperationInputValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ export function AlternativeValue({
}: {
schema: OpenAPIV3.SchemaObject;
}) {
let body: ReactNode;

if (schema.description) {
body = <Markdown>{schema.description}</Markdown>;
}

return (
<li>
<div className={styles.parameterListHeader}>
<span className={styles.parameterAlternative}>Alternative</span>
<Type className={styles.parameterType} schema={schema} />
</div>
{body && <div className={styles.parameterListBody}>{body}</div>}
<Schema schema={schema} />
</li>
);
Expand Down
2 changes: 2 additions & 0 deletions src/openapi/generateSchemaExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export function generateSchemaExample(schema: OpenAPIV3.SchemaObject): any {
return "[email protected]";
} else if (schema.format === "uuid") {
return "f0f86186-0a5a-45b2-aa33-502777496347";
} else if (schema.format === "idn-hostname") {
return "some-hostname.example";
}

if (schema.enum !== undefined) {
Expand Down

0 comments on commit fa2b8b8

Please sign in to comment.