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

add annotation to kubeconfig to identify contexts/clusters created by minikube #10126

Merged
merged 8 commits into from
Jan 15, 2021

Conversation

medyagh
Copy link
Member

@medyagh medyagh commented Jan 11, 2021

After this PR the following extension blocks to the context and cluster section of ~/.kube/config

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /Users/medya/.minikube/ca.crt
    extensions:
    - extension:
        last-update: Thu, 14 Jan 2021 15:41:04 PST
        provider: minikube.sigs.k8s.io
        version: v1.16.0
      name: cluster_info
    server: https://127.0.0.1:55000
  name: minikube
contexts:
- context:
    cluster: minikube
    extensions:
    - extension:
        last-update: Thu, 14 Jan 2021 15:41:04 PST
        provider: minikube.sigs.k8s.io
        version: v1.16.0
      name: context_info
    namespace: default
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /Users/medya/.minikube/profiles/minikube/client.crt
    client-key: /Users/medya/.minikube/profiles/minikube/client.key


closes #9970

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 11, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 11, 2021
@medyagh medyagh changed the title add minikube labels to kubecontext extenions add created_by annotation to kubeconfig to identify kube-contexts created by minikube Jan 11, 2021
@sharifelgamal
Copy link
Collaborator

do we want to use hyphens instead of underscores (created-by and last-update instead of created_ by and last_update) to follow the convention set by kubeconfig?

@medyagh medyagh changed the title add created_by annotation to kubeconfig to identify kube-contexts created by minikube add annotation to kubeconfig to identify contexts/clusters created by minikube Jan 11, 2021
@briandealwis
Copy link
Contributor

I get your dislike of using cluster-type since they're Kubernetes clusters. But my concern about created-by is that it can refer to a tool like terraform. I wonder if there's a different term that we could settle on like provider. Basically within Skaffold I want to determine which helper command Skaffold should use to introspect on the cluster to find out more about its setup.

@medyagh
Copy link
Member Author

medyagh commented Jan 12, 2021

I get your dislike of using cluster-type since they're Kubernetes clusters. But my concern about created-by is that it can refer to a tool like terraform. I wonder if there's a different term that we could settle on like provider. Basically within Skaffold I want to determine which helper command Skaffold should use to introspect on the cluster to find out more about its setup.

I dont think it is a good idea to call it cluster-type when minikube creates the cluster, minikube clusters are not a "type" they are same clusters created by standard "kubedam" it would be misleading or confusing for normal users to see in their kubeconfig it call it "cluster_type"= minikube since minikube is gateway to most starting with kuberentes, I dont want to suggest the idea we have a special type of clusters.

There is though an opportunity to create a community-wide standard naming, there doesnt seem to be any other tool using the "Extension" part of kubeconfig.

@medyagh
Copy link
Member Author

medyagh commented Jan 12, 2021

I get your dislike of using cluster-type since they're Kubernetes clusters. But my concern about created-by is that it can refer to a tool like terraform. I wonder if there's a different term that we could settle on like provider. Basically within Skaffold I want to determine which helper command Skaffold should use to introspect on the cluster to find out more about its setup.

"provider" sounds like a good suggestion

@medyagh
Copy link
Member Author

medyagh commented Jan 13, 2021

I get your dislike of using cluster-type since they're Kubernetes clusters. But my concern about created-by is that it can refer to a tool like terraform. I wonder if there's a different term that we could settle on like provider. Basically within Skaffold I want to determine which helper command Skaffold should use to introspect on the cluster to find out more about its setup.

"provider" sounds like a good suggestion

@medyagh medyagh changed the title add annotation to kubeconfig to identify contexts/clusters created by minikube wip: add annotation to kubeconfig to identify contexts/clusters created by minikube Jan 13, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, priyawadhwa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [medyagh,priyawadhwa]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 13, 2021
@medyagh
Copy link
Member Author

medyagh commented Jan 13, 2021

ad of underscores (created-by and last-update instead of created_ by and last_update) to follow the convention set by kubeconfig?

good idea

@medyagh
Copy link
Member Author

medyagh commented Jan 13, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jan 13, 2021
@medyagh medyagh changed the title wip: add annotation to kubeconfig to identify contexts/clusters created by minikube add annotation to kubeconfig to identify contexts/clusters created by minikube Jan 13, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add minikube annotation to kubeconfig context and cluster extensions
5 participants