Skip to content

Fix Kops command to export k8s cluster config#310

Merged
osterman merged 1 commit intomasterfrom
fix_kops_kubectl_export_config
Dec 13, 2018
Merged

Fix Kops command to export k8s cluster config#310
osterman merged 1 commit intomasterfrom
fix_kops_kubectl_export_config

Conversation

@joshmyers
Copy link
Contributor

This should be kops export, kubectl export isn’t a thing.

This is most likely caused by not setting the `kubectl` context to use the kops cluster.

To fix this, run `kubectl export kubecfg --name us-west-2.staging.cloudposse.org` (replace our kops cluster name with yours or use the `$KOPS_CLUSTER_NAME` variable, if set). =)
To fix this, run `kops export kubecfg --name us-west-2.staging.cloudposse.org` (replace our kops cluster name with yours or use the `$KOPS_CLUSTER_NAME` variable, if set). =)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To fix this, run `kops export kubecfg --name us-west-2.staging.cloudposse.org` (replace our kops cluster name with yours or use the `$KOPS_CLUSTER_NAME` variable, if set). =)
To fix this, run `kops export kubecfg` (this assumes the`$KOPS_CLUSTER_NAME` variable is already set to the cluster name)

e.g.
```
kubectl export kubecfg --name $KOPS_CLUSTER_NAME
kops export kubecfg --name $KOPS_CLUSTER_NAME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kops export kubecfg --name $KOPS_CLUSTER_NAME
kops export kubecfg

The kubernetes TLS keys are stored by `kops` in a private, encrypted S3 bucket. When using the geodesic shell, you'll need to export these credentials in order to access the kubernetes cluster using `kops` or `helm`.

This is done by running `kubectl export kubecfg $KOPS_CLUSTER_NAME`
This is done by running `kops export kubecfg --name $KOPS_CLUSTER_NAME`
Copy link
Member

@osterman osterman Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is done by running `kops export kubecfg --name $KOPS_CLUSTER_NAME`
This is done by running `kops export kubecfg`

Copy link
Member

@osterman osterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update to the current recommended syntax, rather than persist the old format. The --name $KOPS_CLUSTER_NAME argument is no longer necessary if KOPS_CLUSTER_NAME is set.

Copy link
Member

@osterman osterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

This should be `kops export`, `kubectl export` isn’t a thing. Also note
that since newer versions of Kops will automatically look at the
$KOPS_CLUSTER_NAME env var, we no longer need to explicitly pass it.
@joshmyers joshmyers force-pushed the fix_kops_kubectl_export_config branch from 45e6e7d to c19615f Compare December 12, 2018 11:37
@joshmyers
Copy link
Contributor Author

@osterman comments addressed and rebased.

@osterman osterman merged commit e9ee4d9 into master Dec 13, 2018
@osterman osterman deleted the fix_kops_kubectl_export_config branch December 13, 2018 18:54
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

Successfully merging this pull request may close these issues.

2 participants