-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error marshaling MachineConfigurationInput #80
Comments
Yep, you're in the right spot! At a glance your program looks fine, but I'll be honest I haven't actually used the YAML provider yet so the semantics are a little unfamiliar. I'll see if I can re-produce locally. I assume in your actual program you've replaced |
Thank you for your swift reply. No, I actually just used the default values (I did not know exactly which values to use, so I expected I could work through it fixing one thing at a time).
|
Happy New Years 😄 I've done a bit of additional debugging. The following is a complete program that attempts to standup a Talos controlplane node on a VM in Azure:
When I run this program, I get the following output:
This is with the v0.2.0 of the Talos provider (I also tried v0.1.8, same result). The specific property that triggers the error varies from each run, but it always seems to be one of those that prints as an empty map in the |
Happy new year! Sorry for the delay, I took a look before the holidays but didn't get very far. I'm able to reproduce, and it seems like something is failing to create the Going out on a limb, the I double-checked with the typescript SDK and that's still working fine. You could try a different SDK in the meantime while we work this out. You could also try populating the secrets yourself. The Sidero guys made a pretty nice API where you can just I'm still learning the YAML sdk so my code is a little jank, but it would look something like this: configuration:
fn::invoke:
function: talos:machine/getConfiguration:getConfiguration
arguments:
clusterName: "exampleCluster"
machineType: "controlplane"
clusterEndpoint: "https://cluster.local:6443"
machineSecrets:
certs:
etcd:
cert: ${secrets.machineSecrets.certs.etcd.cert}
key: ${secrets.machineSecrets.certs.etcd.key}
k8s:
cert: ${secrets.machineSecrets.certs.k8s.cert}
key: ${secrets.machineSecrets.certs.k8s.key}
k8s_aggregator:
cert: ${secrets.machineSecrets.certs.k8s_aggregator.cert}
key: ${secrets.machineSecrets.certs.k8s_aggregator.key}
k8s_serviceaccount:
key: ${secrets.machineSecrets.certs.k8s_serviceaccount.key}
os:
cert: ${secrets.machineSecrets.certs.os.cert}
key: ${secrets.machineSecrets.certs.os.key}
cluster:
id: ${secrets.machineSecrets.cluster.id}
secret: ${secrets.machineSecrets.cluster.secret}
secrets:
bootstrapToken: ${secrets.machineSecrets.secrets.bootstrap_token}
secretboxEncryptionSecret: ${secrets.machineSecrets.secrets.secretbox_encryption_secret}
trustdinfo:
token: ${secrets.machineSecrets.trustdinfo.token}
return: machineConfiguration To get certs for testing (or use if you so desire) you can use the pulumi TLS package key:
type: tls:index/privateKey:PrivateKey
properties:
rsaBits: 256
algorithm: ECDSA
cert:
type: tls:index/selfSignedCert:SelfSignedCert
properties:
allowedUses: ['any_extended']
privateKeyPem: ${key.privateKeyPem}
validityPeriodHours: 60 |
Updated sample, this one runs at least. name: pulumi-talos-80-repro
runtime: yaml
description: A minimal Pulumi YAML program
variables:
configuration:
fn::invoke:
function: talos:machine/getConfiguration:getConfiguration
arguments:
clusterName: "exampleCluster"
machineType: "controlplane"
clusterEndpoint: "https://cluster.local:6443"
machineSecrets:
certs:
etcd:
cert: ${secrets.machineSecrets.certs.etcd.cert}
key: ${secrets.machineSecrets.certs.etcd.key}
k8s:
cert: ${secrets.machineSecrets.certs.k8s.cert}
key: ${secrets.machineSecrets.certs.k8s.key}
k8sAggregator:
cert:
fn::toBase64: ${cert.certPem}
key:
fn::toBase64: ${key.privateKeyPem}
k8sServiceaccount:
key:
fn::toBase64: 'somekey'
os:
cert: ${secrets.machineSecrets.certs.os.cert}
key: ${secrets.machineSecrets.certs.os.key}
cluster:
id: ${secrets.machineSecrets.cluster.id}
secret: ${secrets.machineSecrets.cluster.secret}
secrets:
bootstrapToken:
fn::toBase64: 'sometoken'
secretboxEncryptionSecret:
fn::toBase64: 'somesecret'
trustdinfo:
token: ${secrets.machineSecrets.trustdinfo.token}
return: machineConfiguration
resources:
secrets:
type: talos:machine/secrets:Secrets
key:
type: tls:index/privateKey:PrivateKey
properties:
rsaBits: 256
algorithm: ECDSA
cert:
type: tls:index/selfSignedCert:SelfSignedCert
properties:
allowedUses: ['any_extended']
privateKeyPem: ${key.privateKeyPem}
validityPeriodHours: 60
# configurationApply:
# type: talos:machine/configurationApply:ConfigurationApply
# properties:
# clientConfiguration: ${secrets.clientConfiguration}
# machineConfigurationInput: ${configuration}
# node: "10.5.0.2"
# configPatches:
# - fn::toJSON:
# machine:
# install:
# disk: "/dev/sdd"
# bootstrap:
# type: talos:machine:Bootstrap
# properties:
# node: "10.5.0.2"
# clientConfiguration: ${secrets.clientConfiguration}
# options:
# dependsOn:
# - ${configurationApply}
outputs:
secrets: ${secrets.machineSecrets}
# config: ${configuration}
pem: ${cert.certPem}
pem64:
fn::toBase64: ${cert.certPem} |
Thank you very much for the example, it is very useful. While testing your example, I found a potentially-related issue: properties that have an underscore in their name, e.g. I tested it with a few variations:
I don't know if this is related to the original issue, but I just wanted to call it out. |
In regards to the underscores, I believe that is an issue with Pulumi logging. When you write your program, you shouldn't have underscores. I'll see if there is an existing issue in the Pulumi repo, I think that problem has been around for a while :) |
I'm not sure if its related, but I was able to get a similar underscore problem in a TS pulumi program. I think something is mixed up with the property naming. |
It looks like the Python pulumi program has a similar issue (ie. property naming, and camelcase/underscore mismatch):
Inspection of the secret (generated with
Inspecting a manually generated |
Python program:
Results in:
|
I've done some more testing and am pretty confident the properties need to be renamed. I was hoping to get some integration tests added first to be more confident in the fix, and I've got those in a branch. I should be able to get a branch up eventually for the actual rename fix |
I think this is an issue in the code generation for the SDKs when using |
Hello 👋 New user of Talos and Pulumi here. I hope I am creating this issue in the right place - if not, please point me to where it should be.
My goal is to use Pulumi to provision a Talos cluster on VM's running in Azure. Right now I have provisioned a single VM (and all the related Azure resources), and the VM uses the Talos Linux 1.6.0 disk image in the community gallery. I want this VM to act as a control plane node.
I am working from the example in the Pulumi registry (https://www.pulumi.com/registry/packages/talos/), with the YAML engine. Just copy/pasting that YAML and running
pulumi up
gives me this error:My Pulumi program looks like this:
Let me know if you need more context/logging.
The text was updated successfully, but these errors were encountered: