Skip to content

Commit

Permalink
feat: use ExtensionServiceConfig document.
Browse files Browse the repository at this point in the history
Use `ExtensionServiceConfig` document for extensions using
`.machine.files` or `environmentFile`.

Ref: siderolabs/talos#8273

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Feb 15, 2024
1 parent fbaefd5 commit 9daf0f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
30 changes: 15 additions & 15 deletions network/tailscale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ See [Installing Extensions](https://github.com/siderolabs/extensions#installing-

## Usage

Configure the extension via `ExtensionServiceConfig` document.

```yaml
machine:
files:
- content: |
TS_AUTHKEY=<your auth key>
permissions: 0o644
path: /var/etc/tailscale/auth.env
op: create
---
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: tailscale
environment:
- TS_AUTHKEY=<your auth key>
```
```bash
Expand Down Expand Up @@ -52,14 +53,13 @@ Current known env vars are:

A pratical example is enabling subnetrouting
```
machine:
files:
- content: |
TS_AUTHKEY=<your auth key>
TS_ROUTES=10.96.0.0/12
permissions: 0o644
path: /var/etc/tailscale/auth.env
op: create
---
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: tailscale
environment:
- TS_AUTHKEY=<your auth key>
- TS_ROUTES=10.96.0.0/12
```

10.96.0.0/12 is the service subnet talos uses by default (if you use a custom one, you will need to change it).
Expand Down
2 changes: 1 addition & 1 deletion network/tailscale/tailscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ depends:
- addresses
- connectivity
- etcfiles
- configuration: true
container:
entrypoint: /usr/local/bin/containerboot
environmentFile: /var/etc/tailscale/auth.env
environment:
- PATH=/sbin:/usr/local/bin
- TS_SOCKET=/var/run/tailscale/tailscaled.sock
Expand Down
16 changes: 8 additions & 8 deletions power/nut-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ See [Installing Extensions](https://github.com/siderolabs/extensions#installing-

## Usage

Configure the extension via `.machine.files`.
Configure the extension via `ExtensionServiceConfig` document.
You must replace upsmonHost and upsmonPasswd to match configuration on your nut server.
See [upsd.users](https://networkupstools.org/docs/man/upsd.users.html) man page for details.

On Talos SHUTDOWNCMD must be `/sbin/poweroff`

```yaml
machine:
files:
- path: /var/etc/nut/upsmon.conf
permissions: 0o600
op: create
content: |-
---
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: nut-client
configFiles:
- content: |-
MONITOR ${upsmonHost} 1 remote ${upsmonPasswd} slave
SHUTDOWNCMD "/sbin/poweroff"
mountPath: /usr/local/etc/nut/upsmon.conf
```
## Testing
Expand Down
8 changes: 1 addition & 7 deletions power/nut-client/nut-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ depends:
- connectivity
- etcfiles
- path: /system/run/machined/machine.sock
- configuration: true
container:
entrypoint: ./upsmon
args:
Expand All @@ -24,13 +25,6 @@ container:
options:
- bind
- ro
# Configuration provided via `.machine.files`.
- source: /var/etc/nut
destination: /usr/local/etc/nut
type: bind
options:
- bind
- ro
# `/sbin/init` talks to `machined`.
- source: /system/run/machined/machine.sock
destination: /system/run/machined/machine.sock
Expand Down

0 comments on commit 9daf0f9

Please sign in to comment.