{"record":{"id":"f99636ceb13f457e","repo":"kubernetes/kops","slug":"unknown-api-loadbalancer-type-q","errorCode":null,"errorMessage":"unknown api-loadbalancer-type: %q","messagePattern":"unknown api-loadbalancer-type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":1572,"sourceCode":"\t\t\t\tcluster.Spec.API.DNS = &api.DNSAccessSpec{}\n\t\t\t}\n\n\t\tcase api.TopologyPrivate:\n\t\t\tcluster.Spec.API.LoadBalancer = &api.LoadBalancerAccessSpec{}\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown topology type: %q\", opt.Topology)\n\t\t}\n\t}\n\n\tif cluster.Spec.API.LoadBalancer != nil && cluster.Spec.API.LoadBalancer.Type == \"\" {\n\t\tswitch opt.APILoadBalancerType {\n\t\tcase \"\", \"public\":\n\t\t\tcluster.Spec.API.LoadBalancer.Type = api.LoadBalancerTypePublic\n\t\tcase \"internal\":\n\t\t\tcluster.Spec.API.LoadBalancer.Type = api.LoadBalancerTypeInternal\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown api-loadbalancer-type: %q\", opt.APILoadBalancerType)\n\t\t}\n\t}\n\n\tif cluster.Spec.API.LoadBalancer != nil && opt.APISSLCertificate != \"\" {\n\t\tcluster.Spec.API.LoadBalancer.SSLCertificate = opt.APISSLCertificate\n\t}\n\n\tif cluster.Spec.API.LoadBalancer != nil && cluster.Spec.API.LoadBalancer.Class == \"\" && cluster.GetCloudProvider() == api.CloudProviderAWS {\n\t\tcluster.Spec.API.LoadBalancer.Class = api.LoadBalancerClassNetwork\n\t}\n\n\treturn nil\n}\n\nfunc initializeOpenstack(opt *NewClusterOptions, cluster *api.Cluster) {\n\tif opt.APILoadBalancerType != \"\" {\n\t\tcluster.Spec.API.LoadBalancer = &api.LoadBalancerAccessSpec{}\n\t\tprovider := \"haproxy\"","sourceCodeStart":1554,"sourceCodeEnd":1590,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L1554-L1590","documentation":"Returned by setupAPI in `kops create cluster` when the --api-loadbalancer-type flag has a value the switch statement does not recognize. Only empty, \"public\", and \"internal\" are accepted; anything else aborts cluster spec creation before any infrastructure is provisioned.","triggerScenarios":"Running `kops create cluster --api-loadbalancer-type=<value>` with a misspelled or unsupported value, e.g. \"Public\", \"private\", \"nlb\", or \"external\".","commonSituations":"Typo or wrong casing of the flag value; copying examples from other tools (e.g. \"nlb\"/\"alb\" are AWS LB types, not kops values); older docs using deprecated synonyms.","solutions":["Set --api-loadbalancer-type to exactly \"public\" or \"internal\" (or omit it for the default)","Check `kops create cluster --help` for accepted values","Correct the value in any scripts/addons invoking kops"],"exampleFix":"// before\nkops create cluster ... --api-loadbalancer-type=nlb\n// after\nkops create cluster ... --api-loadbalancer-type=public","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"\": true, \"public\": true, \"internal\": true}\nif !valid[opt.APILoadBalancerType] {\n    return fmt.Errorf(\"--api-loadbalancer-type must be public or internal, got %q\", opt.APILoadBalancerType)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only the documented values public/internal","Add shell-completion or wrapper scripts that validate the flag","Keep flags in one reviewed config script"],"tags":["cli","configuration","validation"],"backgroundTag":"invalid-flag-value","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}