Skip to content

Commit def55a7

Browse files
feat(cf-vcluster): add template that calculates kubeconfig host dynamically based on ingress configuration (#120)
1 parent d3855a1 commit def55a7

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

charts/cf-vcluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: cf-vcluster
33
description: Umbrella chart over vCluster adjusted for Codefresh use cases - mainly in Crossplane compositions
44
type: application
5-
version: 0.28.0-0
5+
version: 0.28.0-1
66
appVersion: "0.28.0"
77
dependencies:
88
- name: vcluster

charts/cf-vcluster/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cf-vcluster
22

3-
![Version: 0.28.0-0](https://img.shields.io/badge/Version-0.28.0--0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.28.0](https://img.shields.io/badge/AppVersion-0.28.0-informational?style=flat-square)
3+
![Version: 0.28.0-1](https://img.shields.io/badge/Version-0.28.0--1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.28.0](https://img.shields.io/badge/AppVersion-0.28.0-informational?style=flat-square)
44

55
Umbrella chart over vCluster adjusted for Codefresh use cases - mainly in Crossplane compositions
66

@@ -45,6 +45,8 @@ Umbrella chart over vCluster adjusted for Codefresh use cases - mainly in Crossp
4545
| vcluster.controlPlane.proxy.extraSANs[1] | string | `"{{ tpl (printf \"%s.%s\" .Values.global.ingress.internal.host.name .Values.global.ingress.internal.host.domain) . }}"` | |
4646
| vcluster.controlPlane.proxy.extraSANs[2] | string | `"{{ tpl (printf \"%s.%s\" .Values.global.ingress.public.host.name .Values.global.ingress.public.host.domain) . }}"` | |
4747
| vcluster.experimental.deploy.vcluster.manifests | string | `"---\nkind: ClusterRoleBinding\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n name: oidc-cluster-admin\nroleRef:\n apiGroup: rbac.authorization.k8s.io\n kind: ClusterRole\n name: cluster-admin\nsubjects:\n- kind: Group\n name: [email protected]\n---\nkind: ClusterRoleBinding\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n name: oidc-cluster-admin-octopus\nroleRef:\n apiGroup: rbac.authorization.k8s.io\n kind: ClusterRole\n name: cluster-admin\nsubjects:\n- kind: Group\n name: 787d1a9a-e488-4a77-bb6c-f4b2fdfd8cea # Codefresh R&D Team\n- kind: Group\n name: 607a9f67-422c-4ca2-b8c4-d0be213b9650 # Codefresh SA Team\n- kind: Group\n name: f8de82e2-cdb6-480a-8f37-9f958ea5fef5 # Codefresh Support Team\n- kind: Group\n name: 16b3fb37-58f2-4786-8ca8-6f58d0410687 # Codefresh OSS Team\n- kind: Group\n name: dc35779f-57d5-4dff-90c0-34c6e93fe7e7 # Codefresh OSS Team\n---\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n name: codefresh-pipelines-integration-cluster-admin\n namespace: kube-system\n---\napiVersion: v1\nkind: Secret\nmetadata:\n name: codefresh-pipelines-integration-cluster-admin-token\n namespace: kube-system\n annotations:\n kubernetes.io/service-account.name: codefresh-pipelines-integration-cluster-admin\ntype: kubernetes.io/service-account-token\n---\nkind: ClusterRoleBinding\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n name: codefresh-pipelines-integration-cluster-admin\nroleRef:\n apiGroup: rbac.authorization.k8s.io\n kind: ClusterRole\n name: cluster-admin\nsubjects:\n- kind: ServiceAccount\n name: codefresh-pipelines-integration-cluster-admin\n namespace: kube-system"` | |
48+
| vcluster.exportKubeConfig.insecure | bool | `true` | |
49+
| vcluster.exportKubeConfig.server | string | `"{{- include \"cf-vcluster.kubeconfighost\" . -}}"` | Automatically calculate and set the kubeconfig host value based on ingress settings |
4850
| vcluster.rbac.clusterRole.enabled | bool | `true` | |
4951
| vcluster.sync.fromHost.ingressClasses.enabled | bool | `true` | |
5052
| vcluster.sync.fromHost.nodes.enabled | bool | `true` | |
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- define "cf-vcluster.kubeconfighost" -}}
2+
{{ if .Values.global.ingress.public.enabled -}}
3+
{{- tpl (printf "%s.%s" .Values.global.ingress.public.host.name .Values.global.ingress.public.host.domain ) . -}}
4+
{{- else if .Values.global.ingress.internal.enabled }}
5+
{{- tpl (printf "%s.%s" .Values.global.ingress.internal.host.name .Values.global.ingress.internal.host.domain) . -}}
6+
{{- else -}}
7+
{{- printf "%s.%s.svc.cluster.local" .Release.Name .Release.Namespace -}}
8+
{{- end -}}
9+
{{- end -}}

charts/cf-vcluster/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ global:
3232
domain: example.com
3333

3434
vcluster:
35+
exportKubeConfig:
36+
# -- Automatically calculate and set the kubeconfig host value based on ingress settings
37+
server: "{{- include \"cf-vcluster.kubeconfighost\" . -}}"
38+
insecure: true
3539
controlPlane:
3640
proxy:
3741
extraSANs:

0 commit comments

Comments
 (0)