Azure / Azure/azure-libraries-for-java

[BUG] Kubernetes cluster returns 401

Aperta
#774 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
AKS customer-reported Mgmt needs-more-info
Lingua principale
Java
Stelle
97
Fork
102
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Describe the bug**
Kubernetes returns 401 error for every connection attempt. The most weird part is that this application worked fine more than a week ago(20.06.19). I use the azureauth.properties to access the cloud. kubeconfig is retrieved using adminKubeConfigConent().
This array is passed to Skuber API for the deployment of other needful components.
***Exception or Stack Trace***
`[INFO] [07/02/2019 14:22:13.993] [wtf-akka.actor.default-dispatcher-7] [skuber.api] [ { reqId=daf65bf9-3931-4a20-bc37-c731aa2c4879} } - received response with HTTP status 401]
[INFO] [07/02/2019 14:22:13.995] [wtf-akka.actor.default-dispatcher-8] [skuber.api] [Response: non-ok status returned - Status(v1,Status,ListMeta(,,None),Some(Failure),Some(Unauthorized),Some(Unauthorized),None,Some(401))`
**To Reproduce**
1. Create a new service principal
2. Create a cluster
3. Try to access a cluster using an admin kubeconfig file.
***Code Snippet***
` private val azure = Azure
.configure()
.authenticate(new File(getClass.getResource(authFile).getPath))
.withDefaultSubscription()`

` observableToFuture(
azure
.kubernetesClusters()
.define(cluster.name)
.withRegion(cluster.region.name)
.withExistingResourceGroup(cluster.group)
.withLatestVersion()
.withRootUsername(rootUser)
.withSshKey(generateSSHKey(cluster.group))
.withServicePrincipalClientId(clientId)
.withServicePrincipalSecret(secret)
.defineAgentPool(cluster.name)
.withVirtualMachineSize(ContainerServiceVMSizeTypes.fromString(cluster.configuration.vm.vmSize))
.withAgentPoolVirtualMachineCount(cluster.configuration.kafkaNodeAmount + cluster.configuration.zookeeperNodeAmount)
.withOSDiskSizeInGB(nodeDiskSize)
.attach()
.withDnsPrefix(cluster.group)
.createAsync()
).mapTo[KubernetesCluster]`

` private def getKubernetesConfig(clusterChain: ClusterChain): ConfigChain =
mapRight[KubernetesCluster, Array[Byte]](clusterChain, cluster => cluster.adminKubeConfigContent())`

` private val k8sConf =
K8SConfiguration.parseKubeconfigStream(new ByteArrayInputStream(kubeconfig)).fold(Future.failed, Future.successful)`

**Setup (please complete the following information):**
- OS: Linux
- IDE : Intellij Idea
- Version of the Library used: 1.22

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the numbered service-principal and cluster setup, then inspect the Azure authentication flow and the kubeconfig returned by adminKubeConfigContent(). Trace how K8SConfiguration.parseKubeconfigStream passes that configuration to the Skuber API; done means the reproduced cluster connection no longer returns HTTP 401.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, java, kubernetes
Ambito
authentication, cloud, infrastructure
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.