Skip to content

Commit e4ccfd8

Browse files
authored
Merge pull request #30 from ggtakec/update/k2hr3tenant
Added dbaas.k2hr3Tenant option
2 parents 6c43c39 + 93d8146 commit e4ccfd8

12 files changed

+38
-9
lines changed

.github/workflows/helm_template.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,8 +1010,8 @@ data:
10101010
#
10111011
# Make K2HR3 YRN for role and resource
10121012
#
1013-
K2HDKC_ROLE_YRN=${K2HR3_YRN_PREFIX}${K2HDKC_NAMESPACE}:role:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
1014-
K2HDKC_RESOURCE_YRN=${K2HR3_YRN_PREFIX}${K2HDKC_NAMESPACE}:resource:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
1013+
K2HDKC_ROLE_YRN=${K2HR3_YRN_PREFIX}${K2HR3_TENANT}:role:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
1014+
K2HDKC_RESOURCE_YRN=${K2HR3_YRN_PREFIX}${K2HR3_TENANT}:resource:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
10151015

10161016
#----------------------------------------------------------
10171017
# Save parameters for accessing to K2HR3

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following options/values are supported. See values.yaml for more detailed do
3434
| `dbaas.clusterName` | optional | Specify a cluster name for K2HDKC, default is empty. If not set, a name is Release name(.Release.Name). | "" |
3535
| `dbaas.startManual` | optional | Specifies whether to boot the k2hdkc processes manually. This is a flag for debugging. | false |
3636
| `dbaas.baseDomain` | optional | Specifies the base domain name for the k2hr3 cluster. The default is empty, if empty k8s.domain is used. | "" |
37+
| `dbaas.k2hr3Tenant` | optional | Specify K2HR3 tenant name for K2HDKC cluster. If empty, the namespace of kubernetes is set as default. | "" |
3738
| `dbaas.server.count` | optional | Specify the server count in K2HKDC cluster. | 2 |
3839
| `dbaas.server.port` | optional | Specify the port number for K2HDKC servers. | 8020 |
3940
| `dbaas.server.ctlport` | optional | Specify the control port number for K2HDKC servers. | 8021 |

files/dbaas-k2hdkc-variables-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ TAG_STRING=${K2HDKC_POD_NAME}
498498
#
499499
# Make K2HR3 YRN for role and resource
500500
#
501-
K2HDKC_ROLE_YRN=${K2HR3_YRN_PREFIX}${K2HDKC_NAMESPACE}:role:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
502-
K2HDKC_RESOURCE_YRN=${K2HR3_YRN_PREFIX}${K2HDKC_NAMESPACE}:resource:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
501+
K2HDKC_ROLE_YRN=${K2HR3_YRN_PREFIX}${K2HR3_TENANT}:role:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
502+
K2HDKC_RESOURCE_YRN=${K2HR3_YRN_PREFIX}${K2HR3_TENANT}:resource:${K2HDKC_CLUSTER_NAME}/${K2HDKC_MODE}
503503

504504
#----------------------------------------------------------
505505
# Save parameters for accessing to K2HR3

questions.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ questions:
5252
min_length: 0
5353
max_length: 1023
5454

55+
- variable: dbaas.k2hr3Tenant
56+
default: ""
57+
label: "K2HR3 Tenant name for K2HDKC cluster"
58+
description: "Specify K2HR3 tenant name for K2HDKC cluster. You can specify this if using custom OIDC and a tenant name outside the kubernets namespace. If empty, the namespace of kubernetes is set as default."
59+
type: string
60+
required: true
61+
group: "K2HR3 System to use"
62+
min_length: 0
63+
max_length: 1023
64+
5565
#
5666
# K2HDKC Server
5767
#

templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@
8383
{{- printf "%s" $tmpname }}
8484
{{- end }}
8585

86+
{{-
87+
/*---------------------------------------------------------
88+
* Set k2hr3 tenant name for dbaas.
89+
*
90+
*/}}
91+
{{- define "k2hdkc.k2hr3Tenant" -}}
92+
{{- $tmpname := default (include "k2hdkc.k8sNamespace" .) .Values.dbaas.k2hr3Tenant }}
93+
{{- printf "%s" $tmpname }}
94+
{{- end }}
95+
8696
{{-
8797
/*---------------------------------------------------------
8898
* Set base domain(fqdn) for dbaas.

templates/dbaas-k2hdkc-server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ spec:
158158
- name: K2HR3_API_URL
159159
value: "https://{{ include "k2hdkc.r3apiIntSvcFullname" . }}:{{ include "k2hdkc.r3apiIntPort" . }}"
160160
- name: K2HR3_TENANT
161-
value: "{{ include "k2hdkc.k8sNamespace" . }}"
161+
value: "{{ include "k2hdkc.k2hr3Tenant" . }}"
162162
- name: K2HDKC_DOMAIN
163163
value: "{{ include "k2hdkc.dbaasBaseDomain" . }}"
164164
- name: K2HDKC_CLUSTER_NAME

templates/dbaas-k2hdkc-setup-k2hr3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ spec:
8383
- name: K2HR3_API_URL
8484
value: "https://{{ include "k2hdkc.r3apiIntSvcFullname" . }}:{{ include "k2hdkc.r3apiIntPort" . }}"
8585
- name: K2HR3_TENANT
86-
value: "{{ include "k2hdkc.k8sNamespace" . }}"
86+
value: "{{ include "k2hdkc.k2hr3Tenant" . }}"
8787
- name: SEC_CA_MOUNTPOINT
8888
value: "{{ .Values.mountPoint.ca }}"
8989
- name: SEC_K2HR3_TOKEN_MOUNTPOINT

templates/dbaas-k2hdkc-slave.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ spec:
165165
- name: K2HR3_API_URL
166166
value: "https://{{ include "k2hdkc.r3apiIntSvcFullname" . }}:{{ include "k2hdkc.r3apiIntPort" . }}"
167167
- name: K2HR3_TENANT
168-
value: "{{ include "k2hdkc.k8sNamespace" . }}"
168+
value: "{{ include "k2hdkc.k2hr3Tenant" . }}"
169169
- name: K2HDKC_DOMAIN
170170
value: "{{ include "k2hdkc.dbaasBaseDomain" . }}"
171171
- name: K2HDKC_CLUSTER_NAME

templates/dbaas-k2hdkc-unsetup-k2hr3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ spec:
7979
- name: K2HR3_API_URL
8080
value: "https://{{ include "k2hdkc.r3apiIntSvcFullname" . }}:{{ include "k2hdkc.r3apiIntPort" . }}"
8181
- name: K2HR3_TENANT
82-
value: "{{ include "k2hdkc.k8sNamespace" . }}"
82+
value: "{{ include "k2hdkc.k2hr3Tenant" . }}"
8383
- name: SEC_CA_MOUNTPOINT
8484
value: "{{ .Values.mountPoint.ca }}"
8585
- name: SEC_K2HR3_TOKEN_MOUNTPOINT

templates/tests/dbaas-k2hdkc-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ spec:
8484
- name: K2HR3_API_URL
8585
value: "https://{{ include "k2hdkc.r3apiIntSvcFullname" . }}:{{ include "k2hdkc.r3apiIntPort" . }}"
8686
- name: K2HR3_TENANT
87-
value: "{{ include "k2hdkc.k8sNamespace" . }}"
87+
value: "{{ include "k2hdkc.k2hr3Tenant" . }}"
8888
- name: K2HDKC_DOMAIN
8989
value: "{{ include "k2hdkc.dbaasBaseDomain" . }}"
9090
- name: K2HDKC_CLUSTER_NAME

0 commit comments

Comments
 (0)