Rapha-Borges / oke-free

Uma maneira fácil de garantir seu próprio cluster Kubernetes gratuitamente e para sempre
GNU General Public License v3.0
894 stars 382 forks source link

Erro ao criar o kubeconfig #37

Closed nataliagranato closed 6 months ago

nataliagranato commented 7 months ago

Erro ao criar o kubeconfig

O cluster é criado normalmente utilizando API key, com as chaves ssh necessárias e com as variáveis de ambiente corretas, porém no último passo encontro o seguinte problema:

module.kubeconfig.null_resource.create_kubeconfig: Creating...
module.kubeconfig.null_resource.create_kubeconfig: Provisioning with 'local-exec'...
module.kubeconfig.null_resource.create_kubeconfig (local-exec): Executing: ["/bin/sh" "-c" "oci ce cluster create-kubeconfig --cluster-id ocid1.cluster.oc1.iad.aaaaaaaa2jpkpeevaczuvpvfyiz5eqjtkisrqt662mgenvd43c5aenv6m37a --file ~/.kube/config --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT --profile DEFAULT"]
module.kubeconfig.null_resource.create_kubeconfig (local-exec): ServiceError:
module.kubeconfig.null_resource.create_kubeconfig (local-exec): {
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "client_version": "Oracle-PythonSDK/2.116.0, Oracle-PythonCLI/3.36.2",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "code": "NotAuthenticated",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "logging_tips": "Please run the OCI CLI command using --debug flag to find more debug information.",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "message": "Failed to verify the HTTP(S) Signature",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "opc-request-id": "D48ED1C5DCF0468EA126CA69FF99571E/CA4121DE9F864F3C70D61CA9DA5D747A/F550EA6AB0831BF7A24ADCE751AD193C",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "operation_name": "create_kubeconfig",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "request_endpoint": "POST https://containerengine.us-ashburn-1.oci.oraclecloud.com/20180222/clusters/ocid1.cluster.oc1.iad.aaaaaaaa2jpkpeevaczuvpvfyiz5eqjtkisrqt662mgenvd43c5aenv6m37a/kubeconfig/content",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "status": 401,
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "target_service": "container_engine",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "timestamp": "2024-02-01T03:03:58.838124+00:00",
module.kubeconfig.null_resource.create_kubeconfig (local-exec):     "troubleshooting_tips": "See [https://docs.oracle.com/iaas/Content/API/References/apierrors.htm] for more information about resolving this error. If you are unable to resolve this issue, run this CLI command with --debug option and contact Oracle support and provide them the full error message."
module.kubeconfig.null_resource.create_kubeconfig (local-exec): }
╷
│ Error: local-exec provisioner error
│ 
│   with module.kubeconfig.null_resource.create_kubeconfig,
│   on kubeconfig/kubeconfig.tf line 2, in resource "null_resource" "create_kubeconfig":
│    2:   provisioner "local-exec" {
│ 
│ Error running command 'oci ce cluster create-kubeconfig --cluster-id
│ ocid1.cluster.oc1.iad.aaaaaaaa2jpkpeevaczuvpvfyiz5eqjtkisrqt662mgenvd43c5aenv6m37a --file ~/.kube/config --token-version 2.0.0
│ --kube-endpoint PUBLIC_ENDPOINT --profile DEFAULT': exit status 1. Output: ServiceError:
│ {
│     "client_version": "Oracle-PythonSDK/2.116.0, Oracle-PythonCLI/3.36.2",
│     "code": "NotAuthenticated",
│     "logging_tips": "Please run the OCI CLI command using --debug flag to find more debug information.",
│     "message": "Failed to verify the HTTP(S) Signature",
│     "opc-request-id": "D48ED1C5DCF0468EA126CA69FF99571E/CA4121DE9F864F3C70D61CA9DA5D747A/F550EA6AB0831BF7A24ADCE751AD193C",
│     "operation_name": "create_kubeconfig",
│     "request_endpoint": "POST https://containerengine.us-ashburn-1.oci.oraclecloud.com/20180222/clusters/ocid1.cluster.oc1.iad.aaaaaaaa2jpkpeevaczuvpvfyiz5eqjtkisrqt662mgenvd43c5aenv6m37a/kubeconfig/content",
│     "status": 401,
│     "target_service": "container_engine",
│     "timestamp": "2024-02-01T03:03:58.838124+00:00",
│     "troubleshooting_tips": "See [https://docs.oracle.com/iaas/Content/API/References/apierrors.htm] for more information about resolving this error. If you are unable to resolve this issue, run this CLI command with --debug option and contact Oracle support and provide them the full error message."
│ }
│ 
Rapha-Borges commented 7 months ago

Não consegui obter o mesmo resultado ao realizar testes em VMs diferentes. No entanto, o erro "401 NotAuthenticated" está diretamente relacionado à autenticação. No link abaixo, há alguns passos que podem ajudar:

https://docs.oracle.com/en-us/iaas/Content/API/References/apierrors.htm#apierrors_401__401_notauthenticated

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had activity in the 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

github-actions[bot] commented 6 months ago

This issue has been automatically closed because it has not had any further activity in the last 14 days. Thank you for your contributions!