Skip to content

ComputeInstance using Windows images will error resolving externally-managed fields #524

Closed

Description

@tonybenchsci

Checklist

Bug Description

KCC can be used to create GCP ComputeInstance VMs with Windows Server images. In order to RDP, there needs to be users created first, which GCP supports via the "Set Windows Password" button. Doing this (it seems like the first user is fine, but more than 1 will fail, but not 100% sure) however, creates a state of UpdateFailed

It seems like KCC needs to let this field "float" i.e. be managed be GCP, or parse it as a map instead of a list and save as string(?), or as a workaround (we haven't tried yet) the user needs a round-trip to re-acquire the GCP generated configs under spec.metadata.[]

Kubernetes Cluster Version

1.19.11-gke.2101

Config Connector Version

1.49.0

Config Connector Mode

cluster

Log Output

Update call failed: error expanding resource configuration: error resolving externally-managed fields: error converting state to typed value: .metadata: expected list, got &{map[windows-keys:{"expireOn":"2021-07-30T00:20:13.267Z","userName":"alice","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}
      {"expireOn":"2021-07-30T00:23:08.573Z","userName":"bob","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}
      {"expireOn":"2021-07-30T00:24:14.715Z","userName":"charlie","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}]}
    

Steps to Reproduce

Steps to reproduce the issue

  1. Use KCC to create the ComputeInstance
  2. Use the GCP console to "Set Windows Password" to create a few login users
  3. Observe KCC reconcile state

YAML snippets

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstance
metadata:
  name: windows
spec:
  machineType: e2-medium
  zone: us-east4-a
  serviceAccount:
    serviceAccountRef:
      name: windows
    scopes:
    - storage-ro
  networkInterface:
  - networkRef:
      name: default
    accessConfig:
    - networkTier: PREMIUM
  bootDisk:
    initializeParams:
      sourceImageRef:
        external: projects/windows-cloud/global/images/windows-server-2019-dc-v20210713
  metadataStartupScript: |
    Write-Host 'Hello, World! This is a Windows VM'
  tags:
  - windows-eln

Activity

  1. tonybenchsci commented on Aug 6, 2021

    @tonybenchsci
    Author

    Update: The workaround of another round-trip to re-acquire the GCP generated configs under spec.metadata.[key="windows-keys",value="long string"] managed to move the state back to UpToDate

  2. jcanseco commented on Aug 12, 2021

    @jcanseco
    Member

    Thank you @tonybenchsci for providing a workaround and an update. It helps us understand the problem more easily and helps other users as well!

    I can confirm that I am able to reproduce the issue consistently, and that we should have a fix out within the next 2 releases.

  3. jcanseco commented on Aug 28, 2021

    @jcanseco
    Member

    Hi @tonybenchsci, can you try the latest KCC version and see if the issue has been fixed? We put out a bug fix in KCC 1.59.0.

    Closing this issue now, but please feel free to add a comment if you find that the issue still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址