Addons repository for OpenStack Helm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pod-api.yaml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {{/*
  2. Copyright 2017 The Openstack-Helm Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */}}
  13. {{- if .Values.manifests.pod_api }}
  14. {{- $envAll := . }}
  15. {{- $serviceAccountName := "sonobuoy-serviceaccount" }}
  16. {{ tuple $envAll "sonobuoy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
  17. ---
  18. apiVersion: rbac.authorization.k8s.io/v1
  19. kind: ClusterRole
  20. metadata:
  21. name: {{ $serviceAccountName }}
  22. rules:
  23. - apiGroups:
  24. - '*'
  25. resources:
  26. - '*'
  27. verbs:
  28. - '*'
  29. ---
  30. apiVersion: rbac.authorization.k8s.io/v1
  31. kind: ClusterRoleBinding
  32. metadata:
  33. name: {{ $serviceAccountName }}-heptio-sonobuoy
  34. roleRef:
  35. apiGroup: rbac.authorization.k8s.io
  36. kind: ClusterRole
  37. name: {{ $serviceAccountName }}
  38. subjects:
  39. - kind: ServiceAccount
  40. name: {{ $serviceAccountName }}
  41. namespace: {{ $envAll.Release.Namespace }}
  42. ---
  43. apiVersion: v1
  44. kind: Pod
  45. metadata:
  46. labels:
  47. {{ tuple $envAll "sonobuoy" "sonobuoy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
  48. run: sonobuoy-master
  49. tier: analysis
  50. name: sonobuoy
  51. annotations:
  52. "helm.sh/hook": test-success
  53. spec:
  54. nodeSelector:
  55. {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value}}
  56. initContainers:
  57. {{ tuple $envAll "sonobuoy" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
  58. containers:
  59. - name: kube-sonobuoy
  60. env:
  61. - name: SONOBUOY_ADVERTISE_IP
  62. valueFrom:
  63. fieldRef:
  64. fieldPath: status.podIP
  65. {{ tuple $envAll "sonobuoy_api" | include "helm-toolkit.snippets.image" | indent 4 }}
  66. command:
  67. - /run_master.sh
  68. volumeMounts:
  69. - mountPath: /etc/sonobuoy
  70. name: sonobuoy-config-volume
  71. - mountPath: /plugins.d
  72. name: sonobuoy-plugins-volume
  73. - mountPath: {{ .Values.conf.sonobuoy.ResultsDir }}
  74. name: sonobuoy-output
  75. - name: sonobuoy-bin
  76. mountPath: /run_master.sh
  77. subPath: run_master.sh
  78. readOnly: true
  79. {{- if $envAll.Values.conf.publish_results }}
  80. - name: results-publisher
  81. {{ tuple $envAll "results_publisher" | include "helm-toolkit.snippets.image" | indent 4 }}
  82. env:
  83. {{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.sonobuoy }}
  84. {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 4 }}
  85. {{- end }}
  86. - name: RESULTS_DIR
  87. value: {{ .Values.conf.sonobuoy.ResultsDir }}
  88. command:
  89. - /publish_results.sh
  90. volumeMounts:
  91. - name: sonobuoy-bin
  92. mountPath: /publish_results.sh
  93. subPath: publish_results.sh
  94. readOnly: true
  95. - mountPath: {{ .Values.conf.sonobuoy.ResultsDir }}
  96. name: sonobuoy-output
  97. {{- end }}
  98. restartPolicy: Never
  99. serviceAccountName: {{ $serviceAccountName }}
  100. volumes:
  101. - name: sonobuoy-bin
  102. configMap:
  103. name: sonobuoy-bin
  104. defaultMode: 0555
  105. - secret:
  106. secretName: sonobuoy-etc
  107. defaultMode: 0444
  108. name: sonobuoy-config-volume
  109. - configMap:
  110. name: sonobuoy-plugins
  111. defaultMode: 0444
  112. name: sonobuoy-plugins-volume
  113. - emptyDir: {}
  114. name: sonobuoy-output
  115. {{- end }}