cassandra-schema-job.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {{- if .Values.collector.enabled -}}
  2. {{- if eq .Values.storage.type "cassandra" -}}
  3. {{- if .Values.storage.cassandra.schemaJobEnabled -}}
  4. apiVersion: batch/v1
  5. kind: Job
  6. metadata:
  7. name: {{ include "jaeger.fullname" . }}-cassandra-schema
  8. labels:
  9. {{- include "jaeger.labels" . | nindent 4 }}
  10. app.kubernetes.io/component: cassandra-schema
  11. {{- if .Values.schema.annotations }}
  12. annotations:
  13. {{- toYaml .Values.schema.annotations | nindent 4 }}
  14. {{- end }}
  15. spec:
  16. activeDeadlineSeconds: {{ .Values.schema.activeDeadlineSeconds }}
  17. template:
  18. metadata:
  19. name: {{ include "jaeger.fullname" . }}-cassandra-schema
  20. {{- if .Values.schema.podAnnotations }}
  21. annotations:
  22. {{- toYaml .Values.schema.podAnnotations | nindent 8 }}
  23. {{- end }}
  24. {{- if .Values.schema.podLabels }}
  25. labels:
  26. {{- toYaml .Values.schema.podLabels | nindent 8 }}
  27. {{- end }}
  28. spec:
  29. securityContext:
  30. {{- toYaml .Values.schema.podSecurityContext | nindent 8 }}
  31. serviceAccountName: {{ template "jaeger.cassandraSchema.serviceAccountName" . }}
  32. {{- with .Values.schema.imagePullSecrets }}
  33. imagePullSecrets:
  34. {{- toYaml . | nindent 8 }}
  35. {{- end }}
  36. containers:
  37. - name: {{ include "jaeger.fullname" . }}-cassandra-schema
  38. image: {{ .Values.schema.image }}:{{- include "jaeger.image.tag" . }}
  39. imagePullPolicy: {{ .Values.schema.pullPolicy }}
  40. securityContext:
  41. {{- toYaml .Values.schema.securityContext | nindent 10 }}
  42. env:
  43. {{- if .Values.schema.extraEnv }}
  44. {{- toYaml .Values.schema.extraEnv | nindent 10 }}
  45. {{- end }}
  46. {{ range $key, $value := .Values.schema.env }}
  47. - name: {{ $key | quote }}
  48. value: {{ $value | quote }}
  49. {{ end }}
  50. {{- include "cassandra.env" . | nindent 10 }}
  51. - name: CQLSH_HOST
  52. value: {{ template "cassandra.host" . }}
  53. {{ if .Values.storage.cassandra.tls.enabled }}
  54. - name: CQLSH_SSL
  55. value: "--ssl"
  56. {{- end }}
  57. - name: DATACENTER
  58. value: {{ .Values.cassandra.config.dc_name | quote }}
  59. {{- if .Values.storage.cassandra.keyspace }}
  60. - name: KEYSPACE
  61. value: {{ .Values.storage.cassandra.keyspace }}
  62. {{- end }}
  63. resources:
  64. {{- toYaml .Values.schema.resources | nindent 10 }}
  65. volumeMounts:
  66. {{- range .Values.schema.extraConfigmapMounts }}
  67. - name: {{ .name }}
  68. mountPath: {{ .mountPath }}
  69. subPath: {{ .subPath }}
  70. readOnly: {{ .readOnly }}
  71. {{- end }}
  72. {{- if .Values.storage.cassandra.tls.enabled }}
  73. - name: {{ .Values.storage.cassandra.tls.secretName }}
  74. mountPath: "/root/.cassandra/ca-cert.pem"
  75. subPath: "ca-cert.pem"
  76. readOnly: true
  77. - name: {{ .Values.storage.cassandra.tls.secretName }}
  78. mountPath: "/root/.cassandra/client-cert.pem"
  79. subPath: "client-cert.pem"
  80. readOnly: true
  81. - name: {{ .Values.storage.cassandra.tls.secretName }}
  82. mountPath: "/root/.cassandra/client-key.pem"
  83. subPath: "client-key.pem"
  84. readOnly: true
  85. - name: {{ .Values.storage.cassandra.tls.secretName }}
  86. mountPath: "/root/.cassandra/cqlshrc"
  87. subPath: "cqlshrc"
  88. readOnly: true
  89. {{- end }}
  90. restartPolicy: OnFailure
  91. volumes:
  92. {{- range .Values.schema.extraConfigmapMounts }}
  93. - name: {{ .name }}
  94. configMap:
  95. name: {{ .configMap }}
  96. {{- end }}
  97. {{- if .Values.storage.cassandra.tls.enabled }}
  98. - name: {{ .Values.storage.cassandra.tls.secretName }}
  99. secret:
  100. secretName: {{ .Values.storage.cassandra.tls.secretName }}
  101. {{- end }}
  102. {{- end -}}
  103. {{- end -}}
  104. {{- end -}}