Kubernetes can't update cluster using kops

2/1/2021

I'm creating my cluster using kops create cluster --cloud=aws --zones=us-east-2c --name=dev.k8s.davidam.net --dns-zone=davidam.net --dns private and then I'm trying to update the cluster to get it up and running with the following command: kops update cluster --name dev.k8s.davidam.net --yes --admin

This is what is shown after running update command:

root@ip-172-31-42-74:~# kops get cluster
NAME                    CLOUD   ZONES
dev.k8s.davidam.net     aws     us-east-2c
root@ip-172-31-42-74:~# kops update cluster dev.k8s.davidam.net --yes
I0201 05:45:57.374300    2486 dns.go:96] Private DNS: skipping DNS validation
I0201 05:45:57.649629    2486 executor.go:111] Tasks: 0 done / 79 total; 44 can run
W0201 05:45:57.745250    2486 vfs_castore.go:604] CA private key was not found
I0201 05:45:57.747890    2486 keypair.go:195] Issuing new certificate: "master"
I0201 05:45:57.779881    2486 keypair.go:195] Issuing new certificate: "etcd-manager-ca-events"
W0201 05:45:57.842627    2486 vfs_castore.go:604] CA private key was not found
I0201 05:45:57.842807    2486 keypair.go:195] Issuing new certificate: "ca"
I0201 05:45:57.901260    2486 keypair.go:195] Issuing new certificate: "etcd-peers-ca-main"
I0201 05:45:57.921459    2486 keypair.go:195] Issuing new certificate: "etcd-clients-ca"
I0201 05:45:58.042884    2486 keypair.go:195] Issuing new certificate: "etcd-manager-ca-main"
I0201 05:45:58.063074    2486 keypair.go:195] Issuing new certificate: "etcd-peers-ca-events"
I0201 05:45:58.083303    2486 keypair.go:195] Issuing new certificate: "apiserver-aggregator-ca"
I0201 05:46:01.401049    2486 executor.go:111] Tasks: 44 done / 79 total; 15 can run
I0201 05:46:02.479423    2486 executor.go:111] Tasks: 59 done / 79 total; 18 can run
I0201 05:46:02.886831    2486 executor.go:111] Tasks: 77 done / 79 total; 2 can run
I0201 05:46:03.752332    2486 executor.go:137] Task "AutoscalingGroup/nodes-us-east-2c.dev.k8s.davidam.net" not ready: waiting for the IAM Instance Profile to be propagated
I0201 05:46:03.752620    2486 executor.go:137] Task "AutoscalingGroup/master-us-east-2c.masters.dev.k8s.davidam.net" not ready: waiting for the IAM Instance Profile to be propagated
I0201 05:46:03.752758    2486 executor.go:155] No progress made, sleeping before retrying 2 task(s)
I0201 05:46:13.753105    2486 executor.go:111] Tasks: 77 done / 79 total; 2 can run
I0201 05:46:15.306756    2486 executor.go:111] Tasks: 79 done / 79 total; 0 can run
I0201 05:46:15.306996    2486 dns.go:156] Pre-creating DNS records
I0201 05:46:15.755991    2486 update_cluster.go:313] Exporting kubecfg for cluster
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2c56de4]

goroutine 1 [running]:
k8s.io/kops/upup/pkg/fi/cloudup/awstasks.FindElasticLoadBalancerByNameTag(0x476a180, 0xc000d21580, 0xc0002bbb00, 0xc000e36aa0, 0x13, 0xc000f86820, 0x17)
        upup/pkg/fi/cloudup/awstasks/dnsname.go:156 +0x84
k8s.io/kops/upup/pkg/fi/cloudup/awstasks.FindDNSName(0x476a180, 0xc000d21580, 0xc0002bbb00, 0x476a180, 0xc000d21580, 0x38501, 0xc000f1b6c8)
        upup/pkg/fi/cloudup/awstasks/dnsname.go:135 +0x90
k8s.io/kops/pkg/commands.(*CloudDiscoveryStatusStore).GetApiIngressStatus(0x660ae18, 0xc0002bbb00, 0xa, 0xc000e36b00, 0x17, 0xc000f1b790, 0x18)
        pkg/commands/status_discovery.go:56 +0x10e
k8s.io/kops/pkg/kubeconfig.BuildKubecfg(0xc0002bbb00, 0x46d3c80, 0xc000e3aae0, 0x472d8e0, 0xc000e3c360, 0x469a980, 0x660ae18, 0x0, 0x0, 0x0, ...)
        pkg/kubeconfig/create_kubecfg.go:74 +0x258
main.RunUpdateCluster(0x46e69c0, 0xc000054090, 0xc000130240, 0x7ffc4bcda803, 0x13, 0x4695560, 0xc00000e020, 0xc0003de6e0, 0x5, 0x4131974, ...)
        cmd/kops/update_cluster.go:317 +0x17d8
main.NewCmdUpdateCluster.func1(0xc0002982c0, 0xc0003be660, 0x1, 0x2)
        cmd/kops/update_cluster.go:113 +0x109
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).execute(0xc0002982c0, 0xc0003be640, 0x2, 0x2, 0xc0002982c0, 0xc0003be640)
        vendor/github.com/spf13/cobra/command.go:846 +0x2c2
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x65bfe40, 0x660ae18, 0x0, 0x0)
        vendor/github.com/spf13/cobra/command.go:950 +0x375
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).Execute(...)
        vendor/github.com/spf13/cobra/command.go:887
main.Execute()
        cmd/kops/root.go:97 +0x8f
main.main()
        cmd/kops/main.go:24 +0x25

I've searched everywhere and only found a post github which wasn't resolved and didn't help at all. How can I solve this issue?

-- David AM
kops
kubernetes
ubuntu

0 Answers