Helm-Toolkit: Document kubernetes entrypoint macros

This PS adds documentation for the kubernetes entrypoint macros.

Change-Id: I1bec4d7a58878742462de624ebe0b77579759c09
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2018-09-13 07:36:21 -05:00 committed by Chris Wedgwood
parent f2271a60a6
commit b16b2707d8
2 changed files with 102 additions and 0 deletions

View File

@ -14,6 +14,81 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{/*
abstract: |
Returns a container definition for use with the kubernetes-entrypoint image
from stackanetes.
values: |
images:
tags:
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
pull_policy: IfNotPresent
local_registry:
active: true
exclude:
- dep_check
dependencies:
dynamic:
common:
local_image_registry:
jobs:
- calico-image-repo-sync
services:
- endpoint: node
service: local_image_registry
static:
calico_node:
services:
- endpoint: internal
service: etcd
endpoints:
local_image_registry:
namespace: docker-registry
hosts:
default: localhost
node: localhost
etcd:
hosts:
default: etcd
usage: |
{{ tuple . "calico_node" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" }}
return: |
- name: init
image: "quay.io/stackanetes/kubernetes-entrypoint:v0.3.1"
imagePullPolicy: IfNotPresent
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: INTERFACE_NAME
value: eth0
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
- name: DEPENDENCY_SERVICE
value: "default:etcd,docker-registry:localhost"
- name: DEPENDENCY_JOBS
value: "calico-image-repo-sync"
- name: DEPENDENCY_DAEMONSET
value: ""
- name: DEPENDENCY_CONTAINER
value: ""
- name: DEPENDENCY_POD_JSON
value: ""
- name: COMMAND
value: "echo done"
command:
- kubernetes-entrypoint
volumeMounts:
[]
*/}}
{{- define "helm-toolkit.snippets.kubernetes_entrypoint_init_container" -}}
{{- $envAll := index . 0 -}}
{{- $component := index . 1 -}}

View File

@ -14,6 +14,33 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{/*
abstract: |
Returns a comma seperated list of namespace:service pairs.
values: |
dependencies:
static:
api:
services:
- endpoint: internal
service: oslo_cache
- endpoint: internal
service: oslo_db
endpoints:
oslo_db:
namespace: foo
hosts:
default: mariadb
oslo_cache:
namespace: bar
hosts:
default: memcache
usage: |
{{ tuple .Values.dependencies.static.api.services . | include "helm-toolkit.utils.comma_joined_service_list" }}
return: |
bar:memcache,foo:mariadb
*/}}
{{- define "helm-toolkit.utils.comma_joined_service_list" -}}
{{- $deps := index . 0 -}}
{{- $envAll := index . 1 -}}