{"record":{"id":"c4966f2254d56943","repo":"kubernetes/kops","slug":"ssh-public-key-must-be-specified-when-running-with-c4966f","errorCode":null,"errorMessage":"SSH public key must be specified when running with Scaleway (create with `kops create secret --name %s sshpublickey admin -i ~/.ssh/id_rsa.pub`)","messagePattern":"SSH public key must be specified when running with Scaleway \\(create with `kops create secret --name (.+?) sshpublickey admin -i ~/\\.ssh/id_rsa\\.pub`\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/apply_cluster.go","lineNumber":492,"sourceCode":"\tcase kops.CloudProviderOpenstack:\n\t\t{\n\t\t\tif len(sshPublicKeys) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"SSH public key must be specified when running with Openstack (create with `kops create secret --name %s sshpublickey admin -i ~/.ssh/id_rsa.pub`)\", cluster.ObjectMeta.Name)\n\t\t\t}\n\n\t\t\tif len(sshPublicKeys) != 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"exactly one 'admin' SSH public key can be specified when running with Openstack; please delete a key using `kops delete secret`\")\n\t\t\t}\n\t\t}\n\n\tcase kops.CloudProviderScaleway:\n\t\t{\n\t\t\tif !featureflag.Scaleway.Enabled() {\n\t\t\t\treturn nil, fmt.Errorf(\"Scaleway support is currently alpha, and is feature-gated.  export KOPS_FEATURE_FLAGS=Scaleway\")\n\t\t\t}\n\n\t\t\tif len(sshPublicKeys) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"SSH public key must be specified when running with Scaleway (create with `kops create secret --name %s sshpublickey admin -i ~/.ssh/id_rsa.pub`)\", cluster.ObjectMeta.Name)\n\t\t\t}\n\t\t\tif len(sshPublicKeys) != 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"exactly one 'admin' SSH public key can be specified when running with Scaleway; please delete a key using `kops delete secret`\")\n\t\t\t}\n\n\t\t\tscwCloud := cloud.(scaleway.ScwCloud)\n\t\t\tscwZone = scwCloud.Zone()\n\t\t}\n\n\tcase kops.CloudProviderLinode:\n\t\t{\n\t\t\tif !featureflag.Linode.Enabled() {\n\t\t\t\treturn nil, fmt.Errorf(\"Akamai (Linode) support is currently alpha, and is feature-gated. Please export KOPS_FEATURE_FLAGS=Linode\")\n\t\t\t}\n\t\t}\n\n\tcase kops.CloudProviderMetal:\n\t\t// Metal is a special case, we don't need to do anything here (yet)","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/apply_cluster.go#L474-L510","documentation":"When applying a Scaleway cluster, kOps requires an SSH public key secret named 'admin' to exist. In apply_cluster.go Run, if the loaded sshPublicKeys map is empty, the apply fails with instructions on how to create the key. Scaleway provisioning injects this key into instances, so it must be present.","triggerScenarios":"`kops update cluster` on a scaleway cluster where no 'sshpublickey admin' secret has ever been created for the cluster.","commonSituations":"Fresh cluster creation where the user skipped the `kops create secret` step, or after switching clusters/namespaces so the secret store for the target cluster is empty.","solutions":["Create the key: `kops create secret --name <cluster> sshpublickey admin -i ~/.ssh/id_rsa.pub` then rerun update","If the file is elsewhere, pass its path with -i (must be a public key, e.g. .pub file)","Confirm with `kops get secrets` that the sshpublickey entry now exists"],"exampleFix":"// before: no ssh key secret\nkops create secret --name scw.example.com sshpublickey admin -i ~/.ssh/id_rsa.pub\n// after: key exists; kops update cluster proceeds","handlingStrategy":"validation","validationCode":"kops get secrets --name \"$CLUSTER\" | grep -q sshpublickey || kops create secret --name \"$CLUSTER\" sshpublickey admin -i ~/.ssh/id_rsa.pub","typeGuard":null,"tryCatchPattern":"if err := updateCluster(); err != nil { if strings.Contains(err.Error(), \"SSH public key must be specified\") { createAdminKey(); retry() } return err }","preventionTips":["Always run `kops create secret ... sshpublickey admin` right after `kops create cluster` for scaleway","Script cluster bootstrap to include the key step","Verify key presence with `kops get secrets` before updates"],"tags":["scaleway","ssh","configuration","precondition"],"backgroundTag":"missing-ssh-public-key","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"}