Azure / Azure/azure-libraries-for-java

[BUG] Kubernetes cluster returns 401

Abierto
#774 2 comentarios 0 reacciones 0 asignados Ver en GitHub
AKS customer-reported Mgmt needs-more-info
Lenguaje dominante
Java
Estrellas
97
Forks
102
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce la configuración numerada del service principal y del clúster; después, inspecciona el flujo de autenticación de Azure y el kubeconfig devuelto por adminKubeConfigContent(). Rastrea cómo K8SConfiguration.parseKubeconfigStream pasa esa configuración a la API de Skuber; se considera completado cuando la conexión al clúster reproducido deja de devolver HTTP 401.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, java, kubernetes
Área
authentication, cloud, infrastructure
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.