Azure / Azure/azure-libraries-for-java
[BUG] Kubernetes cluster returns 401
- Langage dominant
- Java
- Étoiles
- 97
- Forks
- 102
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez la configuration numérotée du service principal et du cluster, puis inspectez le flux d’authentification Azure et le kubeconfig renvoyé par adminKubeConfigContent(). Suivez la manière dont K8SConfiguration.parseKubeconfigStream transmet cette configuration à l’API Skuber ; le travail est terminé lorsque la connexion au cluster reproduit ne renvoie plus HTTP 401.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, java, kubernetes
- Domaine
- authentication, cloud, infrastructure
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100