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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. - name: results-publisher
  80. {{ tuple $envAll "results_publisher" | include "helm-toolkit.snippets.image" | indent 4 }}
  81. env:
  82. {{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.sonobuoy }}
  83. {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 4 }}
  84. {{- end }}
  85. - name: RESULTS_DIR
  86. value: {{ .Values.conf.sonobuoy.ResultsDir }}
  87. command:
  88. - /publish_results.sh
  89. volumeMounts:
  90. - name: sonobuoy-bin
  91. mountPath: /publish_results.sh
  92. subPath: publish_results.sh
  93. readOnly: true
  94. - mountPath: {{ .Values.conf.sonobuoy.ResultsDir }}
  95. name: sonobuoy-output
  96. restartPolicy: Never
  97. serviceAccountName: {{ $serviceAccountName }}
  98. volumes:
  99. - name: sonobuoy-bin
  100. configMap:
  101. name: sonobuoy-bin
  102. defaultMode: 0555
  103. - secret:
  104. secretName: sonobuoy-etc
  105. defaultMode: 0444
  106. name: sonobuoy-config-volume
  107. - configMap:
  108. name: sonobuoy-plugins
  109. defaultMode: 0444
  110. name: sonobuoy-plugins-volume
  111. - emptyDir: {}
  112. name: sonobuoy-output
  113. {{- end }}