You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/07/05 11:05:34 UTC

[GitHub] [brooklyn-docs] algairim commented on a diff in pull request #360: Added documentation for ContainerSensor and ContainerEffector

algairim commented on code in PR #360:
URL: https://github.com/apache/brooklyn-docs/pull/360#discussion_r913671489


##########
guide/blueprints/effectors.md:
##########
@@ -52,6 +52,114 @@ Here is a simple example of an `SshCommandEffector` definition:
 
 See [`here`](https://brooklyn.apache.org/v/latest/misc/javadoc/org/apache/brooklyn/core/effector/ssh/SshCommandEffector.html) for more details.
 
+### ContainerEffector
+
+An `Effector` to invoke a command or (a list of commands) on a container node accessible via `kubectl`. This obviously means access to a Kubernetes cluster must be ensured and `kubectl` must be installed where Apache Brooklyn runs. This effector is defined in the blueprint to be added to the entity using Apache Brooklyn initializers.
+
+It enables execution of a `command` in a specific container managed by a Kubernetes cluster. _Under the bonnet_ the commands and other configurations are used to generate a Kubernetes job that will execute in its own namespace. Regardless of the job execution result (success or failure) the namespace is deleted at the end, unless configured otherwise. 
+
+There are a number of configuration keys available for the `ContainerEffector`:
+
+| Configuration Key     | Default | Description                                                                                                                                                                                                                           |
+|-----------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| image                 |         | Docker image name, the container will be created from. (mandatory)                                                                                                                                                                    |
+| imagePullPolicy       | `Always` | Possible values: `IfNotPresent`, `Always`, `Never`. Same values from the Kubernetes official documentation, the only advantage is that Apache Brooklyn is case insensitive. So, for example 'NEVER` and `never` are accepted as well. |
+| containerName         |         | The name Kubernetes will give to the container. If not provided, it will be generated from the image name, the entity ID and a random string.                                                                                         |
+| keepContainerForDebug | `false` | When set to true, the namespace" and associated resources and services are not destroyed after execution, thus allowing access to the container for in-dept debugging.                                                                |
+| commands              |         | A list of commands to execute on the container.                                                                                                                                                                                       |
+| args                  |         | If the container is declared with an `ENTRYPOINT`, you might want to provide only arguments for the default command configured by the container.                                                                                      |
+| timeout               | `5m`    | How much should Kubernetes wait before considering a job to be failed and mark the container as failed as well.                                                                                                                       |

Review Comment:
   Default is 1 minute.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org