openstack-helm-addons/sonobuoy/templates/pod-api.yaml

119 lines
3.4 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" }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ $serviceAccountName }}
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $serviceAccountName }}-heptio-sonobuoy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ $serviceAccountName }}
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
- 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
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 }}