Azure / Azure/azure-libraries-for-java
[BUG] Kubernetes cluster returns 401
- 主要言語
- Java
- スター
- 97
- フォーク
- 102
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**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
コントリビューションガイド
調査の方向性
番号付きのサービス プリンシパルとクラスターのセットアップを再現し、その後 Azure の認証フローと adminKubeConfigContent() が返す kubeconfig を調査します。K8SConfiguration.parseKubeconfigStream がその構成を Skuber API に渡す方法を追跡します。再現したクラスター接続が HTTP 401 を返さなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, java, kubernetes
- 領域
- authentication, cloud, infrastructure
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100