siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.93k stars 557 forks source link

Problems to edit config files #4599

Closed uhlhosting closed 2 years ago

uhlhosting commented 3 years ago

Bug Report

Config files are not always editable

Description

Node Dmesg user: warning: [2021-11-26T15:06:23.120709182Z]: [talos] apply config request: immediate false, on reboot false

Local terminal

cosmic@Revenger ~/.talos % talosctl -n 172.18.100.59 edit machineconfig
cosmic@Revenger ~/.talos % talosctl -n 172.18.100.68 edit machineconfig
cosmic@Revenger ~/.talos % talosctl -n 172.18.100.67 edit machineconfig
Apply was skipped: no changes detected.
cosmic@Revenger ~/.talos % talosctl -n 172.18.100.68 edit machineconfig
Apply was skipped: no changes detected.
cosmic@Revenger ~/.talos % talosctl -n 172.18.100.59 edit machineconfig
Apply was skipped: no changes detected.
cosmic@Revenger ~/.talos % 

Logs

Reply after :wq applied on above runned commands.

# Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.67
#
# 1 error occurred:
#       * 172.18.100.67: rpc error: code = Unknown desc = failed to parse config: decode error: yaml: line 6: did not find expected key
#
#

# Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.59
#
# 1 error occurred:
#       * 172.18.100.59: rpc error: code = Unknown desc = failed to parse config: unknown keys found during decoding:

# Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.68
#
# 1 error occurred:
#       * 172.18.100.68: rpc error: code = Unknown desc = failed to parse config: unknown keys found during decoding:

Environment

smira commented 3 years ago

I'm not sure what the issue is here? Talos doesn't accept invalid machine configuration, but what is specifically wrong?

uhlhosting commented 3 years ago

@smira I have followed the video to add Mayastor storage

and I wanted to add the following to the config:

    # The `extraArgs` field is used to provide additional flags to the kubelet.
    extraArgs:
       node-labels: openebs.io/engine=mayastor

    # The `extraMounts` field is used to add additional mounts to the kubelet container.
    extraMounts:
        - destination: /var/local
          type: bind
          source: /var/local
          options:
            - rbind
            - rshared
            - rw
---- Error ----
# Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.68
#
# 1 error occurred:
#       * 172.18.100.68: rpc error: code = Unknown desc = failed to parse config: unknown keys found during decoding:
# machine:
#     extraArgs:
#         node-labels: openebs.io/engine=mayastor
#
#
#
# Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.68
#
# 1 error occurred:
#       * 172.18.100.68: rpc error: code = Unknown desc = failed to parse config: unknown keys found during decoding:
# machine:
#     extraMounts:
#         - destination: /var/local
#           options:
#             - rbind
#             - rshared
#             - rw
#           source: /var/local
#           type: bind
#
#
#

I am not sure where the issues are, or how to know what is wrong in the config when its not shown.

smira commented 3 years ago

These values should be under . machine.kubelet, not under .machine

uhlhosting commented 3 years ago

How about this error?

Editing MachineConfigs.config.talos.dev/v1alpha1 at node 172.18.100.32

#

1 error occurred:

* 172.18.100.32: rpc error: code = Unknown desc = failed to parse config: decode error: yaml: line 6: did not find expected key

# #

I still would appreciate to see a few working examples of these configs, in this way could avoid such endless error loops, that if is not the location on file, then its the lines that makes no sense like the one above.

smira commented 2 years ago

I think the error is self-explanatory: YAML is not valid on line number 6. My guess is broken indentation, but :man_shrugging:

smira commented 2 years ago

Example documentation is provided inline as comments, extensive documentation is available on https://www.talos.dev/ in the Configuration reference.