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

--profile is ignored when creating k8s config entry #873

Open
andytael opened this issue Nov 13, 2024 · 2 comments
Open

--profile is ignored when creating k8s config entry #873

andytael opened this issue Nov 13, 2024 · 2 comments

Comments

@andytael
Copy link
Member

When adding an OKE configuration and specify the --profile option it is ignore and you have to edit the .kube/config file manually to add the profile.

oci ce cluster create-kubeconfig --cluster-id ocid1.cluster........ --file $HOME/.kube/config --region us-chicago-1 --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT --profile <PROFILE_NAME>

- --profile
- <PROFILE_NAME>

This should be automated so no manual interaction would be needed.

@anup-21
Copy link
Member

anup-21 commented Nov 19, 2024

The --profile option in any CLI command is used to specify a named profile from the Oracle Cloud Infrastructure (OCI) CLI configuration file (~/.oci/config) as it is a global parameter and not for a specific command.

For more info refer:

@andytael
Copy link
Member Author

@anup-21 The --profile option is required if you are not using the DEFAULT profile. This section must be added manually into the ~/.kube/config file even if you specify --profile when creating the entry using the OCI CLI. In the example below the profile name is MAACLOUD and I've would have execute the following command:

oci ce cluster create-kubeconfig --cluster-id ocid1.cluster........ --file $HOME/.kube/config --region us-region-1 --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT --profile MAACLOUD

This section is not created by the OCI CLI command:

- --profile
- MAACLOUD
- name: user-cg2crj6ncua
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - ce
      - cluster
      - generate-token
      - --cluster-id
      - ocid1.cluster.oc1.us-region-1.aa.........
      - --region
      - us-region-1
      - --profile
      - MAACLOUD
      command: oci
      env: []
      interactiveMode: IfAvailable
      provideClusterInfo: false

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

2 participants