report

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package report provides markdown formatting for K8s migration reports

Package report provides NLB section markdown formatting for migration reports

Package report provides migration report markdown formatting

Package report provides migration report generation logic for K8s infrastructure

Package report provides NLB migration matching and analysis logic

Package report provides migration report generation logic

Package report provides migration report data models

Package report provides migration report data models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateK8sMigrationReportMarkdown added in v0.6.2

func GenerateK8sMigrationReportMarkdown(report *K8sMigrationReport) string

GenerateK8sMigrationReportMarkdown produces a comprehensive markdown report for K8s migration.

func GenerateMigrationReportMarkdown

func GenerateMigrationReportMarkdown(report *MigrationReport) string

GenerateMigrationReportMarkdown generates a markdown formatted migration report

Types

type ComponentCost

type ComponentCost struct {
	ComponentName  string  `json:"componentName" example:"cm-nfs (migrated)"`
	SpecName       string  `json:"specName" example:"c5a.2xlarge"`
	MonthlyCost    float64 `json:"monthlyCost" example:"247.68"`
	CostPercentage float64 `json:"costPercentage" example:"64.8"`
}

ComponentCost represents cost for a single component

type CostSummary

type CostSummary struct {
	TotalHourlyCost  float64         `json:"totalHourlyCost" example:"0.5312"`
	TotalDailyCost   float64         `json:"totalDailyCost" example:"12.75"`
	TotalMonthlyCost float64         `json:"totalMonthlyCost" example:"382.46"`
	TotalYearlyCost  float64         `json:"totalYearlyCost" example:"4589.52"`
	CostByComponent  []ComponentCost `json:"costByComponent"`
}

CostSummary contains cost analysis summary

type ExcludedWorkerItem added in v0.6.2

type ExcludedWorkerItem struct {
	Hostname string `json:"hostname" example:"k8s-master-01"`
	Role     string `json:"role" example:"control-plane"`
	Reason   string `json:"reason" example:"Control-plane abstracted into CSP managed control plane"`
}

ExcludedWorkerItem records workers excluded from migration and the explicit reason.

type ExecutiveSummary

type ExecutiveSummary struct {
	MigrationStatus    string  `json:"migrationStatus" example:"Completed"`
	TotalServers       int     `json:"totalServers" example:"2"`
	MigratedServers    int     `json:"migratedServers" example:"2"`
	FailedServers      int     `json:"failedServers" example:"0"`
	TotalSourceGPUs    int     `json:"totalSourceGpus,omitempty" example:"2"`
	TotalTargetGPUs    int     `json:"totalTargetGpus,omitempty" example:"2"`
	NlbMigrationStatus string  `json:"nlbMigrationStatus,omitempty" example:"Completed"`
	TotalNLBs          int     `json:"totalNlbs,omitempty" example:"1"`
	MigratedNLBs       int     `json:"migratedNlbs,omitempty" example:"1"`
	FailedNLBs         int     `json:"failedNlbs,omitempty" example:"0"`
	TargetCloud        string  `json:"targetCloud" example:"AWS"`
	TargetRegion       string  `json:"targetRegion" example:"ap-northeast-2"`
	MonthlyCostUSD     float64 `json:"monthlyCostUsd" example:"382.46"`
}

ExecutiveSummary provides high-level migration overview

type IPMapping

type IPMapping struct {
	SourceIP        string `json:"sourceIp" example:"172.29.0.102"`
	SourceHostname  string `json:"sourceHostname" example:"cm-nfs"`
	TargetPrivateIP string `json:"targetPrivateIp" example:"192.168.110.167"`
	TargetPublicIP  string `json:"targetPublicIp" example:"43.201.85.138"`
}

IPMapping represents source to target IP mapping

type K8sExecutiveSummary added in v0.6.2

type K8sExecutiveSummary struct {
	MigrationStatus      string  `json:"migrationStatus" example:"Completed"`
	SourceClusterName    string  `json:"sourceClusterName" example:"on-prem-k8s"`
	SourceTotalNodes     int     `json:"sourceTotalNodes" example:"3"`
	SourceWorkerNodes    int     `json:"sourceWorkerNodes" example:"2"`
	TargetCloud          string  `json:"targetCloud" example:"AWS"`
	TargetRegion         string  `json:"targetRegion" example:"ap-northeast-2"`
	TargetClusterName    string  `json:"targetClusterName" example:"mig-k8s-cluster"`
	TargetNodeGroupCount int     `json:"targetNodeGroupCount" example:"1"`
	TargetTotalNodes     int     `json:"targetTotalNodes" example:"2"`
	MonthlyCostUSD       float64 `json:"monthlyCostUsd" example:"221.76"`
}

K8sExecutiveSummary provides an executive summary for K8s migration.

type K8sMigrationReport added in v0.6.2

type K8sMigrationReport struct {
	Metadata           ReportMetadata                 `json:"metadata"`
	ExecutiveSummary   K8sExecutiveSummary            `json:"executiveSummary"`
	VersionAnalysis    K8sVersionAnalysis             `json:"versionAnalysis"`
	NodeGroupMappings  []WorkerNodeGroupMapping       `json:"nodeGroupMappings"`
	SizingAnalysis     []WorkerSizingItem             `json:"sizingAnalysis"`
	ExcludedWorkers    []ExcludedWorkerItem           `json:"excludedWorkers,omitempty"`
	ResourceComparison K8sResourceComparison          `json:"resourceComparison"`
	CostSummary        CostSummary                    `json:"costSummary"`
	Recommendations    []Recommendation               `json:"recommendations"`
	SourceDetails      *summary.SourceInfraSummary    `json:"sourceDetails"`
	TargetDetails      *summary.TargetK8sInfraSummary `json:"targetDetails"`
}

K8sMigrationReport represents a source-to-target comparative migration analysis report for K8s.

func GenerateK8sMigrationReport added in v0.6.2

func GenerateK8sMigrationReport(nsId, clusterId string, sourceInfra onpremmodel.OnpremInfra) (*K8sMigrationReport, error)

GenerateK8sMigrationReport generates a comprehensive migration report for K8s infrastructure.

type K8sResourceComparison added in v0.6.2

type K8sResourceComparison struct {
	WorkerCountDelta ResourceChange `json:"workerCountDelta"`
	VcpuDelta        ResourceChange `json:"vcpuDelta"`
	MemoryGibDelta   ResourceChange `json:"memoryGibDelta"`
	StorageGbDelta   ResourceChange `json:"storageGbDelta"`
}

K8sResourceComparison computes delta between source on-premise and target cloud resources.

type K8sVersionAnalysis added in v0.6.2

type K8sVersionAnalysis struct {
	SourceVersion string `json:"sourceVersion" example:"1.28.0"`
	TargetVersion string `json:"targetVersion" example:"1.34"`
	UpgradeStatus string `json:"upgradeStatus" example:"Upgraded (Compatible)"`
	Notes         string `json:"notes,omitempty" example:"Upgraded to target CSP supported minimum stable version"`
}

K8sVersionAnalysis details version changes between source and target clusters.

type MigrationReport

type MigrationReport struct {
	Metadata          ReportMetadata              `json:"metadata"`
	ExecutiveSummary  ExecutiveSummary            `json:"executiveSummary"`
	MigrationMappings []SourceTargetMapping       `json:"migrationMappings"`
	NlbMappings       []NlbMigrationMapping       `json:"nlbMappings,omitempty"`
	NetworkAnalysis   NetworkMigrationAnalysis    `json:"networkAnalysis"`
	SecurityAnalysis  SecurityMigrationAnalysis   `json:"securityAnalysis"`
	CostSummary       CostSummary                 `json:"costSummary"`
	Recommendations   []Recommendation            `json:"recommendations"`
	SourceDetails     *summary.SourceInfraSummary `json:"sourceDetails"`
	TargetDetails     *summary.TargetInfraSummary `json:"targetDetails"`
}

MigrationReport represents a comprehensive migration analysis report

func GenerateMigrationReport

func GenerateMigrationReport(nsId, infraId string, sourceInfra onpremmodel.OnpremInfra) (*MigrationReport, error)

GenerateMigrationReport generates a comprehensive migration report

type NetworkChange

type NetworkChange struct {
	SourceIP        string `json:"sourceIp" example:"172.29.0.102"`
	TargetPrivateIP string `json:"targetPrivateIp" example:"192.168.110.167"`
	TargetPublicIP  string `json:"targetPublicIp" example:"43.201.85.138"`
	ChangeType      string `json:"changeType" example:"Public IP Added"`
	Description     string `json:"description" example:"Added public IP for internet access"`
}

NetworkChange represents network configuration changes

type NetworkMigrationAnalysis

type NetworkMigrationAnalysis struct {
	SourceNetwork SourceNetworkInfo `json:"sourceNetwork"`
	TargetNetwork TargetNetworkInfo `json:"targetNetwork"`
	IPMappings    []IPMapping       `json:"ipMappings"`
	CIDRPreserved bool              `json:"cidrPreserved"`
	Description   string            `json:"description"`
}

NetworkMigrationAnalysis contains network migration analysis

type NlbBackendNodeMapping added in v0.6.4

type NlbBackendNodeMapping struct {
	SourceServerName string `json:"sourceServerName" example:"influx1"`
	SourceIP         string `json:"sourceIp" example:"10.0.1.221"`
	SourcePort       int    `json:"sourcePort" example:"8086"`
	SourceHostname   string `json:"sourceHostname" example:"ip-10-0-1-221"`
	SourceMachineID  string `json:"sourceMachineId" example:"ec2d32b5-98fb-5a96-7913-d3db1ec18932"`
	TargetVmName     string `json:"targetVmName" example:"my01-ng-influxdb-back-1"`
	TargetCspVmID    string `json:"targetCspVmId" example:"i-0dee049fb9412465b"`
	TargetPrivateIP  string `json:"targetPrivateIp" example:"10.0.1.221"`
	TargetPublicIP   string `json:"targetPublicIp,omitempty" example:"13.125.79.237"`
	TargetPort       string `json:"targetPort" example:"8086"`
	Status           string `json:"status" example:"Running"`
}

NlbBackendNodeMapping represents a mapping between an on-premise backend server and a target NLB node

type NlbMigrationMapping added in v0.6.4

type NlbMigrationMapping struct {
	MappingID            int                     `json:"mappingId" example:"1"`
	SourceNlb            summary.SourceNlbInfo   `json:"sourceNlb"`
	TargetNlb            *summary.SummaryNlbInfo `json:"targetNlb,omitempty"`
	HostNodeTargetVmName string                  `json:"hostNodeTargetVmName,omitempty" example:"my01-ng-ec268ed7-821e-9d73-e79f-961262161624-1"`
	BackendNodeMappings  []NlbBackendNodeMapping `json:"backendNodeMappings,omitempty"`
	MigrationStatus      string                  `json:"migrationStatus" example:"Migrated"`
	Notes                []string                `json:"notes,omitempty"`
}

NlbMigrationMapping represents a correlation between an on-premise load balancer and a target cloud NLB

type Recommendation

type Recommendation struct {
	Category    string   `json:"category" example:"Cost Optimization"`
	Priority    string   `json:"priority" example:"High"` // High, Medium, Low
	Title       string   `json:"title" example:"Consider Reserved Instances"`
	Description string   `json:"description" example:"Reserved Instances can save up to 35% (~$248/month)"`
	ActionItems []string `json:"actionItems,omitempty"`
}

Recommendation represents a recommendation or action item

type ReportMetadata

type ReportMetadata struct {
	GeneratedAt   time.Time `json:"generatedAt" example:"2025-11-04T10:30:00Z"`
	MigrationID   string    `json:"migrationId" example:"mig01/mmci01"`
	Namespace     string    `json:"namespace" example:"mig01"`
	InfraID       string    `json:"infraId" example:"infra01"`
	ReportVersion string    `json:"reportVersion" example:"1.0"`
}

ReportMetadata contains report generation metadata

type ResourceChange

type ResourceChange struct {
	ResourceType string  `json:"resourceType" example:"CPU"`
	SourceValue  string  `json:"sourceValue" example:"2 cores"`
	TargetValue  string  `json:"targetValue" example:"8 vCPU"`
	ChangeType   string  `json:"changeType" example:"Upgrade"` // Upgrade, Downgrade, Same, Added, Removed
	ChangeRatio  float64 `json:"changeRatio" example:"4.0"`    // Multiplier or percentage
	Description  string  `json:"description" example:"+6 cores (4x upgrade)"`
}

ResourceChange represents a change in a resource

type ResourceChangeAnalysis

type ResourceChangeAnalysis struct {
	CPUChange      ResourceChange  `json:"cpuChange"`
	MemoryChange   ResourceChange  `json:"memoryChange"`
	StorageChange  ResourceChange  `json:"storageChange"`
	GPUChange      *ResourceChange `json:"gpuChange,omitempty"`
	NetworkChange  NetworkChange   `json:"networkChange"`
	SecurityChange SecurityChange  `json:"securityChange"`
}

ResourceChangeAnalysis contains detailed resource change analysis

type SecurityChange

type SecurityChange struct {
	SourceRules      int    `json:"sourceRules" example:"3"`
	TargetRules      int    `json:"targetRules" example:"6"`
	ConversionStatus string `json:"conversionStatus" example:"Converted"`
	Description      string `json:"description" example:"Converted 3 iptables rules to AWS Security Group"`
}

SecurityChange represents security configuration changes

type SecurityConversion

type SecurityConversion struct {
	SourceHostname string `json:"sourceHostname" example:"cm-nfs"`
	SourceRules    int    `json:"sourceRules" example:"3"`
	TargetSGName   string `json:"targetSgName" example:"mig-sg-02"`
	TargetRules    int    `json:"targetRules" example:"6"`
	ConversionType string `json:"conversionType" example:"iptables to AWS SG"`
	Status         string `json:"status" example:"Converted"`
}

SecurityConversion represents a security rule conversion

type SecurityMigrationAnalysis

type SecurityMigrationAnalysis struct {
	Conversions []SecurityConversion `json:"conversions"`
	Summary     string               `json:"summary"`
}

SecurityMigrationAnalysis contains security migration analysis

type SourceNetworkInfo

type SourceNetworkInfo struct {
	CIDR             string `json:"cidr" example:"192.168.110.0/24"`
	Gateway          string `json:"gateway" example:"192.168.110.254"`
	ConnectedServers int    `json:"connectedServers" example:"2"`
}

SourceNetworkInfo contains source network information

type SourceServerBrief

type SourceServerBrief struct {
	Hostname      string `json:"hostname" example:"cm-nfs"`
	MachineID     string `json:"machineId" example:"0036e4b9-c8b4-e811-906e-000ffee02d5c"`
	CPUModel      string `json:"cpuModel" example:"Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz"`
	CPUs          int    `json:"cpus" example:"1"`
	CPUThreads    int    `json:"cpuThreads" example:"16"`
	MemoryGB      int    `json:"memoryGb" example:"16"`
	DiskGB        int    `json:"diskGb" example:"1093"`
	DiskType      string `json:"diskType" example:"HDD"`
	OSName        string `json:"osName" example:"Ubuntu 22.04"`
	PrimaryIP     string `json:"primaryIp" example:"172.29.0.102"`
	FirewallRules int    `json:"firewallRules" example:"3"`
	GPUCount      int    `json:"gpuCount,omitempty" example:"1"`
	GPUSummary    string `json:"gpuSummary,omitempty" example:"1 x NVIDIA A100-PCIE-40GB"`
}

SourceServerBrief contains brief source server information

type SourceTargetMapping

type SourceTargetMapping struct {
	MappingID       int                    `json:"mappingId" example:"1"`
	SourceServer    SourceServerBrief      `json:"sourceServer"`
	TargetVM        TargetVMBrief          `json:"targetVM"`
	ResourceChanges ResourceChangeAnalysis `json:"resourceChanges"`
	MigrationStatus string                 `json:"migrationStatus" example:"Success"`
	CostPerMonth    float64                `json:"costPerMonth" example:"247.68"`
}

SourceTargetMapping represents a mapping between source server and target VM

type TargetNetworkInfo

type TargetNetworkInfo struct {
	VNetName   string `json:"vnetName" example:"mig-vnet-01"`
	VNetCIDR   string `json:"vnetCidr" example:"192.168.96.0/19"`
	SubnetCIDR string `json:"subnetCidr" example:"192.168.110.0/24"`
	CSPVNetID  string `json:"cspVnetId" example:"vpc-0200cd398ed7c7f17"`
}

TargetNetworkInfo contains target network information

type TargetVMBrief

type TargetVMBrief struct {
	InstanceName    string   `json:"instanceName" example:"migrated-0036e4b9-c8b4-e811-906e-000ffee02d5c-1"`
	InstanceID      string   `json:"instanceId" example:"i-093b4b7c722ed9ec5"`
	SourceMachineID string   `json:"sourceMachineId" example:"0036e4b9-c8b4-e811-906e-000ffee02d5c"`
	Status          string   `json:"status" example:"Running"`
	SpecName        string   `json:"specName" example:"c5a.2xlarge"`
	VCPUs           int      `json:"vcpus" example:"8"`
	MemoryGB        float32  `json:"memoryGb" example:"16.0"`
	RootDiskGB      int      `json:"rootDiskGb" example:"50"`
	RootDiskType    string   `json:"rootDiskType" example:"gp2"`
	PublicIP        string   `json:"publicIp" example:"43.201.85.138"`
	PrivateIP       string   `json:"privateIp" example:"192.168.110.167"`
	SecurityGroups  []string `json:"securityGroups" example:"mig-sg-02"`
	GPUCount        int      `json:"gpuCount,omitempty" example:"1"`
	GPUSummary      string   `json:"gpuSummary,omitempty" example:"1 x Tesla T4 (16 GB)"`
}

TargetVMBrief contains brief target VM information

type WorkerNodeGroupMapping added in v0.6.2

type WorkerNodeGroupMapping struct {
	NodeGroupName   string              `json:"nodeGroupName" example:"workers1"`
	TargetSpecId    string              `json:"targetSpecId" example:"c5a.xlarge"`
	TargetNodeCount int                 `json:"targetNodeCount" example:"2"`
	AssignedWorkers []SourceServerBrief `json:"assignedWorkers"`
}

WorkerNodeGroupMapping maps on-premise worker nodes to target cloud node groups.

type WorkerSizingItem added in v0.6.2

type WorkerSizingItem struct {
	WorkerHostname string  `json:"workerHostname" example:"k8s-worker-01"`
	SourceVcpu     int     `json:"sourceVcpu" example:"1"`
	SourceMemoryGb float64 `json:"sourceMemoryGb" example:"2.0"`
	TargetSpecId   string  `json:"targetSpecId" example:"c5a.xlarge"`
	TargetVcpu     int     `json:"targetVcpu" example:"4"`
	TargetMemoryGb float64 `json:"targetMemoryGb" example:"8.0"`
	SizingReason   string  `json:"sizingReason" example:"Upscaled to minimum viable K8s worker floor (2vCPU / 4GiB)"`
}

WorkerSizingItem explains the sizing rationale for a worker node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL