Uploaded image for project: 'OpenShift Windows Containers'
  1. OpenShift Windows Containers
  2. WINC-1575

Migrate MachineSet Templates to Origin

XMLWordPrintable

    • None
    • None
    • None

      Overview

      As part of the OTE migration (WINC-1536), migrate MachineSet and autoscaler templates from openshift-tests-private to the openshift/origin repository. This enables WINC tests to provision Windows nodes across different cloud platforms using shared, versioned templates.

      Blocked

      BLOCKED BY WINC-1508 - Do not start until MachineSet template issues are resolved

      Background

      Current State (OTP):

      • 6 template files in openshift-tests-private/test/extended/testdata/winc/
        • 4 Windows MachineSet templates (AWS, Azure, GCP, Nutanix)
        • 2 autoscaler templates (machine-autoscaler, cluster_autoscaler)
      • Templates use <placeholder> syntax
      • Templates scattered across OTP

      Problem:

      • Templates need to be in origin for OTE compatibility
      • WINC-1508 tracks issues with current templates
      • Platform-specific complexity requires careful migration

      Target State (Origin):

      • All 6 MachineSet/autoscaler templates in openshift/origin/test/extended/testdata/winc/
      • Helper functions for MachineSet provisioning
      • Platform-specific documentation

      Scope

      This story includes:

      • Resolve WINC-1508 blockers - Fix issues with MachineSet templates
      • Migrate 6 template files to origin
        • 4 Windows MachineSet templates
        • 2 autoscaler templates
      • Create helper functions in origin/test/extended/util/compat_otp/
        • MachineSetConfig struct
        • RenderMachineSet() function
        • RenderMachineAutoscaler() function
        • RenderClusterAutoscaler() function
      • Platform-specific documentation
      • Validation on all supported platforms

      Supported Platforms:

      • AWS (Windows)
      • Azure (Windows)
      • GCP (Windows)
      • Nutanix (Windows)

      Files to Migrate (6 files)

      Windows MachineSet Templates (4 files):

      • aws_windows_machineset.yaml - AWS Windows node provisioning
      • azure_windows_machineset.yaml - Azure Windows node provisioning
      • gcp_windows_machineset.yaml - GCP Windows node provisioning
      • nutanix_windows_machineset.yaml - Nutanix Windows node provisioning

      Autoscaler Templates (2 files):

      • machine-autoscaler.yaml - Machine-level autoscaling
      • cluster_autoscaler.yaml - Cluster-level autoscaling

      Implementation Plan

      Step 1: Resolve WINC-1508 Blockers

      Prerequisites:

      • Review WINC-1508 Jira ticket for specific issues
      • Identify which MachineSet templates have problems
      • Fix or document workarounds for identified issues
      • Get sign-off that MachineSets are ready for migration

      Common issues to check:

      • Incorrect placeholder names
      • Missing required fields for platform APIs
      • Outdated API versions
      • Platform-specific configuration errors

      Step 2: Migrate Templates to Origin

      Location: openshift/origin/test/extended/testdata/winc/

      Copy all 11 template files to origin repository.

      Step 3: Create Helper Functions

      Location: openshift/origin/test/extended/util/compat_otp/machineset_helpers.go

      Create:

      • MachineSetConfig struct with platform-specific fields
      • RenderMachineSet() function
      • RenderMachineAutoscaler() function
      • RenderClusterAutoscaler() function
      • Platform constants (PlatformAWS, PlatformAzure, etc.)

      Step 4: Validate on All Platforms

      Test MachineSet provisioning on:

      • AWS
      • Azure
      • GCP
      • Nutanix

      Step 5: Documentation

      Update README.md with:

      • MachineSet template usage
      • Platform-specific requirements
      • Example configurations

      Acceptance Criteria

      Blockers Resolved

      • [ ] WINC-1508 resolved and signed off
      • [ ] All MachineSet template issues fixed

      Migration Complete

      • [ ] 4 Windows MachineSet templates migrated to origin/test/extended/testdata/winc/
      • [ ] 2 autoscaler templates migrated to origin
      • [ ] All templates use <placeholder> syntax (not Go templates)

      Helper Code

      • [ ] machineset_helpers.go created in origin/test/extended/util/compat_otp/
      • [ ] MachineSetConfig struct created with platform-specific fields
      • [ ] RenderMachineSet() function created
      • [ ] RenderMachineAutoscaler() function created
      • [ ] RenderClusterAutoscaler() function created
      • [ ] Platform constants defined (PlatformAWS, PlatformAzure, PlatformGCP, PlatformNutanix)

      Validation

      • [ ] YAML syntax validated for all 6 files
      • [ ] Templates tested on AWS
      • [ ] Templates tested on Azure
      • [ ] Templates tested on GCP (if available)
      • [ ] Templates tested on Nutanix (if available)
      • [ ] Go code compiles successfully

      Documentation

      • [ ] README.md updated with MachineSet documentation
      • [ ] Platform-specific requirements documented
      • [ ] Example configurations provided for each platform
      • [ ] OWNERS file exists with WINC team owners

      Delivery

      • [ ] PR submitted to openshift/origin repository
      • [ ] PR reviewed by platform SMEs (AWS, Azure, GCP, Nutanix)
      • [ ] PR merged

      Dependencies

      Blocked by: WINC-1508 - Resolve MachineSet template issues

      {warning}Do NOT start this story until WINC-1508 is completely resolved and signed off{warning}

      Blocks

      None - This story is independent (does not block other work)

      Risks and Mitigations

      Risks

      • WINC-1508 timeline unknown - Cannot predict when work can start
      • Platform-specific complexity - 4 different cloud platforms with different APIs
      • Incorrect placeholders could break node provisioning
      • Each platform has different required fields
      • Autoscaler configuration is complex
      • Limited access to some platforms (Nutanix) for testing

      Mitigations

      • Wait for WINC-1508 complete resolution before starting
      • Review each platform's MachineSet API requirements
      • Test MachineSet provisioning on each platform
      • Document platform-specific requirements clearly
      • Get review from platform SMEs (AWS, Azure, GCP, Nutanix)
      • Keep autoscaler templates simple initially
      • Use platform-specific documentation as reference

      Platform-Specific Notes

      AWS

      • Requires AMI ID for Windows image
      • Instance type must support Windows (m5.large, m5.xlarge, etc.)
      • VPC and subnet configuration
      • IAM role requirements

      Azure

      • Requires Azure VM image reference
      • VM size must support Windows (Standard_D4s_v3, etc.)
      • Resource group and network configuration
      • Managed identity configuration

      GCP

      • Requires GCP image reference or family
      • Machine type must support Windows (n1-standard-4, etc.)
      • Network and subnet configuration
      • Service account requirements

      Nutanix

      • Requires Nutanix image UUID
      • VM configuration (CPU, memory, storage)
      • Nutanix cluster and network configuration

      Example Usage

      Create AWS MachineSet

      import compat_otp "github.com/openshift/origin/test/extended/util/compat_otp"
      
      config := &compat_otp.MachineSetConfig{
          Platform:       compat_otp.PlatformAWS,
          MachineSetName: "winc-test-machineset",
          Region:         "us-east-1",
          Zone:           "us-east-1a",
          InstanceType:   "m5.large",
          ImageID:        "ami-0abcdef1234567890",
          WindowsVersion: "2022",
      }
      
      manifest, err := compat_otp.RenderMachineSet(config)
      // Apply manifest...
      

      Enable Autoscaling

      autoscaler, err := compat_otp.RenderMachineAutoscaler(
          "winc-test-machineset",
          1,  // min replicas
          10, // max replicas
      )
      

      Verification Steps

      1. Verify WINC-1508 Resolved

      # Check Jira status
      jira issue view WINC-1508
      # Should show: Status = Resolved or Closed
      

      2. Verify Files Migrated

      cd openshift/origin/test/extended/testdata/winc/
      ls -la *machineset.yaml *autoscaler.yaml | wc -l
      # Should show 6 files
      

      3. Verify Helper Code Exists

      cd openshift/origin/test/extended/util/compat_otp/
      ls -la machineset_helpers.go
      # Should exist
      

      4. Verify Code Compiles

      cd openshift/origin
      go build ./test/extended/util/compat_otp/...
      # Should compile without errors
      

      5. Verify Placeholder Syntax

      cd openshift/origin/test/extended/testdata/winc/
      grep -r '<[a-z_]*>' *machineset.yaml
      # Should show placeholders like <machineset_name>, <region>, etc.
      

      Story Points Breakdown

      • WINC-1508 resolution verification: 2 points
      • File migration (6 files): 1 point
      • Helper functions and config struct: 3 points
      • Platform-specific documentation: 1 point
      • Testing and verification: 1 point

      Total: 8 story points

      Definition of Done

      • WINC-1508 completely resolved
      • All 6 templates migrated to origin
      • Helper functions implemented and tested
      • Platform-specific documentation complete
      • Code compiles successfully
      • Templates validated on at least 2 platforms
      • PR reviewed by platform SMEs
      • PR merged to origin

      Notes

      • Blocked by WINC-1508 - Cannot start until resolved
      • Platform diversity - 4 different cloud platforms with different APIs
      • Autoscaler integration - Machine autoscaler and cluster autoscaler must work together
      • Keep <placeholder> syntax - These are NOT Go templates (unlike Windows workload story)
      • Migration to origin - Templates go to origin repo for OTE compatibility
      • Independent story - Does not block other work

      Why Not Go Templates?

      Unlike the Windows workload story, MachineSet templates remain as static YAML files with <placeholder> syntax because:

      • Platform diversity - Each platform has completely different structure (not just minor variations)
      • Low duplication - Only 4 MachineSet templates (one per platform)
      • Simpler maintenance - Platform-specific templates are easier to maintain separately
      • Limited reuse - Tests typically use one platform at a time
      • Future consolidation - Could be refactored to Go templates in a future story if duplication increases

      The <placeholder> approach works well here and aligns with existing OpenShift test patterns.

              Unassigned Unassigned
              rrasouli Aharon Rasouli
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: