Comments (2)
Hi @xunleii, regarding the k3s admin kubeconfig, I was looking for a way to tell rancher to generate a local kubeconfig with the correct context (custom cluster name), but probably this is available only with k3d.
For the second problem, your solution could work, thanks for the feedback.
from terraform-module-k3s.
Hello,
Sorry, I didn't understand the first part:
I'm looking for a method to set the cluster name in the kubeconfig file of k3s admin, particularly in situations where the kubeconfig is generated by Rancher.
How can the kubeconfig
be generated by Rancher using this module?
Apart from this point, my view is that it's an "advanced use" to modify the kubeconfig (even if it's simple) and must be done outside this module. It's entirely possible for the end user to generate a kubeconfig
from the values in the kubernetes
output, like the following (not tested)
module "k3s" {
...
}
local {
kubeconfig = yamlencode({
apiVersion = "v1"
kind = "Config"
current-context = "CLUSTER_NAME"
contexts = [{
context = {
cluster = "CLUSTER_NAME"
user : "CLUSTER_NAME_ADMIN"
}
name = "CLUSTER_NAME"
}]
clusters = [{
cluster = {
certificate-authority-data = base64encode(module.k3s.kubernetes.cluster_ca_certificate)
server = module.k3s.kubernetes.api_endpoint
}
name = "CLUSTER_NAME"
}]
users = [{
user = {
client-certificate-data : base64encode(module.k3s.kubernetes.client_certificate)
client-key-data : base64encode(module.k3s.kubernetes.client_key)
}
name : "CLUSTER_NAME_ADMIN"
}]
})
}
However, is needed to explain how to do this in the documentation.
from terraform-module-k3s.
Related Issues (20)
- Error: Invalid Attribute Value Match HOT 4
- Generated kubeconfig cannot be used (certificate signed by unknown authority) HOT 3
- Deprecated attribute with Terraform 1.3.7 HOT 1
- API URL broken in build script when using dual stack configs HOT 4
- hcloud-k3s doesnt work with v3.3.0 HOT 1
- K3s Cluster Node(s) Upgrade HOT 8
- Consider Integration Testing with k3d HOT 5
- cdktf compatibility HOT 2
- Error "Variable `name` is deprecated" HOT 1
- terraform destroy gets stuck while draining the last node HOT 3
- Taking a node out of the configuration keeps the node within the cluster but cordoned HOT 8
- 🚧 Refresh this repository
- Refresh kubeconfig when terraform state is lost HOT 3
- When generate_ca_certificates = false, module does not export any kubeconfig HOT 3
- :bug: Cannot scale up server nodes HOT 3
- Support for K3S AirGap deployments HOT 2
- Error sensitive var.servers HOT 1
- Cluster CA certificate is not trusted HOT 7
- Unable to use on Windows Terraform HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-module-k3s.