You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Restarts on grafloki start over k8s were not working because of the way
the not found error was being handled. This change returns a nil object
if a deployment isn't found by k8s instead of returning an error.
Copy file name to clipboardExpand all lines: docs/docs/cli-reference/service-add.md
+20-2
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,13 @@ To add a service to an enclave, run:
10
10
kurtosis service add $THE_ENCLAVE_IDENTIFIER$THE_SERVICE_IDENTIFIER$CONTAINER_IMAGE
11
11
```
12
12
13
-
where `$THE_ENCLAVE_IDENTIFIER` and the `$THE_SERVICE_IDENTIFIER` are [resource identifiers](../advanced-concepts/resource-identifier.md) for the enclave and service, respectively.
13
+
where `$THE_ENCLAVE_IDENTIFIER` and the `$THE_SERVICE_IDENTIFIER` are [resource identifiers](../advanced-concepts/resource-identifier.md) for the enclave and service, respectively.
14
14
Note, the service identifier needs to be formatted according to RFC 1035. Specifically, 1-63 lowercase alphanumeric characters with dashes and cannot start or end with dashes. Also service names
15
-
have to start with a lowercase alphabet.
15
+
have to start with a lowercase alphabet.
16
16
17
17
Much like `docker run`, this command has multiple options available to customize the service that's started:
18
18
19
+
1. The `--cmd` flag can be used to override the default command that the container runs
19
20
1. The `--entrypoint` flag can be passed in to override the binary the service runs
20
21
1. The `--env` flag can be used to specify a set of environment variables that should be set when running the service
21
22
1. The `--ports` flag can be used to set the ports that the service will listen on
@@ -25,3 +26,20 @@ To override the service's CMD, add a `--` after the image name and then pass in
25
26
```bash
26
27
kurtosis service add --entrypoint sh my-enclave test-service alpine -- -c "echo 'Hello world'"
27
28
```
29
+
30
+
Alternatively, if you have an existing service config in JSON format (for example, one that was output using `kurtosis service inspect`), you can use the `--json-service-config` flag to add a service using that config:
31
+
32
+
```bash
33
+
kurtosis service add my-enclave test-service --json-service-config ./my-service-config.json
34
+
```
35
+
36
+
To read the JSON config from stdin, use:
37
+
38
+
```bash
39
+
kurtosis service add my-enclave test-service --json-service-config - < ./my-service-config.json
40
+
```
41
+
42
+
:::note Override
43
+
When using `--json-service-config`, the standard flags and args like `--image`, `--cmd`, `--entrypoint`, `--env`, and `$CONTAINER_IMAGE` will be ignored in favor of the provided config.
kurtosis service update $THE_ENCLAVE_IDENTIFIER$THE_SERVICE_IDENTIFIER [flags]
11
+
```
12
+
13
+
where `$THE_ENCLAVE_IDENTIFIER` and `$THE_SERVICE_IDENTIFIER` are [resource identifiers](../advanced-concepts/resource-identifier.md) for the enclave and service, respectively.
14
+
15
+
This command updates a service in-place by modifying its configuration. Only the specified parameters will be changed — the rest of the service config will remain as-is.
16
+
17
+
Much like `docker run`, this command has multiple options available to customize the updated service:
18
+
19
+
1. The `--image` flag can be used to update the service’s container image
20
+
1. The `--entrypoint` flag can override the binary the service runs
21
+
1. The `--env` flag can be used to set or override environment variables. Env var overrides with the same key will override existing env vars.
22
+
1. The `--ports` flag can be used to add or override private port definitions. Port overrides with the same port id will override existing port bindings.
23
+
1. The `--files` flag can be used to mount new file artifacts. Files artifacts overrides with the same key will override existing files artifact mounts.
24
+
1. The `--cmd` flag can be used to override the CMD that is run when the container starts
25
+
26
+
Example:
27
+
28
+
```bash
29
+
kurtosis service update my-enclave test-service \
30
+
--image my-custom-image \
31
+
--entrypoint my-binary \
32
+
--env "FOO:bar,BAR:baz" \
33
+
--ports "port1:8080/tcp"
34
+
```
35
+
36
+
:::note Restarted Container
37
+
This command replaces the existing service with a new container using the updated configuration. The service will be briefly stopped and restarted as part of this process.
0 commit comments