Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error launching "jx admin log" #290

Closed
grossiello-netspinlab opened this issue Aug 5, 2021 · 5 comments
Closed

Error launching "jx admin log" #290

grossiello-netspinlab opened this issue Aug 5, 2021 · 5 comments

Comments

@grossiello-netspinlab
Copy link

Summary

JX setup succeeds up to the jx admin log command, which returns an error.

Steps to reproduce the behavior

  1. generate repo from https://github.com/jx3-gitops-repositories/jx3-terraform-eks/generate
  2. generate repo from https://github.com/jx3-gitops-repositories/jx3-eks-vault/generate
  3. configure terraform variables
  4. execute: terraform init, terraform plan and terraform apply
  5. execute: jx admin log

Expected behavior

Jenkins X installation logs tailed

Actual behavior

The following error is returned:
error: failed to find the git operator namespace: failed to find Deployment jx-git-operator in namespace jx: Unauthorized

Terraform version

The output of terraform version is:

Terraform v1.0.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v3.51.0
  • provider registry.terraform.io/hashicorp/cloudinit v2.2.0
  • provider registry.terraform.io/hashicorp/helm v2.2.0
  • provider registry.terraform.io/hashicorp/kubernetes v2.3.2
  • provider registry.terraform.io/hashicorp/local v2.1.0
  • provider registry.terraform.io/hashicorp/null v3.1.0
  • provider registry.terraform.io/hashicorp/random v3.1.0
  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/terraform-aws-modules/http v2.4.1

Module version

1.15.38

Operating system

Ubuntu

@ankitm123
Copy link
Member

failed to find the git operator namespace

Can you paste the output of kubectl get ns?

Also do u have kubeconfig env variable pointing to ur local kubeconfig file?
Also can u try AWS_PROFILE=<profile> terraform apply, where profile is ur AWS profile set in credentials or config file (in the .aws folder)

@ryankav
Copy link

ryankav commented Aug 11, 2021

I also came up against this issue.

To follow on from the above, this is the result that running kubectl get ns returned error: You must be logged in to the server (Unauthorized)

The full user section of the config at this point showed:

users:
- name: <arn>
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - eu-west-2
      - eks
      - get-token
      - --cluster-name
      - <cluster-name>
      command: aws

After setting the AWS_PROFILE in my env and re-running terraform apply the generated kube config had an ENV section with the aws profile I had set. As a result the jx admin log did work.

For completeness: was trying to run a '1.21' cluster version and was also running on Ubuntu - though WSL. Can specify more of the steps I took to get this issue if needs be as the issue seems fairly repeatable for me.

@ankitm123
Copy link
Member

I think the issue is related to #288

@ryankav
Copy link

ryankav commented Aug 13, 2021

I can confirm I had changed the AWS profile to be a named profile, not my default one, same as in #288.

@ankitm123
Copy link
Member

This should be fixed now, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants