Helm-Toolkit: update comments for endpoint lookup functions
This PS updates the comments for endpoint lookup functions Change-Id: Ifdc96acaac6972c10f6a580eaf37629910a955a5 Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
parent
0624466a9f
commit
98f5276e16
helm-toolkit/templates/endpoints
_authenticated_endpoint_uri_lookup.tpl_endpoint_port_lookup.tpl_host_and_port_endpoint_uri_lookup.tpl_hostname_fqdn_endpoint_lookup.tpl_hostname_namespaced_endpoint_lookup.tpl_hostname_short_endpoint_lookup.tpl_keystone_endpoint_name_lookup.tpl_keystone_endpoint_path_lookup.tpl_keystone_endpoint_scheme_lookup.tpl_keystone_endpoint_uri_lookup.tpl_service_name_endpoint_with_namespace_lookup.tpl
@ -14,13 +14,34 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function helps resolve database style endpoints:
|
{{/*
|
||||||
#
|
abstract: |
|
||||||
# Presuming that .Values contains an endpoint: definition for 'neutron-db' with the
|
Resolves database, or basic auth, style endpoints
|
||||||
# appropriate attributes, a call such as:
|
values: |
|
||||||
# { tuple "neutron-db" "internal" "userClass" "portName" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" }
|
endpoints:
|
||||||
# where portName is optional if a default port has been defined in .Values
|
cluster_domain_suffix: cluster.local
|
||||||
# returns: mysql+pymysql://username:password@internal_host:3306/dbname
|
oslo_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: root
|
||||||
|
password: password
|
||||||
|
service_username:
|
||||||
|
username: username
|
||||||
|
password: password
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path: /dbname
|
||||||
|
scheme: mysql+pymysql
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "service_username" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" }}
|
||||||
|
return: |
|
||||||
|
mysql+pymysql://serviceuser:password@mariadb.default.svc.cluster.local:3306/dbname
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
|
{{- define "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,13 +14,21 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns hostnames from endpoint definitions for use cases
|
{{/*
|
||||||
# where the uri style return is not appropriate, and only the hostname
|
abstract: |
|
||||||
# portion is used or relevant in the template:
|
Resolves the port for an endpoint
|
||||||
# { tuple "memcache" "internal" "portName" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }
|
values: |
|
||||||
# returns: internal_host:port
|
endpoints:
|
||||||
#
|
cluster_domain_suffix: cluster.local
|
||||||
# Output that requires the port aspect striped could simply split the output based on ':'
|
oslo_db:
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
|
return: |
|
||||||
|
3306
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.endpoint_port_lookup" -}}
|
{{- define "helm-toolkit.endpoints.endpoint_port_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,13 +14,25 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns hostnames from endpoint definitions for use cases
|
{{/*
|
||||||
# where the uri style return is not appropriate, and only the hostname
|
abstract: |
|
||||||
# portion is used or relevant in the template:
|
Resolves 'hostname:port' for an endpoint
|
||||||
# { tuple "memcache" "internal" "portName" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }
|
values: |
|
||||||
# returns: internal_host:port
|
endpoints:
|
||||||
#
|
cluster_domain_suffix: cluster.local
|
||||||
# Output that requires the port aspect striped could simply split the output based on ':'
|
oslo_db:
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
|
||||||
|
return: |
|
||||||
|
mariadb.default.svc.cluster.local:3306
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" -}}
|
{{- define "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,11 +14,22 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns hostnames from endpoint definitions for use cases
|
{{/*
|
||||||
# where the uri style return is not appropriate, and only the hostname
|
abstract: |
|
||||||
# portion is used or relevant in the template:
|
Resolves the fully qualified hostname for an endpoint
|
||||||
# { tuple "memcache" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }
|
values: |
|
||||||
# returns: internal_host_fqdn
|
endpoints:
|
||||||
|
cluster_domain_suffix: cluster.local
|
||||||
|
oslo_db:
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
|
||||||
|
return: |
|
||||||
|
mariadb.default.svc.cluster.local
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" -}}
|
{{- define "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,11 +14,21 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns hostnames from endpoint definitions for use cases
|
{{/*
|
||||||
# where the uri style return is not appropriate, and only the hostname
|
abstract: |
|
||||||
# portion is used or relevant in the template:
|
Resolves the namespace scoped hostname for an endpoint
|
||||||
# { tuple "memcache" "internal" . | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }
|
values: |
|
||||||
# returns: internal_host_namespaced
|
endpoints:
|
||||||
|
oslo_db:
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
|
||||||
|
return: |
|
||||||
|
mariadb.default
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" -}}
|
{{- define "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,11 +14,21 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns hostnames from endpoint definitions for use cases
|
{{/*
|
||||||
# where the uri style return is not appropriate, and only the short hostname or
|
abstract: |
|
||||||
# kubernetes servicename is used or relevant in the template:
|
Resolves the short hostname for an endpoint
|
||||||
# { tuple "memcache" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }
|
values: |
|
||||||
# returns: the short internal hostname, which will also match the service name
|
endpoints:
|
||||||
|
oslo_db:
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
return: |
|
||||||
|
mariadb
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.hostname_short_endpoint_lookup" -}}
|
{{- define "helm-toolkit.endpoints.hostname_short_endpoint_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,10 +14,18 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function is used in endpoint management templates
|
{{/*
|
||||||
# it returns the service type for an openstack service eg:
|
abstract: |
|
||||||
# { tuple orchestration . | include "keystone_endpoint_name_lookup" }
|
Resolves the service name for an service type
|
||||||
# will return "heat"
|
values: |
|
||||||
|
endpoints:
|
||||||
|
identity:
|
||||||
|
name: keystone
|
||||||
|
usage: |
|
||||||
|
{{ tuple identity . | include "keystone_endpoint_name_lookup" }}
|
||||||
|
return: |
|
||||||
|
"keystone"
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.keystone_endpoint_name_lookup" -}}
|
{{- define "helm-toolkit.endpoints.keystone_endpoint_name_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,10 +14,26 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns the path for a service, it takes an tuple
|
# FIXME(portdirect): it appears the port input here serves no purpose,
|
||||||
# input in the form: service-type, endpoint-class, port-name. eg:
|
# and should be removed. In addition this function is bugged, do we use it?
|
||||||
# { tuple "orchestration" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }
|
|
||||||
# will return the appropriate path.
|
{{/*
|
||||||
|
abstract: |
|
||||||
|
Resolves the path for an endpoint
|
||||||
|
values: |
|
||||||
|
endpoints:
|
||||||
|
cluster_domain_suffix: cluster.local
|
||||||
|
oslo_db:
|
||||||
|
path:
|
||||||
|
default: /dbname
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
|
||||||
|
return: |
|
||||||
|
/dbname
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.keystone_endpoint_path_lookup" -}}
|
{{- define "helm-toolkit.endpoints.keystone_endpoint_path_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,6 +14,28 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
# FIXME(portdirect): it appears the port input here serves no purpose,
|
||||||
|
# and should be removed. In addition this function is bugged, do we use it?
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
abstract: |
|
||||||
|
Resolves the scheme for an endpoint
|
||||||
|
values: |
|
||||||
|
endpoints:
|
||||||
|
cluster_domain_suffix: cluster.local
|
||||||
|
oslo_db:
|
||||||
|
scheme:
|
||||||
|
default:
|
||||||
|
mysql+pymysql
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
|
||||||
|
return: |
|
||||||
|
mysql+pymysql
|
||||||
|
*/}}
|
||||||
|
|
||||||
# This function returns the scheme for a service, it takes an tuple
|
# This function returns the scheme for a service, it takes an tuple
|
||||||
# input in the form: service-type, endpoint-class, port-name. eg:
|
# input in the form: service-type, endpoint-class, port-name. eg:
|
||||||
# { tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.keystone_scheme_lookup" }
|
# { tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.keystone_scheme_lookup" }
|
||||||
|
@ -14,10 +14,27 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns the endpoint uri for a service, it takes an tuple
|
{{/*
|
||||||
# input in the form: service-type, endpoint-class, port-name. eg:
|
abstract: |
|
||||||
# { tuple "orchestration" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }
|
This function helps resolve uri style endpoints
|
||||||
# will return the appropriate URI.
|
values: |
|
||||||
|
endpoints:
|
||||||
|
cluster_domain_suffix: cluster.local
|
||||||
|
oslo_db:
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path: /dbname
|
||||||
|
scheme: mysql+pymysql
|
||||||
|
port:
|
||||||
|
mysql:
|
||||||
|
default: 3306
|
||||||
|
usage: |
|
||||||
|
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
|
||||||
|
return: |
|
||||||
|
mysql+pymysql://mariadb.default.svc.cluster.local:3306/dbname
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" -}}
|
{{- define "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
@ -14,16 +14,32 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
# This function returns endpoint "<namespace>:<name>" pair from an endpoint
|
{{/*
|
||||||
# definition. This is used in kubernetes-entrypoint to support dependencies
|
abstract: |
|
||||||
# between different services in different namespaces.
|
This function returns endpoint "<namespace>:<name>" pair from an endpoint
|
||||||
# returns: the endpoint namespace and the service name, delimited by a colon
|
definition. This is used in kubernetes-entrypoint to support dependencies
|
||||||
#
|
between different services in different namespaces.
|
||||||
# Normally, the service name is constructed dynamically from the hostname
|
returns: the endpoint namespace and the service name, delimited by a colon
|
||||||
# however when an ip address is used as the hostname, we default to
|
|
||||||
# namespace:endpointCategoryName in order to construct a valid service name
|
Normally, the service name is constructed dynamically from the hostname
|
||||||
# however this can be overridden to a custom service name by defining
|
however when an ip address is used as the hostname, we default to
|
||||||
# .service.name within the endpoint definition
|
namespace:endpointCategoryName in order to construct a valid service name
|
||||||
|
however this can be overridden to a custom service name by defining
|
||||||
|
.service.name within the endpoint definition
|
||||||
|
values: |
|
||||||
|
endpoints:
|
||||||
|
cluster_domain_suffix: cluster.local
|
||||||
|
oslo_db:
|
||||||
|
namespace: foo
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
usage: |
|
||||||
|
{{ tuple oslo_db internal . | include "helm-toolkit.endpoints.service_name_endpoint_with_namespace_lookup" }}
|
||||||
|
return: |
|
||||||
|
foo:mariadb
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{- define "helm-toolkit.endpoints.service_name_endpoint_with_namespace_lookup" -}}
|
{{- define "helm-toolkit.endpoints.service_name_endpoint_with_namespace_lookup" -}}
|
||||||
{{- $type := index . 0 -}}
|
{{- $type := index . 0 -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user