UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Mark Sanchez
template
Commits
14ad512d
Commit
14ad512d
authored
Jul 12, 2021
by
michaelmcleroy
Browse files
feat(kubeconfig): update default name
parent
1b4eae90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
terraform/modules/k8s/main.tf
terraform/modules/k8s/main.tf
+4
-0
terraform/modules/k8s/variables.tf
terraform/modules/k8s/variables.tf
+6
-0
No files found.
terraform/modules/k8s/main.tf
View file @
14ad512d
...
...
@@ -15,6 +15,10 @@ resource "null_resource" "kubeconfig" {
# Merge new config into existing
export KUBECONFIGBAK=$KUBECONFIG
export KUBECONFIG=~/.kube/new:~/.kube/config
# Replace default with cluster name
sed -ri 's/: default$/: ${var.name}/g'
# Update user only with more info
sed -ri 's/(user|- name): ${var.name}$/\1: clusterUser_${var.name}/g' ~/.kube/new
# Do not redirect to ~/.kube/config or you may truncate the results
kubectl config view --flatten > ~/.kube/merged
mv -f ~/.kube/merged ~/.kube/config
...
...
terraform/modules/k8s/variables.tf
View file @
14ad512d
variable
"name"
{
description
=
"The name to apply to the resources"
type
=
string
default
=
"bigbang-dev"
}
variable
"kubeconfig_path"
{
description
=
"Remote path to kubeconfig"
type
=
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment