Add Sonobuoy plugin config from yaml

Adds a yaml path for providing additional yaml that will be stored in a
secret and provided to the plugin. Values can be added to plugin_values
that will result in being needed configuration and expected values
for tests. Utilizes the extra-volumes functionality as described [0]

[0]: https://github.com/heptio/sonobuoy/blob/master/docs/plugins.md#writing-your-own-plugin

Change-Id: I41d9bc02c8c0154903366a4cdcd287b95ea9707a
This commit is contained in:
Bryan Strassner 2019-04-10 12:45:16 -05:00
parent 77abfeb526
commit bade4e06ce
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,29 @@
{{/*
Copyright 2019 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.secret_plugin_values }}
---
apiVersion: v1
kind: Secret
metadata:
name: plugin-values
type: Opaque
data:
{{- range $key, $value := .Values.conf.plugin_values }}
{{ $key -}}: |-
{{ $value | toYaml | b64enc | indent 4 -}}
{{- end }}
{{- end }}

View File

@ -97,10 +97,32 @@ manifests:
pod_api: true
secret_etc: true
secret_keystone: true
secret_plugin_values: true
serviceaccount_readonly: false
conf:
publish_results: true
# Injected values root used by (some of) the plugins. This `plugin_values`
# root is the parent for a mapping of named sections, each of which will be
# added as a file in the plugin-values secret.
#
# Plugins will be responsible for mounting the appropriate information,
# e.g. as /etc/test/<filename> to the plugin container(s) as appropriate.
#
# A default entry/file will be supplied, but is expected to be overridden by
# deployment.
#
# In the case of supplying this info to the plugin(s), each plugin will need
# to do the mounting of the secret into the correct place, similar to what is
# shown in this values file at conf.plugins[0].data.spec.volumeMounts, and
# conf.plugins[0].data.extra-volumes
#
# Each entry under plugin-values needs to be keyed by the filename for that
# set of values. The yaml mapped by each filename will be the contents of
# the file.
plugin_values:
demo:
placeholder: value
swift:
container_name: sonobuoy
# delete objects after 1 month (60 * 60 * 24 * 30 seconds)
@ -164,3 +186,11 @@ conf:
- mountPath: /node
name: root
readOnly: false
- mountPath: /etc/test
name: configured-values
readOnly: true
extra-volumes:
- name: configured-values
secret:
secretName: plugin-values
defaultMode: 444