mirror of https://github.com/helm/helm
This feature adds the ability to selectively control the loading of charts using entries in top chart's values. When 'helm install --set tags.mytag=true', charts with that tag will be enabled unless disabled in parent by condition. When 'helm install --set mychart.enabled=true', charts with that yaml path specified will be enabled. Closes #1837pull/1917/head
parent
1fda4e8a60
commit
8ef733ca7d
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: parentchart
|
||||
version: 0.1.0
|
@ -0,0 +1,18 @@
|
||||
## Subpop
|
||||
|
||||
This chart is for testing the processing of enabled/disabled charts
|
||||
via conditions and tags.
|
||||
|
||||
Currently there are three levels:
|
||||
|
||||
````
|
||||
parent
|
||||
-1 tags: front-end, subchart1
|
||||
--A tags: front-end, subchartA
|
||||
--B tags: front-end, subchartB
|
||||
-2 tags: back-end, subchart2
|
||||
--B tags: back-end, subchartB
|
||||
--C tags: back-end, subchartC
|
||||
````
|
||||
|
||||
Tags and conditions are currently in requirements.yaml files.
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subchart1
|
||||
version: 0.1.0
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subcharta
|
||||
version: 0.1.0
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subchartb
|
||||
version: 0.1.0
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,15 @@
|
||||
dependencies:
|
||||
- name: subcharta
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subcharta.enabled,subchart1.subcharta.enabled
|
||||
tags:
|
||||
- front-end
|
||||
- subcharta
|
||||
- name: subchartb
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subchartb.enabled
|
||||
tags:
|
||||
- front-end
|
||||
- subchartb
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subchart2
|
||||
version: 0.1.0
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subchartb
|
||||
version: 0.1.0
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchart2-{{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: subchart2-{{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Kubernetes
|
||||
name: subchartc
|
||||
version: 0.1.0
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,15 @@
|
||||
dependencies:
|
||||
- name: subchartb
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subchartb.enabled,subchart2.subchartb.enabled
|
||||
tags:
|
||||
- back-end
|
||||
- subchartb
|
||||
- name: subchartc
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subchartc.enabled
|
||||
tags:
|
||||
- back-end
|
||||
- subchartc
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.externalPort }}
|
||||
targetPort: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.service.name }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
@ -0,0 +1,21 @@
|
||||
# Default values for subchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
repository: nginx
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
name: nginx
|
||||
type: ClusterIP
|
||||
externalPort: 80
|
||||
internalPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
@ -0,0 +1,15 @@
|
||||
dependencies:
|
||||
- name: subchart1
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subchart1.enabled
|
||||
tags:
|
||||
- front-end
|
||||
- subchart1
|
||||
- name: subchart2
|
||||
repository: http://localhost:10191
|
||||
version: 0.1.0
|
||||
condition: subchart2.enabled
|
||||
tags:
|
||||
- back-end
|
||||
- subchart2
|
@ -0,0 +1,7 @@
|
||||
# parent/values.yaml
|
||||
|
||||
# switch-like
|
||||
tags:
|
||||
front-end: true
|
||||
back-end: false
|
||||
|
Loading…
Reference in new issue