Skip to content

Commit

Permalink
Update info
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed May 6, 2024
1 parent 40c022d commit 1be6d76
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Talm

Just like Helm, but for Talos Linux
Manage Talos the GitOps Way!

Talm is just like Helm, but for Talos Linux

## Installation

Expand Down Expand Up @@ -30,6 +32,7 @@ talm -n 1.2.3.4 -e 1.2.3.4 template -t templates/controlplane.yaml -i > nodes/no

Edit `templates/node1.yaml` file:
```yaml
# talm: nodes=["1.2.3.4"], endpoints=["1.2.3.4"], templates=["templates/controlplane.yaml"]
machine:
network:
# -- Discovered interfaces:
Expand Down Expand Up @@ -81,3 +84,45 @@ Apply config:
```bash
talm apply -f nodes/node1.yaml -i
```

Upgrade node:
```bash
talm upgrade -f nodes/node1.yaml
```

Show diff:
```bash
talm apply -f nodes/node1.yaml --dry-run
```

Re-template and update generated file in place (this will overwrite it):
```
talm template -f nodes/node1.yaml -I
```

## Customization

You're free to edit template files in `./templates` directory.

All the [Helm](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/) and [Sprig](https://masterminds.github.io/sprig/) functions are supported, including lookup for talos resources!

Lookup function example:

```helm
{{ lookup "nodeaddresses" "network" "default" }}
```

\- is equiualent to:

```bash
talosctl get nodeaddresses --namespace=network default
```


Querying disks map example:

```helm
{{ range .Disks }}{{ if .system_disk }}{{ .device_name }}{{ end }}{{ end }}
```

\- will return the system disk device name
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var Version = "dev"
// rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{
Use: "talm",
Short: "Just like Helm, but for Talos Linux",
Short: "Manage Talos the GitOps Way!",
Long: ``,
Version: Version,
SilenceErrors: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func generateOutput(ctx context.Context, c *client.Client, args []string) (strin
func init() {
templateCmd.Flags().BoolVarP(&templateCmdFlags.insecure, "insecure", "i", false, "template using the insecure (encrypted with no auth) maintenance service")
templateCmd.Flags().StringSliceVarP(&templateCmdFlags.configFiles, "file", "f", nil, "specify config files for in-place update (can specify multiple)")
templateCmd.Flags().BoolVarP(&templateCmdFlags.inplace, "in-place", "I", false, "update generated files in place")
templateCmd.Flags().BoolVarP(&templateCmdFlags.inplace, "in-place", "I", false, "re-template and update generated files in place (overwrite them)")
templateCmd.Flags().StringSliceVarP(&templateCmdFlags.valueFiles, "values", "", []string{}, "specify values in a YAML file (can specify multiple)")
templateCmd.Flags().StringSliceVarP(&templateCmdFlags.templateFiles, "template", "t", []string{}, "specify templates to render manifest from (can specify multiple)")
templateCmd.Flags().StringArrayVar(&templateCmdFlags.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
Expand Down

0 comments on commit 1be6d76

Please sign in to comment.