123 lines
3.6 KiB
YAML
123 lines
3.6 KiB
YAML
{{/*
|
|
Copyright 2017 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.pod_api }}
|
|
{{- $envAll := . }}
|
|
|
|
{{- $serviceAccountName := "sonobuoy-serviceaccount" }}
|
|
{{ tuple $envAll "sonobuoy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
|
|
|
{{ $controllerName := printf "%s-%s" .Release.Namespace $serviceAccountName }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ $controllerName | quote }}
|
|
rules:
|
|
- apiGroups:
|
|
- '*'
|
|
resources:
|
|
- '*'
|
|
verbs:
|
|
- '*'
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: {{ $controllerName | quote }}
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: {{ $controllerName | quote }}
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: {{ $serviceAccountName }}
|
|
namespace: {{ $envAll.Release.Namespace }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
labels:
|
|
{{ tuple $envAll "sonobuoy" "sonobuoy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
|
run: sonobuoy-master
|
|
tier: analysis
|
|
name: sonobuoy
|
|
annotations:
|
|
"helm.sh/hook": test-success
|
|
spec:
|
|
nodeSelector:
|
|
{{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value}}
|
|
initContainers:
|
|
{{ tuple $envAll "sonobuoy" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
|
|
containers:
|
|
- name: kube-sonobuoy
|
|
env:
|
|
- name: SONOBUOY_ADVERTISE_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
{{ tuple $envAll "sonobuoy_api" | include "helm-toolkit.snippets.image" | indent 4 }}
|
|
command:
|
|
- /run_master.sh
|
|
volumeMounts:
|
|
- mountPath: /etc/sonobuoy
|
|
name: sonobuoy-config-volume
|
|
- mountPath: /plugins.d
|
|
name: sonobuoy-plugins-volume
|
|
- mountPath: {{ .Values.conf.sonobuoy.ResultsDir }}
|
|
name: sonobuoy-output
|
|
- name: sonobuoy-bin
|
|
mountPath: /run_master.sh
|
|
subPath: run_master.sh
|
|
readOnly: true
|
|
{{- if $envAll.Values.conf.publish_results }}
|
|
- name: results-publisher
|
|
{{ tuple $envAll "results_publisher" | include "helm-toolkit.snippets.image" | indent 4 }}
|
|
env:
|
|
{{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.sonobuoy }}
|
|
{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 4 }}
|
|
{{- end }}
|
|
- name: RESULTS_DIR
|
|
value: {{ .Values.conf.sonobuoy.ResultsDir }}
|
|
command:
|
|
- /publish_results.sh
|
|
volumeMounts:
|
|
- name: sonobuoy-bin
|
|
mountPath: /publish_results.sh
|
|
subPath: publish_results.sh
|
|
readOnly: true
|
|
- mountPath: {{ .Values.conf.sonobuoy.ResultsDir }}
|
|
name: sonobuoy-output
|
|
{{- end }}
|
|
restartPolicy: Never
|
|
serviceAccountName: {{ $serviceAccountName }}
|
|
volumes:
|
|
- name: sonobuoy-bin
|
|
configMap:
|
|
name: sonobuoy-bin
|
|
defaultMode: 0555
|
|
- secret:
|
|
secretName: sonobuoy-etc
|
|
defaultMode: 0444
|
|
name: sonobuoy-config-volume
|
|
- configMap:
|
|
name: sonobuoy-plugins
|
|
defaultMode: 0444
|
|
name: sonobuoy-plugins-volume
|
|
- emptyDir: {}
|
|
name: sonobuoy-output
|
|
{{- end }}
|