Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use ExtensionServiceConfig document. #320

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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