Skip to content

Commit

Permalink
Add kubernetes site option documentation. (#5920)
Browse files Browse the repository at this point in the history
  • Loading branch information
crasx authored and weitzman committed Mar 24, 2024
1 parent ac2817a commit d3d3e31
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/site-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ is really nothing more than a collection of options.
- **service**: the name of the container to run on.
- **exec**:
- **options**: Options for the exec subcommand.
- **kubectl** When specified, Drush executes via `kubectl` exec rather than `ssh`.
- **namespace** The namespace to execute the command in.
- **resource** The k8s object to execute the command on.
- **container** The container in the resource to execute the command on.
- **os**: The operating system of the remote server. Valid values
are _Windows_ and _Linux_. Set this value for all remote
aliases where the remote's OS differs from the local. This is especially relevant
Expand Down Expand Up @@ -233,7 +237,7 @@ does not exist (e.g. if the user made a typo). An alias alter hook in a
policy file may be used to catch these mistakes and report an error.
See [SiteAliasAlterCommands](https://www.drush.org/latest/examples/SiteAliasAlterCommands.php/) for an example on how to do this.

### Docker Compose and other transports
### Docker Compose

The example below shows drush calling into a Docker hosted site. See the https://github.com/consolidation/site-alias and https://github.com/consolidation/site-process projects for more developer
information about transports.
Expand Down Expand Up @@ -267,6 +271,26 @@ dev:
uri: https://dev.example.com
```

### Kubernetes

Drush provides transport for running drush commands on your Kubernetes cluster via [kubectl](https://kubernetes.io/docs/reference/kubectl/). See an example and options below.

```yml
prod:
kubectl:
namespace: 'my-drupal-namespace'
resource: 'pods/my-drupal-pod'
container: 'drupal'
```

#### Key options
* **namespace:** The namespace where your Drupal deployment resides.
* **resource:** Kubernetes resource type (usually 'pods').
* **container:** The specific container within the pod where Drupal runs.
* **kubeconfig:** The kubeconfig file to use for authentication.
* **entrypoint:** The command to use as the container entrypoint.


### Example of rsync with exclude-paths

Note that most options typically passed to rsync via `drush rsync` are
Expand Down

0 comments on commit d3d3e31

Please sign in to comment.