shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
394 stars 36 forks source link

Specifying the context for `helm` and `k8s-manifest` units #257

Closed kinseii closed 2 months ago

kinseii commented 3 months ago

What would you like to add Need to be able to specify the cluster context from the kubernetes configuration file. This corresponds to the parameter at the helm and kubectl providers:

Why is this needed Since we are using many clusters, it is not at all convenient to manually switch the context of a cluster.

romanprog commented 3 months ago

Will be implemented for the helm units in the next release.

This is already available for kubernetes unit type. See the provider_conf configuration block. provider_conf - configuration block that describes authorization in Kubernetes. Supports the same arguments as the Terraform Kubernetes provider. It is allowed to use the remoteState function and Cluster.dev templates within the block.

https://docs.cluster.dev/units-kubernetes/ for exfmple:

name: <UNIT_NAME>
type: kubernetes
source: <YAML_PATH>
provider_conf:
  host: k8s.example.com
  config_context: "dev-one"
kinseii commented 3 months ago

Awesome! I'll be waiting!

romanprog commented 3 months ago

I reopened the issue, it is still relevant for the helm unit.

romanprog commented 3 months ago

Also I just found an issue with this options in 'kubernetes' unit. The fix will be implemented today or tomorrow.

romanprog commented 3 months ago

@kinseii https://github.com/shalb/cluster.dev/releases/tag/v0.9.4 provider_conf now available for both helm and kubernetes units. See reference in docs https://docs.cluster.dev/units-helm/