mirror of
https://github.com/bitnami/charts.git
synced 2026-08-10 14:15:55 +08:00
[bitnami/dremio] feat: 🎉 Add chart (#27453)
Description of the change This PR adds the chart for Dremio OSS, based on the upstream dremio chart. Features: - BItnami standards - Full configuration using the upstream Dremio configuration - Use of indirect environment variables in configuration - Master coordinator, Coordinator and Executor (with multiple engines) - TLS for the web interface (the only one allowed in Dremio OSS) --------- Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
co-authored by
Bitnami Containers
parent
6d60b9ed4f
commit
6c83fe915c
@@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
username: 'vib_user',
|
||||
password: 'ComplicatedPassword!1234',
|
||||
postgresql_host: 'postgresql',
|
||||
postgresql_user: 'postgres',
|
||||
postgresql_db: 'vib_test',
|
||||
postgresql_password: 'password123',
|
||||
},
|
||||
defaultCommandTimeout: 30000,
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {},
|
||||
baseUrl: 'http://localhost',
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright Broadcom, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: APACHE-2.0
|
||||
*/
|
||||
|
||||
/// <reference types="cypress" />
|
||||
import {
|
||||
random,
|
||||
} from '../support/utils';
|
||||
|
||||
it('Allows to import a PostgreSQL database and perform a query', () => {
|
||||
cy.login();
|
||||
// Go to the collections page
|
||||
cy.contains('Add Source').click();
|
||||
cy.contains('PostgreSQL').click();
|
||||
cy.fixture('database').then((d) => {
|
||||
cy.get('#name').should('be.enabled').clear({force: true}).type(`${d.database.name}${random}`);
|
||||
// Cannot use # because of the middle dot
|
||||
cy.get('[id="config.hostname"]').should('be.enabled').clear({force: true}).type(Cypress.env('postgresql_host'));
|
||||
cy.get('[id="config.databaseName"]').should('be.enabled').clear({force: true}).type(Cypress.env('postgresql_db'));
|
||||
cy.get('[id="config.username"]').should('be.enabled').clear({force: true}).type(Cypress.env('postgresql_user'));
|
||||
cy.get('[id="config.password"]').should('be.enabled').clear({force: true}).type(Cypress.env('postgresql_password'));
|
||||
cy.contains('Save').click();
|
||||
cy.get(`[href*="source/${d.database.name}${random}"]`);
|
||||
// Does not have text as it is an icon, so we need to use the href selector
|
||||
cy.get('[href*="new_query"]').click();
|
||||
// Ensure the editor is fully loaded
|
||||
cy.contains(`${d.database.name}${random}`).click();
|
||||
cy.contains('public').click();
|
||||
cy.contains(d.database.expectedRes);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"database": {
|
||||
"name": "vib_psql",
|
||||
"expectedRes": "cars"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright Broadcom, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: APACHE-2.0
|
||||
*/
|
||||
|
||||
const COMMAND_DELAY = 2000;
|
||||
|
||||
for (const command of ['click']) {
|
||||
Cypress.Commands.overwrite(command, (originalFn, ...args) => {
|
||||
const origVal = originalFn(...args);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(origVal);
|
||||
}, COMMAND_DELAY);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Cypress.Commands.add(
|
||||
'login',
|
||||
(username = Cypress.env('username'), password = Cypress.env('password')) => {
|
||||
cy.visit('/login');
|
||||
cy.get('#userName').should('be.enabled').clear({force: true}).type(username);
|
||||
cy.get('#password').should('be.enabled').clear({force: true}).type(password);
|
||||
cy.contains('Log In').click();
|
||||
cy.contains('Datasets');
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.on('uncaught:exception', (err) => {
|
||||
if (err.message.includes('Cannot read properties of')) {
|
||||
return false;
|
||||
}
|
||||
if (err.message.includes('Normalize accepts')) {
|
||||
return false;
|
||||
}
|
||||
// We expect an error "Failed to execute 'observe' on 'IntersectionObserver'"
|
||||
// during the installation of a template so we add an exception
|
||||
if (err.message.includes("Failed to execute 'observe' on 'IntersectionObserver'")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// we still want to ensure there are no other unexpected
|
||||
// errors, so we let them fail the test
|
||||
})
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright Broadcom, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: APACHE-2.0
|
||||
*/
|
||||
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright Broadcom, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: APACHE-2.0
|
||||
*/
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
export let random = (Math.random() + 1).toString(36).substring(7);
|
||||
@@ -0,0 +1,108 @@
|
||||
# Copyright Broadcom, Inc. All Rights Reserved.
|
||||
# SPDX-License-Identifier: APACHE-2.0
|
||||
|
||||
http:
|
||||
http://127.0.0.1:{{ .Vars.dremio.containerPorts.web }}:
|
||||
status: 200
|
||||
body:
|
||||
- /dremio/
|
||||
http://127.0.0.1:{{ .Vars.dremio.containerPorts.web }}/apiv2/login:
|
||||
status: 200
|
||||
method: POST
|
||||
request-headers:
|
||||
- "Content-Type: application/json"
|
||||
request-body: '{"userName": "{{ .Vars.dremio.auth.username }}", "password": "{{ .Vars.dremio.auth.password }}"}'
|
||||
body:
|
||||
- /{{ .Vars.dremio.auth.username }}/
|
||||
- /{{ .Vars.dremio.auth.email }}/
|
||||
- /{{ .Vars.dremio.auth.firstName }}/
|
||||
- /{{ .Vars.dremio.auth.lastName }}/
|
||||
http://dremio:{{ .Vars.service.ports.web }}:
|
||||
status: 200
|
||||
body:
|
||||
- /dremio/
|
||||
http://dremio:{{ .Vars.service.ports.web }}/apiv2/login:
|
||||
status: 200
|
||||
method: POST
|
||||
request-headers:
|
||||
- "Content-Type: application/json"
|
||||
request-body: '{"userName": "{{ .Vars.dremio.auth.username }}", "password": "{{ .Vars.dremio.auth.password }}"}'
|
||||
body:
|
||||
- /{{ .Vars.dremio.auth.username }}/
|
||||
- /{{ .Vars.dremio.auth.email }}/
|
||||
- /{{ .Vars.dremio.auth.firstName }}/
|
||||
- /{{ .Vars.dremio.auth.lastName }}/
|
||||
{{- if .Vars.metrics.enabled }}
|
||||
http://127.0.0.1:{{ .Vars.metrics.containerPorts.metrics }}/metrics:
|
||||
status: 200
|
||||
timeout: 30000
|
||||
body:
|
||||
- /metrics_com_dremio/
|
||||
{{- /* Not testing the body output because it is causing a CancelTimeoutError from time to time (probably because of the resource preset we are using) */}}
|
||||
http://dremio-metrics:{{ .Vars.metrics.service.ports.metrics }}/metrics:
|
||||
status: 200
|
||||
timeout: 30000
|
||||
{{- end }}
|
||||
addr:
|
||||
tcp://dremio-master-coordinator-0.dremio-headless:{{ .Vars.dremio.containerPorts.liveness }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
tcp://127.0.0.1:{{ .Vars.dremio.containerPorts.conduit }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
{{- if .Vars.metrics.enabled }}
|
||||
tcp://127.0.0.1:{{ .Vars.dremio.containerPorts.jmx }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
{{- end }}
|
||||
tcp://dremio-coordinator-0.dremio-headless:{{ .Vars.dremio.containerPorts.client }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
tcp://dremio-coordinator-0.dremio-headless:{{ .Vars.dremio.containerPorts.fabric }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
tcp://dremio:{{ .Vars.service.ports.client }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
tcp://dremio:{{ .Vars.service.ports.flight }}:
|
||||
reachable: true
|
||||
timeout: 10000
|
||||
file:
|
||||
{{ .Vars.masterCoordinator.persistence.mountPath }}:
|
||||
exists: true
|
||||
filetype: directory
|
||||
mode: '2775'
|
||||
owner: root
|
||||
/opt/bitnami/dremio/conf/dremio.conf:
|
||||
exists: true
|
||||
contents:
|
||||
- /services.coordinator.web.tokens.cache.size.*{{ .Vars.masterCoordinator.dremioConf.configOverrides.services.coordinator.web.tokens.cache.size }}/
|
||||
- /services.conduit.ssl.trustStorePassword.*{{ .Vars.masterCoordinator.dremioConf.secretConfigOverrides.services.conduit.ssl.trustStorePassword }}/
|
||||
- /services.fabric.memory.reservation.*{{ .Vars.dremio.dremioConf.configOverrides.services.fabric.memory.reservation }}/
|
||||
- /services.coordinator.web.ssl.trustStorePassword.*{{ .Vars.dremio.dremioConf.secretConfigOverrides.services.coordinator.web.ssl.trustStorePassword }}/
|
||||
- /services.web-admin.port.*{{ .Vars.dremio.containerPorts.liveness }}/
|
||||
- /services.coordinator.web.port.*{{ .Vars.dremio.containerPorts.web }}/
|
||||
- /services.conduit.port.*{{ .Vars.dremio.containerPorts.conduit }}/
|
||||
- /services.fabric.port.*{{ .Vars.dremio.containerPorts.fabric }}/
|
||||
- /services.flight.port.*{{ .Vars.dremio.containerPorts.flight }}/
|
||||
/opt/bitnami/dremio/conf/core-site.xml:
|
||||
exists: true
|
||||
contents:
|
||||
- /fs.s3a.endpoint.region/
|
||||
- /us-east-1/
|
||||
/opt/bitnami/dremio/conf/vib.conf:
|
||||
exists: true
|
||||
contents:
|
||||
- /IT WORKS/
|
||||
/opt/bitnami/dremio/conf/vib_secret.conf:
|
||||
exists: true
|
||||
contents:
|
||||
- /IT SECRETLY WORKS/
|
||||
command:
|
||||
{{- $uid := .Vars.masterCoordinator.containerSecurityContext.runAsUser }}
|
||||
{{- $gid := .Vars.masterCoordinator.podSecurityContext.fsGroup }}
|
||||
check-user-info:
|
||||
# The UID and GID should always be either the one specified as vars (always a bigger number that the default)
|
||||
# or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
|
||||
exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
|
||||
exit-status: 0
|
||||
@@ -0,0 +1,231 @@
|
||||
masterCoordinator:
|
||||
podSecurityContext:
|
||||
fsGroup: 1002
|
||||
containerSecurityContext:
|
||||
runAsUser: 1002
|
||||
persistence:
|
||||
enabled: true
|
||||
mountPath: /bitnami/dremio/data
|
||||
# Add specific overrides to dremio.conf
|
||||
dremioConf:
|
||||
configOverrides:
|
||||
services:
|
||||
coordinator:
|
||||
web:
|
||||
tokens:
|
||||
cache:
|
||||
size: 120
|
||||
secretConfigOverrides:
|
||||
services:
|
||||
conduit:
|
||||
ssl:
|
||||
trustStorePassword: "test"
|
||||
# Add extra files to the configmap
|
||||
extraFiles:
|
||||
vib.conf: |
|
||||
IT WORKS
|
||||
extraSecretFiles:
|
||||
vib_secret.conf: |
|
||||
IT SECRETLY WORKS
|
||||
dremio:
|
||||
containerPorts:
|
||||
web: 9048
|
||||
client: 31011
|
||||
flight: 32011
|
||||
fabric: 45678
|
||||
conduit: 45679
|
||||
jmx: 50001
|
||||
liveness: 44350
|
||||
# Add common overrides to dremio.conf
|
||||
dremioConf:
|
||||
configOverrides:
|
||||
services:
|
||||
fabric:
|
||||
memory:
|
||||
reservation: 150M
|
||||
secretConfigOverrides:
|
||||
services:
|
||||
coordinator:
|
||||
web:
|
||||
ssl:
|
||||
trustStorePassword: "password123"
|
||||
# Add extra configuration to core-site.xml
|
||||
coreSite:
|
||||
appendConfiguration: |
|
||||
<property>
|
||||
<name>fs.s3a.endpoint.region</name>
|
||||
<value>us-east-1</value>
|
||||
</property>
|
||||
auth:
|
||||
enabled: true
|
||||
username: vib_user
|
||||
password: "ComplicatedPassword!1234"
|
||||
firstName: VIBFIRST
|
||||
lastName: VIBNAME
|
||||
email: vib_email@example.com
|
||||
usePasswordFile: true
|
||||
service:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
web: 80
|
||||
client: 41010
|
||||
flight: 42010
|
||||
metrics:
|
||||
enabled: true
|
||||
service:
|
||||
ports:
|
||||
metrics: 41881
|
||||
containerPorts:
|
||||
metrics: 41884
|
||||
# We deploy a PostgreSQL instance so we can use it in Dremio as a data source. We create a database
|
||||
# that we can verify in the Cypress test
|
||||
extraDeploy:
|
||||
- |
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: postgresql
|
||||
labels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/version: 16.3.0
|
||||
helm.sh/chart: postgresql-15.5.6
|
||||
type: Opaque
|
||||
stringData:
|
||||
postgres-password: "password123"
|
||||
- |
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgresql
|
||||
labels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/version: 16.3.0
|
||||
helm.sh/chart: postgresql-15.5.6
|
||||
app.kubernetes.io/component: primary
|
||||
spec:
|
||||
type: ClusterIP
|
||||
sessionAffinity: None
|
||||
ports:
|
||||
- name: tcp-postgresql
|
||||
port: 5432
|
||||
targetPort: tcp-postgresql
|
||||
nodePort: null
|
||||
selector:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/component: primary
|
||||
- |
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgresql
|
||||
labels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/version: 16.3.0
|
||||
helm.sh/chart: postgresql-15.5.6
|
||||
app.kubernetes.io/component: primary
|
||||
spec:
|
||||
replicas: 1
|
||||
updateStrategy:
|
||||
rollingUpdate: {}
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/component: primary
|
||||
template:
|
||||
metadata:
|
||||
name: postgresql
|
||||
labels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/version: 16.3.0
|
||||
helm.sh/chart: postgresql-15.5.6
|
||||
app.kubernetes.io/component: primary
|
||||
spec:
|
||||
# Using the same security context as the master-coordinator to avoid issues with Openshift
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.masterCoordinator.podSecurityContext "context" $) | nindent 8 }}
|
||||
containers:
|
||||
- name: postgresql
|
||||
image: docker.io/bitnami/postgresql:16.3.0-debian-12-r14
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
# Using the same security context as the master-coordinator to avoid issues with Openshift
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.masterCoordinator.containerSecurityContext "context" $) | nindent 12 }}
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgresql
|
||||
key: postgres-password
|
||||
ports:
|
||||
- name: tcp-postgresql
|
||||
containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/postgresql/conf
|
||||
subPath: app-conf-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/postgresql/tmp
|
||||
subPath: app-tmp-dir
|
||||
- name: custom-init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d/
|
||||
- name: dshm
|
||||
mountPath: /dev/shm
|
||||
- name: data
|
||||
mountPath: /bitnami/postgresql
|
||||
volumes:
|
||||
- name: empty-dir
|
||||
emptyDir: {}
|
||||
- name: custom-init-scripts
|
||||
configMap:
|
||||
name: postgresql-init-scripts
|
||||
- name: dshm
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
volumeClaimTemplates:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "8Gi"
|
||||
- |
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgresql-init-scripts
|
||||
labels:
|
||||
app.kubernetes.io/instance: postgresql
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: postgresql
|
||||
app.kubernetes.io/version: 16.3.0
|
||||
helm.sh/chart: postgresql-15.5.6
|
||||
data:
|
||||
add_data.sql: |
|
||||
CREATE DATABASE vib_test;
|
||||
\c vib_test;
|
||||
CREATE TABLE cars (
|
||||
brand VARCHAR(255),
|
||||
model VARCHAR(255),
|
||||
year INT
|
||||
);
|
||||
INSERT INTO cars (brand, model, year)
|
||||
VALUES
|
||||
('Toyota', 'Camry', 2020),
|
||||
('Honda', 'Civic', 2019),
|
||||
('Ford', 'Mustang', 2018);
|
||||
@@ -0,0 +1 @@
|
||||
verification-mode=SERIAL
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"phases": {
|
||||
"package": {
|
||||
"context": {
|
||||
"resources": {
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/dremio"
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "helm-package"
|
||||
},
|
||||
{
|
||||
"action_id": "helm-lint"
|
||||
}
|
||||
]
|
||||
},
|
||||
"publish": {
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "helm-publish",
|
||||
"params": {
|
||||
"repository": {
|
||||
"kind": "S3",
|
||||
"url": "{VIB_ENV_S3_URL}",
|
||||
"authn": {
|
||||
"access_key_id": "{VIB_ENV_S3_ACCESS_KEY_ID}",
|
||||
"secret_access_key": "{VIB_ENV_S3_SECRET_ACCESS_KEY}",
|
||||
"role": "{VIB_ENV_S3_ROLE_ARN}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"phases": {
|
||||
"package": {
|
||||
"context": {
|
||||
"resources": {
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/dremio"
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "helm-package"
|
||||
},
|
||||
{
|
||||
"action_id": "helm-lint"
|
||||
}
|
||||
]
|
||||
},
|
||||
"verify": {
|
||||
"context": {
|
||||
"resources": {
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/dremio"
|
||||
},
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
"name": "L4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib"
|
||||
},
|
||||
"tests_file": "dremio/goss/goss.yaml",
|
||||
"vars_file": "dremio/runtime-parameters.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "sts-dremio-master-coordinator"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/dremio/cypress"
|
||||
},
|
||||
"endpoint": "lb-dremio-http-web",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
# Changelog
|
||||
CHANGELOG.md
|
||||
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 0.1.0 (2024-06-25)
|
||||
|
||||
* [bitnami/dremio] feat: :tada: Add chart ([#27453](https://github.com/bitnami/charts/pull/27453))
|
||||
@@ -0,0 +1,12 @@
|
||||
dependencies:
|
||||
- name: minio
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 14.6.10
|
||||
- name: zookeeper
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 13.4.4
|
||||
- name: common
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 2.20.3
|
||||
digest: sha256:0cb0933033ce80abc90eb15e2404f15a6c5191b500295c9686493c12c8a7fa22
|
||||
generated: "2024-06-18T10:42:31.507881356+02:00"
|
||||
@@ -0,0 +1,44 @@
|
||||
# Copyright Broadcom, Inc. All Rights Reserved.
|
||||
# SPDX-License-Identifier: APACHE-2.0
|
||||
|
||||
annotations:
|
||||
category: Analytics
|
||||
licenses: Apache-2.0
|
||||
images: |
|
||||
- name: dremio
|
||||
image: docker.io/bitnami/dremio:25.0.0-debian-12-r0
|
||||
- name: os-shell
|
||||
image: docker.io/bitnami/os-shell:12-debian-12-r22
|
||||
- name: jmx-exporter
|
||||
image: docker.io/bitnami/jmx-exporter:1.0.1-debian-12-r1
|
||||
apiVersion: v2
|
||||
appVersion: 25.0.0
|
||||
dependencies:
|
||||
- condition: minio.enabled
|
||||
name: minio
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 14.x.x
|
||||
- condition: zookeeper.enabled
|
||||
name: zookeeper
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 13.x.x
|
||||
- name: common
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
tags:
|
||||
- bitnami-common
|
||||
version: 2.x.x
|
||||
description: Dremio is an open-source self-service data access tool that provides high-performance queries for interactive analytics on data lakes.
|
||||
home: https://bitnami.com
|
||||
icon: https://bitnami.com/assets/stacks/dremio/img/dremio-stack-220x234.png
|
||||
keywords:
|
||||
- dremio
|
||||
- data-lake
|
||||
maintainers:
|
||||
- name: Broadcom, Inc. All Rights Reserved.
|
||||
url: https://github.com/bitnami/charts
|
||||
name: dremio
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/dremio
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/dremio
|
||||
- https://github.com/dremio/dremio-oss
|
||||
version: 0.1.0
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
CHART NAME: {{ .Chart.Name }}
|
||||
CHART VERSION: {{ .Chart.Version }}
|
||||
APP VERSION: {{ .Chart.AppVersion }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
|
||||
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
|
||||
|
||||
Get the list of pods by executing:
|
||||
|
||||
kubectl get pods --namespace {{ include "common.names.namespace" . | quote }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||
|
||||
Access the pod you want to debug by executing
|
||||
|
||||
kubectl exec --namespace {{ include "common.names.namespace" . | quote }} -ti <NAME OF THE POD> -- bash
|
||||
|
||||
In order to replicate the container startup scripts execute this command:
|
||||
|
||||
dremio start-fg
|
||||
|
||||
{{- else }}
|
||||
|
||||
Access Dremio from within the cluster using the following URL:
|
||||
|
||||
- {{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.ports.web }} (web)
|
||||
- {{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.ports.client }} (client)
|
||||
- {{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.ports.flight }} (flight)
|
||||
|
||||
To access Dremio web interface from outside the cluster follow the steps below:
|
||||
|
||||
{{- if .Values.dremio.auth.enabled }}
|
||||
Get the Dremio server credentials by running these commands:
|
||||
|
||||
echo Username: {{ .Values.dremio.auth.username }}
|
||||
echo Password: $(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.dremio-password}" | base64 -d)
|
||||
{{- end }}
|
||||
|
||||
Get the Dremio server URL by running these commands:
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters
|
||||
echo "Dremio web server URL: http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}/"
|
||||
echo "$CLUSTER_IP {{ .Values.ingress.hostname }}" | sudo tee -a /etc/hosts
|
||||
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "Dremio web server available at $NODE_IP:$NODE_PORT"
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ include "common.names.namespace" . }} svc -w {{ include "common.names.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo "Dremio web server available at $SERVICE_IP:{{ .Values.service.ports.web }}"
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
echo "Dremio web server available at 127.0.0.1:9047"
|
||||
kubectl port-forward svc/{{ include "common.names.fullname" . }} 9047:{{ .Values.service.ports.web }} &
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- include "common.warnings.rollingTag" .Values.dremio.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.defaultInitContainers.defaultImage }}
|
||||
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||
{{- include "dremio.validateValues" . }}
|
||||
{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.dremio.image .Values.defaultInitContainers.defaultImage .Values.metrics.image) "context" $) }}
|
||||
{{- include "common.warnings.resources" (dict "sections" (list "masterCoordinator" "coordinator" "executor.common" "defaultInitContainers.wait" "defaultInitContainers.generateConf" "defaultInitContainers.initCerts" "defaultInitContainers.copyDefaultConf" "defaultInitContainers.upgradeKeystore" "defaultInitContainers.volumePermissions") "context" $) }}
|
||||
@@ -0,0 +1,530 @@
|
||||
{{/*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name
|
||||
*/}}
|
||||
{{- define "dremio.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.dremio.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the default init containers)
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.default-image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.defaultInitContainers.defaultImage "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the sidecar JMX exporter image)
|
||||
*/}}
|
||||
{{- define "dremio.metrics.image" -}}
|
||||
{{- include "common.images.image" ( dict "imageRoot" .Values.metrics.image "global" .Values.global ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Dremio Master Coordinator fullname
|
||||
*/}}
|
||||
{{- define "dremio.master-coordinator.fullname" -}}
|
||||
{{- printf "%s-%s" (include "common.names.fullname" .) "master-coordinator" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Dremio Coordinator fullname
|
||||
*/}}
|
||||
{{- define "dremio.coordinator.fullname" -}}
|
||||
{{- printf "%s-%s" (include "common.names.fullname" .) "coordinator" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Dremio Executor fullname
|
||||
*/}}
|
||||
{{- define "dremio.executor.fullname" -}}
|
||||
{{- printf "%s-executor-%s" (include "common.names.fullname" .context) .engine | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "dremio.imagePullSecrets" -}}
|
||||
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.dremio.image .Values.defaultInitContainers.defaultImage .Values.metrics.image) "context" $) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.master-coordinator.dremio-conf.useSecret" -}}
|
||||
{{- if or .Values.masterCoordinator.dremioConf.existingSecret .Values.dremio.dremioConf.secretConfigOverrides .Values.masterCoordinator.dremioConf.secretConfigOverrides -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.coordinator.dremio-conf.useSecret" -}}
|
||||
{{- if or .Values.coordinator.dremioConf.existingSecret .Values.dremio.dremioConf.secretConfigOverrides .Values.coordinator.dremioConf.secretConfigOverrides -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.executor.dremio-conf.useSecret" -}}
|
||||
{{- if or .executorValues.dremioConf.existingSecret .context.Values.dremio.dremioConf.secretConfigOverrides .executorValues.dremioConf.secretConfigOverrides -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Dremio metrics configuration configmap
|
||||
*/}}
|
||||
{{- define "dremio.metrics.configmapName" -}}
|
||||
{{- if .Values.metrics.existingConfigmap -}}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.existingConfigmap "context" $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-metrics-configuration" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.master-coordinator.serviceAccountName" -}}
|
||||
{{- if .Values.masterCoordinator.serviceAccount.create -}}
|
||||
{{ default (include "dremio.master-coordinator.fullname" .) .Values.masterCoordinator.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.masterCoordinator.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.coordinator.serviceAccountName" -}}
|
||||
{{- if .Values.coordinator.serviceAccount.create -}}
|
||||
{{ default (include "dremio.coordinator.fullname" .) .Values.coordinator.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.coordinator.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "dremio.executor.serviceAccountName" -}}
|
||||
{{- if .executorValues.serviceAccount.create -}}
|
||||
{{ default (include "dremio.executor.fullname" (dict "engine" .engine "context" .context)) .executorValues.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .executorValues.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (master-coordinator)
|
||||
*/}}
|
||||
{{- define "dremio.master-coordinator.dremio-conf.configmapName" -}}
|
||||
{{- if .Values.masterCoordinator.dremioConf.existingConfigmap -}}
|
||||
{{- tpl .Values.masterCoordinator.dremioConf.existingConfigmap $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.master-coordinator.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (coordinator)
|
||||
*/}}
|
||||
{{- define "dremio.coordinator.dremio-conf.configmapName" -}}
|
||||
{{- if .Values.coordinator.dremioConf.existingConfigmap -}}
|
||||
{{- tpl .Values.coordinator.dremioConf.existingConfigmap $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.coordinator.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (executor)
|
||||
*/}}
|
||||
{{- define "dremio.executor.dremio-conf.configmapName" -}}
|
||||
{{- if .executorValues.dremioConf.existingConfigmap -}}
|
||||
{{- tpl .executorValues.dremioConf.existingConfigmap .context -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.executor.fullname" (dict "context" .context "engine" .engine)) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (master-coordinator)
|
||||
*/}}
|
||||
{{- define "dremio.master-coordinator.dremio-conf.secretName" -}}
|
||||
{{- if .Values.masterCoordinator.dremioConf.existingSecret -}}
|
||||
{{- tpl .Values.masterCoordinator.dremioConf.existingSecret $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.master-coordinator.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (coordinator)
|
||||
*/}}
|
||||
{{- define "dremio.coordinator.dremio-conf.secretName" -}}
|
||||
{{- if .Values.coordinator.dremioConf.existingSecret -}}
|
||||
{{- tpl .Values.coordinator.dremioConf.existingSecret $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.coordinator.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
dremio.conf ConfigMap (executor)
|
||||
*/}}
|
||||
{{- define "dremio.executor.dremio-conf.secretName" -}}
|
||||
{{- if .executorValues.dremioConf.existingSecret -}}
|
||||
{{- tpl .executorValues.dremioConf.existingSecret $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-dremio-conf" (include "dremio.executor.fullname" (dict "context" .context "engine" .engine)) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
core-site.xml Secret
|
||||
*/}}
|
||||
{{- define "dremio.core-site.secretName" -}}
|
||||
{{- if .Values.dremio.coreSite.existingSecret -}}
|
||||
{{- tpl .Values.dremio.coreSite.existingSecret $ -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-core-site" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a TLS credentials secret object should be created
|
||||
*/}}
|
||||
{{- define "dremio.tls.createSecret" -}}
|
||||
{{- if and .Values.dremio.tls.enabled .Values.dremio.tls.autoGenerated.enabled (not .Values.dremio.tls.existingSecret) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Jenkins JKS password secret name
|
||||
*/}}
|
||||
{{- define "dremio.tls.passwordSecretName" -}}
|
||||
{{- $secretName := .Values.dremio.tls.passwordSecret -}}
|
||||
{{- if $secretName -}}
|
||||
{{- printf "%s" (tpl $secretName $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-tls-pass" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Scylladb TLS credentials secret
|
||||
*/}}
|
||||
{{- define "dremio.tls.secretName" -}}
|
||||
{{- if .Values.dremio.tls.existingSecret -}}
|
||||
{{- print (tpl .Values.dremio.tls.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-crt" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Dremio auth credentials secret
|
||||
*/}}
|
||||
{{- define "dremio.auth.secretName" -}}
|
||||
{{- if .Values.dremio.auth.existingSecret -}}
|
||||
{{- print (tpl .Values.dremio.auth.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- include "common.names.fullname" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if the init job should be created
|
||||
*/}}
|
||||
{{- define "dremio.bootstrap-user-job.create" -}}
|
||||
{{- if and .Values.bootstrapUserJob.enabled .Values.dremio.auth.enabled (or .Release.IsInstall .Values.bootstrapUserJob.forceRun) -}}
|
||||
{{- true -}}
|
||||
{{- else -}}
|
||||
{{/* Do not return anything */}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Dremio auth credentials secret
|
||||
*/}}
|
||||
{{- define "dremio.auth.passwordKey" -}}
|
||||
{{- if .Values.dremio.auth.existingSecretKey -}}
|
||||
{{- print (tpl .Values.dremio.auth.existingSecretKey $) -}}
|
||||
{{- else -}}
|
||||
{{- print "dremio-password" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Return common dremio.conf configuration */}}
|
||||
{{- define "dremio.dremio-conf.common.default" -}}
|
||||
paths.local: {{ .Values.masterCoordinator.persistence.mountPath | quote }}
|
||||
{{- if or (eq .Values.dremio.distStorageType "minio") (eq .Values.dremio.distStorageType "aws") }}
|
||||
paths.dist: {{ printf "dremioS3://%s%s" (include "dremio.s3.bucket" .) (include "dremio.s3.path" .) | quote }}
|
||||
{{- end }}
|
||||
zookeeper: {{ include "dremio.zookeeper.hosts-with-port" . | quote }}
|
||||
{{- /* Container ports */}}
|
||||
services.coordinator.web.port: {{ .Values.dremio.containerPorts.web }}
|
||||
services.coordinator.client-endpoint.port: {{ .Values.dremio.containerPorts.client }}
|
||||
services.flight.port: {{ .Values.dremio.containerPorts.flight }}
|
||||
services.fabric.port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
services.conduit.port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
services.web-admin.port: {{ .Values.dremio.containerPorts.liveness }}
|
||||
services.web-admin.host: {{ print "{{ POD_IP }}" | quote }}
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
services.coordinator.web.ssl.enabled: true
|
||||
{{- /* We skip Dremio cert auto-generation and rely on the chart instead */}}
|
||||
services.coordinator.web.ssl.auto-certificate.enabled: false
|
||||
services.coordinator.web.ssl.keyStore: "/opt/bitnami/dremio/certs/dremio.jks"
|
||||
services.coordinator.web.ssl.keyStoreType: "jks"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* Return common dremio.conf configuration (sensitive) */}}
|
||||
{{- define "dremio.dremio-conf.common.defaultSecret" -}}
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
{{- /* Set the value dependant on env vars so we can use external secrets */ -}}
|
||||
services.coordinator.web.ssl.keyStorePassword: {{ print "{{ DREMIO_KEYSTORE_PASSWORD }}" | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "dremio.dremio-conf.flattenYAML" -}}
|
||||
{{- /* Moving parameters to vars before entering the range */ -}}
|
||||
{{- $prefix := .prefix -}}
|
||||
{{- /* Loop through the values of the map */ -}}
|
||||
{{- range $key, $val := .config -}}
|
||||
{{- $varName := ternary $key (list $prefix $key | join ".") (eq $prefix "") -}}
|
||||
{{- if kindOf $val | eq "map" -}}
|
||||
{{- /* If the variable is a map, we call the helper recursively, adding the semi-computed variable name as the prefix */ -}}
|
||||
{{ include "dremio.dremio-conf.flattenYAML" (dict "config" $val "prefix" $varName) }}
|
||||
{{- else }}
|
||||
{{- /* Base case: We reached to a value that is not a map (sting, integer, boolean, array), so we can build the variable */ -}}
|
||||
{{- if kindOf $val | eq "slice" -}}
|
||||
{{- /* If it is an array we use the join function to create an array with commas */}}
|
||||
{{ $varName }}: [{{ join "," $val }}]
|
||||
{{- else if kindOf $val | eq "string" -}}
|
||||
{{- /* String, quote */}}
|
||||
{{ $varName }}: {{ $val | quote }}
|
||||
{{- else -}}
|
||||
{{- /* Integer or boolean */}}
|
||||
{{ $varName }}: {{ $val }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return MinIO(TM) fullname
|
||||
*/}}
|
||||
{{- define "dremio.minio.fullname" -}}
|
||||
{{- include "common.names.dependency.fullname" (dict "chartName" "minio" "chartValues" .Values.minio "context" $) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 backend host
|
||||
*/}}
|
||||
{{- define "dremio.s3.host" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- include "dremio.minio.fullname" . -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalS3.host -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 backend host
|
||||
*/}}
|
||||
{{- define "dremio.s3.protocol" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- ternary "https" "http" .Values.minio.tls.enabled -}}
|
||||
{{- else -}}
|
||||
{{- .Values.externalS3.protocol -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 bucket
|
||||
*/}}
|
||||
{{- define "dremio.s3.bucket" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- print .Values.minio.defaultBuckets -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalS3.bucket -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 region
|
||||
*/}}
|
||||
{{- define "dremio.s3.region" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- print "us-east-1" -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalS3.region -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 port
|
||||
*/}}
|
||||
{{- define "dremio.s3.port" -}}
|
||||
{{- ternary .Values.minio.service.ports.api .Values.externalS3.port .Values.minio.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 path
|
||||
*/}}
|
||||
{{- define "dremio.s3.path" -}}
|
||||
{{- ternary "/dremio" .Values.externalS3.path .Values.minio.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 credentials secret name
|
||||
*/}}
|
||||
{{- define "dremio.s3.secretName" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- if .Values.minio.auth.existingSecret -}}
|
||||
{{- print .Values.minio.auth.existingSecret -}}
|
||||
{{- else -}}
|
||||
{{- print (include "dremio.minio.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- else if .Values.externalS3.existingSecret -}}
|
||||
{{- print .Values.externalS3.existingSecret -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" (include "common.names.fullname" .) "externals3" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 access key id inside the secret
|
||||
*/}}
|
||||
{{- define "dremio.s3.accessKeyIDKey" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- print "root-user" -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalS3.existingSecretAccessKeyIDKey -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the S3 secret access key inside the secret
|
||||
*/}}
|
||||
{{- define "dremio.s3.secretAccessKeyKey" -}}
|
||||
{{- if .Values.minio.enabled -}}
|
||||
{{- print "root-password" -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalS3.existingSecretKeySecretKey -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return Zookeeper fullname
|
||||
*/}}
|
||||
{{- define "dremio.zookeeper.fullname" -}}
|
||||
{{- include "common.names.dependency.fullname" (dict "chartName" "zookeeper" "chartValues" .Values.zookeeper "context" $) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return zookeeper port
|
||||
*/}}
|
||||
{{- define "dremio.zookeeper.port" -}}
|
||||
{{- if .Values.zookeeper.enabled -}}
|
||||
{{- print .Values.zookeeper.containerPorts.client -}}
|
||||
{{- else -}}
|
||||
{{- print .Values.externalZookeeper.port -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return zookeeper port
|
||||
*/}}
|
||||
{{- define "dremio.zookeeper.hosts-with-port" -}}
|
||||
{{- $context := . -}}
|
||||
{{- $res := list -}}
|
||||
{{- if .Values.zookeeper.enabled -}}
|
||||
{{- $fullname := include "dremio.zookeeper.fullname" . -}}
|
||||
{{- $port := include "dremio.zookeeper.port" . | int -}}
|
||||
{{- range $i, $e := until (.Values.zookeeper.replicaCount | int) -}}
|
||||
{{- $res = append $res (printf "%s-%d.%s-headless.%s.svc:%d" $fullname $i $fullname $context.Release.Namespace $port) -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $port := .Values.externalZookeeper.port | int -}}
|
||||
{{- range .Values.externalZookeeper.servers -}}
|
||||
{{- $res = append $res (printf "%s:%d" . $port) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- join "," $res -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message.
|
||||
*/}}
|
||||
{{- define "dremio.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
{{- $messages := append $messages (include "dremio.validateValues.minio" .) -}}
|
||||
{{- $messages := append $messages (include "dremio.validateValues.extraVolumes" .) -}}
|
||||
{{- $messages := append $messages (include "dremio.validateValues.executor" .) -}}
|
||||
{{- $messages := append $messages (include "dremio.validateValues.master-coordinator" .) -}}
|
||||
{{- $messages := append $messages (include "dremio.validateValues.dist-storage" .) -}}
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of dremio - MinIO is properly configured */}}
|
||||
{{- define "dremio.validateValues.minio" -}}
|
||||
{{- if and (eq .Values.dremio.distStoreType "minio") (not .Values.minio.enabled) (not .Values.externalS3.host) -}}
|
||||
dremio: minio
|
||||
Distributed store type is set to minio but endpoint is not configured. Please set minio.enabled=true or configure the externalS3 section.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of dremio - Incorrect extra volume settings */}}
|
||||
{{- define "dremio.validateValues.extraVolumes" -}}
|
||||
{{- $componentList := list "masterCoordinator" "coordinator" "executor.common" }}
|
||||
{{- $values := .Values -}}
|
||||
{{- range $component := $componentList }}
|
||||
{{- $componentValues := index $values $component }}
|
||||
{{- if and $componentValues.extraVolumes (not $componentValues.extraVolumeMounts) }}
|
||||
dremio: missing-extra-volume-mounts
|
||||
You specified {{ $component }}.extraVolumes but not mount points for them. Please set
|
||||
the {{ $component }}.extraVolumeMounts value
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of dremio - MinIO is properly configured */}}
|
||||
{{- define "dremio.validateValues.executor" -}}
|
||||
{{- if not .Values.executor.engines -}}
|
||||
dremio: missing-engines
|
||||
You did not specify any engine for the executors. Please set the executor.engines section.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of dremio - MinIO is properly configured */}}
|
||||
{{- define "dremio.validateValues.master-coordinator" -}}
|
||||
{{- if le (int .Values.masterCoordinator.replicaCount) 0 -}}
|
||||
dremio: master-coordinator
|
||||
Dremio requires a master coordinator. Please set masterCoordinator.replicaCount to a minimum value of 1.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of dremio - MinIO is properly configured */}}
|
||||
{{- define "dremio.validateValues.dist-storage" -}}
|
||||
{{- $allowedValues := list "aws" "minio" "other" -}}
|
||||
{{- if not (has .Values.dremio.distStorageType $allowedValues) -}}
|
||||
dremio: dist-storage
|
||||
Allowed values for `distStorageType` are {{ join "," $allowedValues }}.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,494 @@
|
||||
|
||||
{{/*
|
||||
Init container definition for generating the configuration
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.generate-conf" -}}
|
||||
# This init container renders and merges the Dremio configuration files.
|
||||
# We need to use a volume because we're working with ReadOnlyRootFilesystem
|
||||
- name: generate-conf
|
||||
image: {{ include "dremio.init-containers.default-image" .context }}
|
||||
imagePullPolicy: {{ .context.Values.defaultInitContainers.defaultImage.pullPolicy }}
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .context.Values.defaultInitContainers.generateConf.containerSecurityContext "context" .context) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.resources }}
|
||||
resources: {{- toYaml .context.Values.defaultInitContainers.generateConf.resources | nindent 4 }}
|
||||
{{- else if ne .context.Values.defaultInitContainers.generateConf.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .context.Values.defaultInitContainers.generateConf.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
set -e
|
||||
{{- if .context.Values.usePasswordFile }}
|
||||
# We need to load all the secret env vars to the system
|
||||
for file in $(find /bitnami/dremio/secrets -type f); do
|
||||
env_var_name="$(basename $file)"
|
||||
echo "Exporting $env_var_name"
|
||||
export $env_var_name="$(< $file)"
|
||||
done
|
||||
{{- end }}
|
||||
|
||||
# dremio.conf -> We concatenate the configuration from configmap + secret and then
|
||||
# perform render-template to substitute all the environment variable references
|
||||
|
||||
echo "Expanding env vars from dremio.conf"
|
||||
find /bitnami/dremio/input-dremio -type f -name dremio.conf -print0 | sort -z | xargs -0 cat > /bitnami/dremio/rendered-conf/pre-render-dremio.conf
|
||||
render-template /bitnami/dremio/rendered-conf/pre-render-dremio.conf > /bitnami/dremio/rendered-conf/dremio.conf
|
||||
rm /bitnami/dremio/rendered-conf/pre-render-dremio.conf
|
||||
|
||||
# Files different from dremio.conf -> Here we only apply render-template to expand the env vars
|
||||
for file in $(find /bitnami/dremio/input-dremio -type f -not -name dremio.conf); do
|
||||
filename="$(basename $file)"
|
||||
echo "Expanding env vars from $filename"
|
||||
render-template "$file" > /bitnami/dremio/rendered-conf/$filename
|
||||
done
|
||||
echo "Configuration generated"
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .context.Values.dremio.image.debug .context.Values.diagnosticMode.enabled) | quote }}
|
||||
{{- if not .context.Values.usePasswordFile }}
|
||||
{{- if or .context.Values.dremio.tls.passwordSecret .context.Values.dremio.tls.password .context.Values.dremio.tls.autoGenerated.enabled .context.Values.dremio.tls.usePemCerts }}
|
||||
- name: DREMIO_KEYSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "dremio.tls.passwordSecretName" .context }}
|
||||
key: keystore-password
|
||||
{{- end }}
|
||||
{{- if or (eq .context.Values.dremio.distStorageType "minio") (eq .context.Values.dremio.distStorageType "aws") }}
|
||||
- name: DREMIO_AWS_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "dremio.s3.secretName" .context }}
|
||||
key: {{ include "dremio.s3.accessKeyIDKey" .context | quote }}
|
||||
- name: DREMIO_AWS_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "dremio.s3.secretName" .context }}
|
||||
key: {{ include "dremio.s3.secretAccessKeyKey" .context | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .context.Values.defaultInitContainers.generateConf.extraEnvVars "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .context.Values.defaultInitContainers.generateConf.extraEnvVarsCM "context" .context) }}
|
||||
{{- end }}
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .context.Values.defaultInitContainers.generateConf.extraEnvVarsSecret "context" .context) }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: input-dremio-conf-cm
|
||||
mountPath: /bitnami/dremio/input-dremio/dremio-conf/configmap
|
||||
{{- if .mountDremioConfSecret }}
|
||||
- name: input-dremio-conf-secret
|
||||
mountPath: /bitnami/dremio/input-dremio/dremio-conf/secret
|
||||
{{- end }}
|
||||
- name: input-core-site
|
||||
mountPath: /bitnami/dremio/input-dremio/core-site
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /bitnami/dremio/rendered-conf
|
||||
subPath: app-conf-dir
|
||||
{{- if .context.Values.usePasswordFile }}
|
||||
{{- if or .context.Values.dremio.tls.passwordSecret .context.Values.dremio.tls.password .context.Values.dremio.tls.autoGenerated.enabled .context.Values.dremio.tls.usePemCerts }}
|
||||
- name: keystore-password
|
||||
mountPath: /bitnami/dremio/secrets/keystore-password
|
||||
{{- end }}
|
||||
{{- if or (eq .context.Values.dremio.distStorageType "minio") (eq .context.Values.dremio.distStorageType "aws") }}
|
||||
- name: s3-credentials
|
||||
mountPath: /bitnami/dremio/secrets/s3-credentials
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .context.Values.defaultInitContainers.generateConf.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .context.Values.defaultInitContainers.generateConf.extraVolumeMounts "context" .context) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "dremio.init-containers.volume-permissions" -}}
|
||||
{{- /* As most Bitnami charts have volumePermissions in the root, we add this overwrite to maintain a similar UX */}}
|
||||
{{- $volumePermissionsValues := mustMergeOverwrite .context.Values.defaultInitContainers.volumePermissions .context.Values.volumePermissions }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "dremio.init-containers.default-image" . }}
|
||||
imagePullPolicy: {{ .context.Values.defaultInitContainers.defaultImage.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
{{- if eq ( toString ( $volumePermissionsValues.containerSecurityContext.runAsUser )) "auto" }}
|
||||
chown -R `id -u`:`id -G | cut -d " " -f2` {{ .componentValues.persistence.mountPath }}
|
||||
{{- else }}
|
||||
chown -R {{ .componentValues.containerSecurityContext.runAsUser }}:{{ .componentValues.podSecurityContext.fsGroup }} {{ .componentValues.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- if $volumePermissionsValues.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $volumePermissionsValues.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $volumePermissionsValues.resources }}
|
||||
resources: {{- toYaml $volumePermissionsValues.resources | nindent 4 }}
|
||||
{{- else if ne $volumePermissionsValues.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" $volumePermissionsValues.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ .componentValues.persistence.mountPath }}
|
||||
{{- if .componentValues.persistence.subPath }}
|
||||
subPath: {{ .componentValues.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.wait-for-zookeeper" -}}
|
||||
- name: wait-for-zookeeper
|
||||
image: {{ include "dremio.init-containers.default-image" . }}
|
||||
imagePullPolicy: {{ .Values.defaultInitContainers.defaultImage.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.wait.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.wait.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.wait.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.wait.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.wait.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.wait.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
retry_while() {
|
||||
local -r cmd="${1:?cmd is missing}"
|
||||
local -r retries="${2:-12}"
|
||||
local -r sleep_time="${3:-5}"
|
||||
local return_value=1
|
||||
|
||||
read -r -a command <<< "$cmd"
|
||||
for ((i = 1 ; i <= retries ; i+=1 )); do
|
||||
"${command[@]}" && return_value=0 && break
|
||||
sleep "$sleep_time"
|
||||
done
|
||||
return $return_value
|
||||
}
|
||||
|
||||
zookeeper_hosts=(
|
||||
{{- if .Values.zookeeper.enabled }}
|
||||
{{ include "dremio.zookeeper.fullname" . | quote }}
|
||||
{{- else }}
|
||||
{{- range $node :=.Values.externalZookeeper.servers }}
|
||||
{{ print $node | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
check_zookeeper() {
|
||||
local -r zookeeper_host="${1:-?missing zookeeper}"
|
||||
if wait-for-port --timeout=5 --host=${zookeeper_host} --state=inuse {{ include "dremio.zookeeper.port" . }}; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
for host in "${zookeeper_hosts[@]}"; do
|
||||
echo "Checking connection to $host"
|
||||
if retry_while "check_zookeeper $host"; then
|
||||
echo "Connected to $host"
|
||||
else
|
||||
echo "Error connecting to $host"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Connection success"
|
||||
exit 0
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.init-certs" -}}
|
||||
- name: init-certs
|
||||
image: {{ include "dremio.image" . }}
|
||||
imagePullPolicy: {{ .Values.dremio.image.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.initCerts.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.initCerts.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.initCerts.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.initCerts.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.initCerts.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.initCerts.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
set -e
|
||||
{{- if .context.Values.usePasswordFile }}
|
||||
# We need to load all the secret env vars to the system
|
||||
for file in $(find /bitnami/dremio/secrets -type f); do
|
||||
env_var_name="$(basename $file)"
|
||||
echo "Exporting $env_var_name"
|
||||
export $env_var_name="$(< $file)"
|
||||
done
|
||||
{{- end }}
|
||||
{{- if .Values.dremio.tls.usePemCerts }}
|
||||
if [[ -f "/certs/tls.key" ]] && [[ -f "/certs/tls.crt" ]]; then
|
||||
openssl pkcs12 -export -in "/certs/tls.crt" \
|
||||
-passout pass:"${DREMIO_KEYSTORE_PASSWORD}" \
|
||||
-inkey "/certs/tls.key" \
|
||||
-out "/tmp/keystore.p12"
|
||||
keytool -importkeystore -srckeystore "/tmp/keystore.p12" \
|
||||
-srcstoretype PKCS12 \
|
||||
-srcstorepass "${DREMIO_KEYSTORE_PASSWORD}" \
|
||||
-deststorepass "${DREMIO_KEYSTORE_PASSWORD}" \
|
||||
-destkeystore "/opt/bitnami/dremio/certs/dremio.jks"
|
||||
rm "/tmp/keystore.p12"
|
||||
else
|
||||
echo "Couldn't find the expected PEM certificates! They are mandatory when encryption via TLS is enabled."
|
||||
exit 1
|
||||
fi
|
||||
{{- else }}
|
||||
if [[ -f "/certs/dremio.jks" ]]; then
|
||||
cp "/certs/dremio.jks" "/opt/bitnami/dremio/certs/dremio.jks"
|
||||
else
|
||||
echo "Couldn't find the expected Java Key Stores (JKS) files! They are mandatory when encryption via TLS is enabled."
|
||||
exit 1
|
||||
fi
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if not .Values.usePasswordFile }}
|
||||
{{- if or .Values.dremio.tls.passwordSecret .Values.dremio.tls.password .Values.dremio.tls.autoGenerated.enabled .Values.dremio.tls.usePemCerts }}
|
||||
- name: DREMIO_KEYSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "dremio.tls.passwordSecretName" . }}
|
||||
key: keystore-password
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: input-tls-certs
|
||||
mountPath: /certs
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/certs
|
||||
subPath: app-processed-certs-dir
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
{{- if .Values.usePasswordFile }}
|
||||
{{- if or .Values.dremio.tls.passwordSecret .Values.dremio.tls.password .Values.dremio.tls.autoGenerated.enabled .Values.dremio.tls.usePemCerts }}
|
||||
- name: keystore-password
|
||||
mountPath: /bitnami/dremio/secrets/keystore-password
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.copy-default-conf" -}}
|
||||
- name: copy-default-conf
|
||||
image: {{ include "dremio.image" . }}
|
||||
imagePullPolicy: {{ .Values.dremio.image.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.copyDefaultConf.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.copyDefaultConf.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.copyDefaultConf.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.copyDefaultConf.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.copyDefaultConf.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.copyDefaultConf.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
set -e
|
||||
echo "Copying configuration files from /opt/bitnami/dremio/conf to empty-dir volume"
|
||||
# First copy the default configuration files so we can fully replace the folder
|
||||
|
||||
cp /opt/bitnami/dremio/conf/* /bitnami/dremio/conf/
|
||||
volumeMounts:
|
||||
- name: empty-dir
|
||||
mountPath: /bitnami/dremio/conf
|
||||
subPath: app-conf-dir
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.upgrade-keystore" -}}
|
||||
- name: upgrade-keystore
|
||||
image: {{ include "dremio.image" . }}
|
||||
imagePullPolicy: {{ .Values.dremio.image.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.upgradeKeystore.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.upgradeKeystore.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.upgradeKeystore.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.upgradeKeystore.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.upgradeKeystore.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.upgradeKeystore.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- /opt/bitnami/scripts/dremio/entrypoint.sh
|
||||
args:
|
||||
- dremio-admin
|
||||
- upgrade
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.dremio.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
volumeMounts:
|
||||
- name: empty-dir
|
||||
mountPath: /.dremio
|
||||
subPath: tmp-dir
|
||||
- name: data
|
||||
mountPath: {{ .Values.masterCoordinator.persistence.mountPath }}
|
||||
{{- if .Values.masterCoordinator.persistence.subPath }}
|
||||
subPath: {{ .Values.masterCoordinator.persistence.subPath }}
|
||||
{{- end }}
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/tmp
|
||||
subPath: app-tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/run
|
||||
subPath: app-run-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/log
|
||||
subPath: app-log-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/conf
|
||||
subPath: app-conf-dir
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/certs
|
||||
subPath: app-processed-certs-dir
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.wait-for-s3" -}}
|
||||
- name: wait-for-s3
|
||||
image: {{ include "dremio.init-containers.default-image" . }}
|
||||
imagePullPolicy: {{ .Values.defaultInitContainers.defaultImage.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.wait.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.wait.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.wait.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.wait.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.wait.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.wait.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
retry_while() {
|
||||
local -r cmd="${1:?cmd is missing}"
|
||||
local -r retries="${2:-12}"
|
||||
local -r sleep_time="${3:-5}"
|
||||
local return_value=1
|
||||
|
||||
read -r -a command <<< "$cmd"
|
||||
for ((i = 1 ; i <= retries ; i+=1 )); do
|
||||
"${command[@]}" && return_value=0 && break
|
||||
sleep "$sleep_time"
|
||||
done
|
||||
return $return_value
|
||||
}
|
||||
|
||||
check_s3() {
|
||||
local -r s3_host="${1:-?missing s3}"
|
||||
if curl -k --max-time 5 "${s3_host}" | grep "RequestId"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
host={{ printf "%s://%v:%v" (include "dremio.s3.protocol" .) (include "dremio.s3.host" .) (include "dremio.s3.port" .) }}
|
||||
|
||||
echo "Checking connection to $host"
|
||||
if retry_while "check_s3 $host"; then
|
||||
echo "Connected to $host"
|
||||
else
|
||||
echo "Error connecting to $host"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Connection success"
|
||||
exit 0
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Init container definition for waiting for the database to be ready
|
||||
*/}}
|
||||
{{- define "dremio.init-containers.wait-for-master-coordinator" -}}
|
||||
- name: wait-for-master-coordinator
|
||||
image: {{ include "dremio.init-containers.default-image" . }}
|
||||
imagePullPolicy: {{ .Values.defaultInitContainers.defaultImage.pullPolicy }}
|
||||
{{- if .Values.defaultInitContainers.wait.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.wait.containerSecurityContext "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.wait.resources }}
|
||||
resources: {{- toYaml .Values.defaultInitContainers.wait.resources | nindent 4 }}
|
||||
{{- else if ne .Values.defaultInitContainers.wait.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.wait.resourcesPreset) | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
retry_while() {
|
||||
local -r cmd="${1:?cmd is missing}"
|
||||
local -r retries="${2:-12}"
|
||||
local -r sleep_time="${3:-5}"
|
||||
local return_value=1
|
||||
|
||||
read -r -a command <<< "$cmd"
|
||||
for ((i = 1 ; i <= retries ; i+=1 )); do
|
||||
"${command[@]}" && return_value=0 && break
|
||||
sleep "$sleep_time"
|
||||
done
|
||||
return $return_value
|
||||
}
|
||||
|
||||
check_master_coordinator() {
|
||||
local -r master_coordinator_host="${1:-?missing master_coordinator}"
|
||||
if curl -k --max-time 5 "${master_coordinator_host}" | grep dremio; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
host="{{ ternary "https" "http" .Values.dremio.tls.enabled }}://{{ include "dremio.master-coordinator.fullname" . }}-0.{{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}:{{ .Values.dremio.containerPorts.web }}"
|
||||
|
||||
echo "Checking connection to $host"
|
||||
if retry_while "check_master_coordinator $host"; then
|
||||
echo "Connected to $host"
|
||||
else
|
||||
echo "Error connecting to $host"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Connection success"
|
||||
exit 0
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,136 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if (include "dremio.bootstrap-user-job.create" .) }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ printf "%s-bootstrap-user" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
{{- $labels := include "common.tplvalues.merge" ( dict "values" (list .Values.commonLabels .Values.bootstrapUserJob.labels) "context" . ) }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: bootstrap-user
|
||||
{{- if or .Values.bootstrapUserJob.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.coordinator.statefulsetAnnotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
backoffLimit: {{ .Values.bootstrapUserJob.backoffLimit }}
|
||||
template:
|
||||
metadata:
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.bootstrapUserJob.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: bootstrap-user
|
||||
{{- if .Values.bootstrapUserJob.podAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "dremio.imagePullSecrets" . | nindent 6 }}
|
||||
restartPolicy: OnFailure
|
||||
{{- if .Values.bootstrapUserJob.podSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.bootstrapUserJob.podSecurityContext "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.bootstrapUserJob.automountServiceAccountToken }}
|
||||
{{- if .Values.bootstrapUserJob.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- if .Values.defaultInitContainers.wait.enabled }}
|
||||
{{- include "dremio.init-containers.wait-for-master-coordinator" . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: bootstrap-user
|
||||
image: {{ include "dremio.init-containers.default-image" . }}
|
||||
imagePullPolicy: {{ .Values.defaultInitContainers.defaultImage.pullPolicy }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
args:
|
||||
- |
|
||||
set -e
|
||||
{{- if .Values.usePasswordFile }}
|
||||
# We need to load all the secret env vars to the system
|
||||
for file in $(find /bitnami/dremio/secrets -type f); do
|
||||
env_var_name="$(basename $file)"
|
||||
echo "Exporting $env_var_name"
|
||||
export $env_var_name="$(< $file)"
|
||||
done
|
||||
{{- end }}
|
||||
escaped_password="${DREMIO_PASSWORD//\"/\\\"}"
|
||||
url="{{ ternary "https" "http" .Values.dremio.tls.enabled }}://{{ include "dremio.master-coordinator.fullname" . }}-0.{{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}:{{ .Values.dremio.containerPorts.web }}/apiv2/bootstrap/firstuser"
|
||||
echo "Bootstapping user {{ .Values.dremio.auth.username }} in endpoint $url"
|
||||
curl -k "$url" -X PUT \
|
||||
-H 'Authorization: _dremionull' -H 'Content-Type: application/json' \
|
||||
--data-binary "{\"userName\":\"{{ .Values.dremio.auth.username }}\",\"firstName\":\"{{ .Values.dremio.auth.firstName }}\",\"lastName\":\"{{ .Values.dremio.auth.lastName }}\",\"email\":\"{{ .Values.dremio.auth.email }}\",\"createdAt\":$(date +%s),\"password\":\"${escaped_password}\"}"
|
||||
echo "" # To generate a newline in the log because of the curl command
|
||||
{{- if .Values.bootstrapUserJob.extraCommands }}
|
||||
echo "Executing extra commands"
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.extraCommands "context" $) | nindent 14 }}
|
||||
{{- end }}
|
||||
echo "Initialization finished"
|
||||
env:
|
||||
{{- if not .Values.usePasswordFile }}
|
||||
- name: DREMIO_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "dremio.auth.secretName" . }}
|
||||
key: {{ include "dremio.auth.passwordKey" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.bootstrapUserJob.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.bootstrapUserJob.extraEnvVarsCM .Values.bootstrapUserJob.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.bootstrapUserJob.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.bootstrapUserJob.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.bootstrapUserJob.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
{{- if .Values.usePasswordFile }}
|
||||
- name: password
|
||||
mountPath: /bitnami/dremio/secrets/password
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.resources }}
|
||||
resources: {{- toYaml .Values.bootstrapUserJob.resources | nindent 12 }}
|
||||
{{- else if ne .Values.bootstrapUserJob.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.bootstrapUserJob.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: empty-dir
|
||||
emptyDir: {}
|
||||
{{- if .Values.usePasswordFile }}
|
||||
- name: password
|
||||
secret:
|
||||
secretName: {{ include "dremio.auth.secretName" . }}
|
||||
items:
|
||||
- key: {{ include "dremio.auth.passwordKey" . }}
|
||||
path: DREMIO_PASSWORD
|
||||
{{- end }}
|
||||
{{- if .Values.bootstrapUserJob.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.bootstrapUserJob.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,59 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.bootstrapUserJob.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ printf "%s-bootstrap-user" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.bootstrapUserJob.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: bootstrap-user
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
{{- if .Values.bootstrapUserJob.networkPolicy.allowExternalEgress }}
|
||||
egress:
|
||||
- {}
|
||||
{{- else }}
|
||||
egress:
|
||||
# Allow dns resolution
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
- port: 53
|
||||
protocol: TCP
|
||||
# Allow outbound connections to other cluster pods
|
||||
- ports:
|
||||
- port: {{ .Values.dremio.containerPorts.web }}
|
||||
- port: {{ .Values.dremio.containerPorts.client }}
|
||||
- port: {{ .Values.dremio.containerPorts.flight }}
|
||||
- port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||
part-of: dremio
|
||||
{{- if .Values.bootstrapUserJob.networkPolicy.extraEgress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.bootstrapUserJob.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ingress:
|
||||
{{- if .Values.bootstrapUserJob.networkPolicy.extraIngress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.bootstrapUserJob.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,60 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.dremio.tls.enabled .Values.dremio.tls.autoGenerated.enabled (eq .Values.dremio.tls.autoGenerated.engine "cert-manager") }}
|
||||
{{- if empty .Values.dremio.tls.autoGenerated.certManager.existingIssuer }}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Issuer
|
||||
metadata:
|
||||
name: {{ printf "%s-clusterissuer" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selfSigned: {}
|
||||
---
|
||||
{{- end }}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||
commonName: {{ printf "%s-ca" (include "common.names.fullname" .) }}
|
||||
isCA: true
|
||||
issuerRef:
|
||||
name: {{ default (printf "%s-clusterissuer" (include "common.names.fullname" .)) .Values.dremio.tls.autoGenerated.certManager.existingIssuer }}
|
||||
kind: {{ default "Issuer" .Values.dremio.tls.autoGenerated.certManager.existingIssuerKind }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Issuer
|
||||
metadata:
|
||||
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
ca:
|
||||
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,45 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.dremio.tls.enabled .Values.dremio.tls.autoGenerated.enabled (eq .Values.dremio.tls.autoGenerated.engine "cert-manager") }}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ printf "%s-crt" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
secretName: {{ printf "%s-crt" (include "common.names.fullname" .) }}
|
||||
commonName: {{ printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain }}
|
||||
issuerRef:
|
||||
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }}
|
||||
kind: Issuer
|
||||
subject:
|
||||
organizations:
|
||||
- "Dremio"
|
||||
dnsNames:
|
||||
- '*.{{ include "common.names.namespace" . }}'
|
||||
- '*.{{ include "common.names.namespace" . }}.svc'
|
||||
- '*.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}'
|
||||
- '*.{{ include "common.names.fullname" . }}'
|
||||
- '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}'
|
||||
- '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc'
|
||||
- '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}'
|
||||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}'
|
||||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}'
|
||||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}.svc'
|
||||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}'
|
||||
privateKey:
|
||||
algorithm: {{ .Values.dremio.tls.autoGenerated.certManager.keyAlgorithm }}
|
||||
size: {{ int .Values.dremio.tls.autoGenerated.certManager.keySize }}
|
||||
duration: {{ .Values.dremio.tls.autoGenerated.certManager.duration }}
|
||||
renewBefore: {{ .Values.dremio.tls.autoGenerated.certManager.renewBefore }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,50 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/* Adding the helper in here for better readability */}}
|
||||
{{- define "dremio.dremio-conf.coordinator.default" -}}
|
||||
{{/* Common configuration */}}
|
||||
{{- include "dremio.dremio-conf.common.default" . }}
|
||||
{{/* Master coordinator settings */}}
|
||||
services.coordinator.enabled: true
|
||||
services.coordinator.master.enabled: false
|
||||
services.coordinator.master.embedded-zookeeper.enabled: false
|
||||
services.executor.enabled: false
|
||||
{{- end }}
|
||||
|
||||
{{- if not .Values.coordinator.dremioConf.existingConfigmap -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.coordinator.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $extraFiles := mustMergeOverwrite .Values.dremio.dremioConf.extraFiles .Values.coordinator.dremioConf.extraFiles }}
|
||||
{{- if not (hasKey $extraFiles "dremio.conf") }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.coordinator.default" . | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.dremio.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.coordinator.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
dremio.conf: |
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.coordinator.autoscaling.hpa.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.hpa.apiVersion" (dict "context" $) }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
minReplicas: {{ .Values.coordinator.autoscaling.hpa.minReplicas }}
|
||||
maxReplicas: {{ .Values.coordinator.autoscaling.hpa.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.coordinator.autoscaling.hpa.targetMemory }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.coordinator.autoscaling.hpa.targetMemory }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.coordinator.autoscaling.hpa.targetMemory }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.autoscaling.hpa.targetCPU }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.coordinator.autoscaling.hpa.targetCPU }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.coordinator.autoscaling.hpa.targetCPU }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,122 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.coordinator.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ template "dremio.coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.coordinator.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
app: dremio-coordinator
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
{{- if .Values.coordinator.networkPolicy.allowExternalEgress }}
|
||||
egress:
|
||||
- {}
|
||||
{{- else }}
|
||||
egress:
|
||||
# Allow dns resolution
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
- port: 53
|
||||
protocol: TCP
|
||||
# Allow outbound connections to other cluster pods
|
||||
- ports:
|
||||
- port: {{ .Values.dremio.containerPorts.web }}
|
||||
- port: {{ .Values.dremio.containerPorts.client }}
|
||||
- port: {{ .Values.dremio.containerPorts.flight }}
|
||||
- port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||
part-of: dremio
|
||||
# Allow outbound connections to S3
|
||||
- ports:
|
||||
- port: {{ include "dremio.s3.port" . }}
|
||||
{{- if .Values.minio.enabled }}
|
||||
- port: {{ .Values.minio.containerPorts.api }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: minio
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
# Allow outbound connections to zookeeper
|
||||
- ports:
|
||||
- port: {{ include "dremio.zookeeper.port" . }}
|
||||
to:
|
||||
{{- if .Values.zookeeper.enabled }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.networkPolicy.extraEgress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.coordinator.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ingress:
|
||||
- ports:
|
||||
- port: {{ .Values.dremio.containerPorts.web }}
|
||||
- port: {{ .Values.dremio.containerPorts.client }}
|
||||
- port: {{ .Values.dremio.containerPorts.flight }}
|
||||
- port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- port: {{ .Values.dremio.containerPorts.jmx }}
|
||||
{{- end }}
|
||||
{{- range .Values.coordinator.extraContainerPorts }}
|
||||
- port: {{ . }}
|
||||
{{- end }}
|
||||
{{- if not .Values.coordinator.networkPolicy.allowExternal }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if .Values.coordinator.networkPolicy.addExternalClientAccess }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ template "dremio.coordinator.fullname" . }}-client: "true"
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.networkPolicy.ingressPodMatchLabels }}
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.networkPolicy.ingressPodMatchLabels "context" $ ) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.networkPolicy.ingressNSMatchLabels }}
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.coordinator.networkPolicy.ingressNSMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.networkPolicy.ingressNSPodMatchLabels }}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.coordinator.networkPolicy.ingressNSPodMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.networkPolicy.extraIngress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.coordinator.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.coordinator.pdb.create }}
|
||||
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.coordinator.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.coordinator.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if or .Values.coordinator.pdb.maxUnavailable ( not .Values.coordinator.pdb.minAvailable ) }}
|
||||
maxUnavailable: {{ .Values.coordinator.pdb.maxUnavailable | default 1 }}
|
||||
{{- end }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.coordinator.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- $extraFiles := mustMergeOverwrite .Values.dremio.dremioConf.extraSecretFiles .Values.coordinator.dremioConf.extraSecretFiles }}
|
||||
{{- $createDremioConf := or .Values.dremio.dremioConf.secretConfigOverrides .Values.coordinator.dremioConf.secretConfigOverrides .Values.dremio.tls.enabled }}
|
||||
{{- if and (not .Values.coordinator.dremioConf.existingSecret) (or $createDremioConf $extraFiles) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.coordinator.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- /* We use stringData to simplify the templating of this file. It is as insecure as using base64 */}}
|
||||
stringData:
|
||||
{{- if and (not (hasKey $extraFiles "dremio.conf")) $createDremioConf }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.common.defaultSecret" . | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.dremio.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.coordinator.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
{{- $result := include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) }}
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
dremio.conf: |
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.coordinator.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "dremio.coordinator.serviceAccountName" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.coordinator.serviceAccount.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.coordinator.serviceAccount.annotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.coordinator.serviceAccount.automountServiceAccountToken }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,394 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.coordinator.statefulsetAnnotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.coordinator.statefulsetAnnotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not .Values.coordinator.autoscaling.hpa.enabled }}
|
||||
replicas: {{ .Values.coordinator.replicaCount }}
|
||||
{{- end }}
|
||||
podManagementPolicy: {{ .Values.coordinator.podManagementPolicy | quote }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.coordinator.podLabels .Values.commonLabels) "context" .) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
app: dremio-coordinator
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- if .Values.coordinator.updateStrategy }}
|
||||
updateStrategy: {{- toYaml .Values.coordinator.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/dremio-conf-cm: {{ include (print $.Template.BasePath "/coordinator/configmap-dremio-conf.yaml") . | sha256sum }}
|
||||
checksum/dremio-conf-secret: {{ include (print $.Template.BasePath "/coordinator/secret-dremio-conf.yaml") . | sha256sum }}
|
||||
checksum/core-site-secret: {{ include (print $.Template.BasePath "/secret-core-site.yaml") . | sha256sum }}
|
||||
{{- if .Values.coordinator.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" (dict "customLabels" $podLabels "context" $) | nindent 8 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
app: dremio-coordinator
|
||||
spec:
|
||||
{{- include "dremio.imagePullSecrets" . | nindent 6 }}
|
||||
serviceAccountName: {{ template "dremio.coordinator.serviceAccountName" . }}
|
||||
automountServiceAccountToken: {{ .Values.coordinator.automountServiceAccountToken }}
|
||||
{{- if .Values.coordinator.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.coordinator.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.coordinator.podAffinityPreset "component" "coordinator" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.coordinator.podAntiAffinityPreset "component" "coordinator" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.coordinator.nodeAffinityPreset.type "key" .Values.coordinator.nodeAffinityPreset.key "values" .Values.coordinator.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.coordinator.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.tolerations "context" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.priorityClassName }}
|
||||
priorityClassName: {{ .Values.coordinator.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.schedulerName }}
|
||||
schedulerName: {{ .Values.coordinator.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.topologySpreadConstraints "context" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.podSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.coordinator.podSecurityContext "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.coordinator.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- /* As most Bitnami charts have volumePermissions in the root, we add a volumePermissions.enabled check to maintain a similar UX */}}
|
||||
{{- if and (or .Values.defaultInitContainers.volumePermissions.enabled ((.Values.volumePermissions).enabled)) .Values.coordinator.persistence.enabled }}
|
||||
{{- include "dremio.init-containers.volume-permissions" (dict "context" . "componentValues" .Values.coordinator) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.copyDefaultConf.enabled }}
|
||||
{{- include "dremio.init-containers.copy-default-conf" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.wait.enabled }}
|
||||
{{- include "dremio.init-containers.wait-for-s3" . | nindent 8 }}
|
||||
{{- include "dremio.init-containers.wait-for-zookeeper" . | nindent 8 }}
|
||||
{{- include "dremio.init-containers.wait-for-master-coordinator" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.generateConf.enabled }}
|
||||
{{- include "dremio.init-containers.generate-conf" (dict "context" . "mountDremioConfSecret" (include "dremio.coordinator.dremio-conf.useSecret" .)) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.dremio.tls.enabled .Values.defaultInitContainers.initCerts.enabled }}
|
||||
{{- include "dremio.init-containers.init-certs" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: dremio
|
||||
image: {{ template "dremio.image" . }}
|
||||
imagePullPolicy: {{ .Values.dremio.image.pullPolicy }}
|
||||
{{- if .Values.coordinator.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.coordinator.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.coordinator.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.coordinator.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.dremio.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
- name: DREMIO_JAVA_SERVER_EXTRA_OPTS
|
||||
value: |
|
||||
{{- if and (eq .Values.dremio.distStorageType "minio") (or (and .Values.minio.enabled (((.Values.minio).tls).enabled) (((.Values.minio).tls).autoGenerated)) .Values.externalS3.disableCertChecking) }}
|
||||
-Dcom.amazonaws.sdk.disableCertChecking=true
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
-Dcom.sun.management.jmxremote.port={{ .Values.dremio.containerPorts.jmx }}
|
||||
-Dcom.sun.management.jmxremote.authenticate=false
|
||||
-Dcom.sun.management.jmxremote.ssl=false
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.extraJavaOpts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.extraJavaOpts "context" $) | nindent 16 }}
|
||||
{{- end }}
|
||||
- name: DREMIO_MAX_MEMORY_SIZE_MB
|
||||
valueFrom:
|
||||
resourceFieldRef:
|
||||
containerName: dremio
|
||||
resource: limits.memory
|
||||
divisor: 1Mi
|
||||
{{- if .Values.coordinator.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if .Values.coordinator.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.coordinator.extraEnvVarsCM "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.coordinator.extraEnvVarsSecret "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.resources }}
|
||||
resources: {{- toYaml .Values.coordinator.resources | nindent 12 }}
|
||||
{{- else if ne .Values.coordinator.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.coordinator.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.dremio.containerPorts.web }}
|
||||
name: web
|
||||
- containerPort: {{ .Values.dremio.containerPorts.client }}
|
||||
name: client
|
||||
- containerPort: {{ .Values.dremio.containerPorts.flight }}
|
||||
name: flight
|
||||
- containerPort: {{ .Values.dremio.containerPorts.liveness }}
|
||||
name: liveness
|
||||
- containerPort: {{ .Values.dremio.containerPorts.fabric }}
|
||||
name: server-fabric
|
||||
- containerPort: {{ .Values.dremio.containerPorts.conduit }}
|
||||
name: server-conduit
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- containerPort: {{ .Values.dremio.containerPorts.jmx }}
|
||||
name: jmx
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.extraContainerPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.extraContainerPorts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.coordinator.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.coordinator.livenessProbe.enabled }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.coordinator.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.coordinator.readinessProbe.enabled }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.coordinator.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: web
|
||||
scheme: {{ ternary "HTTPS" "HTTP" .Values.dremio.tls.enabled }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.coordinator.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.coordinator.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ .Values.coordinator.persistence.mountPath }}
|
||||
{{- if .Values.coordinator.persistence.subPath }}
|
||||
subPath: {{ .Values.coordinator.persistence.subPath }}
|
||||
{{- end }}
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/tmp
|
||||
subPath: app-tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/run
|
||||
subPath: app-run-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/log
|
||||
subPath: app-log-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/conf
|
||||
subPath: app-conf-dir
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/certs
|
||||
subPath: app-processed-certs-dir
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
mountPath: /opt/bitnami/dremio/conf/dremio-telemetry.yaml
|
||||
subPath: dremio-telemetry.yaml
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "dremio.metrics.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.metrics.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- java
|
||||
args:
|
||||
- -XX:MaxRAMPercentage=100
|
||||
- -XshowSettings:vm
|
||||
- -jar
|
||||
- jmx_prometheus_httpserver.jar
|
||||
- {{ .Values.metrics.containerPorts.metrics | quote }}
|
||||
- /etc/jmx-dremio/jmx-prometheus.yml
|
||||
{{- if .Values.metrics.extraArgs }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraArgs "context" $) | nindent 12 }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.containerPorts.metrics }}
|
||||
{{- if .Values.metrics.resources }}
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.startupProbe.enabled }}
|
||||
startupProbe: {{- omit .Values.metrics.startupProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: metrics-configuration
|
||||
mountPath: /etc/jmx-dremio/jmx-prometheus.yml
|
||||
subPath: jmx-prometheus.yml
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.coordinator.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: empty-dir
|
||||
emptyDir: {}
|
||||
{{- if .Values.usePasswordFile }}
|
||||
{{- if or .Values.dremio.tls.passwordSecret .Values.dremio.tls.password .Values.dremio.tls.autoGenerated.enabled .Values.dremio.tls.usePemCerts }}
|
||||
- name: keystore-password
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.passwordSecretName" . }}
|
||||
items:
|
||||
- key: keystore-password
|
||||
path: DREMIO_KEYSTORE_PASSWORD
|
||||
{{- end }}
|
||||
{{- if or (eq .Values.dremio.distStorageType "minio") (eq .Values.dremio.distStorageType "aws") }}
|
||||
- name: s3-credentials
|
||||
secret:
|
||||
secretName: {{ include "dremio.s3.secretName" . }}
|
||||
items:
|
||||
- key: {{ include "dremio.s3.accessKeyIDKey" . }}
|
||||
path: DREMIO_AWS_ACCESS_KEY_ID
|
||||
- key: {{ include "dremio.s3.secretAccessKeyKey" . }}
|
||||
path: DREMIO_AWS_SECRET_ACCESS_KEY
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: input-dremio-conf-cm
|
||||
configMap:
|
||||
name: {{ include "dremio.coordinator.dremio-conf.configmapName" . }}
|
||||
{{- if (include "dremio.coordinator.dremio-conf.useSecret" .) }}
|
||||
- name: input-dremio-conf-secret
|
||||
secret:
|
||||
secretName: {{ include "dremio.coordinator.dremio-conf.secretName" . }}
|
||||
{{- end }}
|
||||
- name: input-core-site
|
||||
secret:
|
||||
secretName: {{ include "dremio.core-site.secretName" . }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
configMap:
|
||||
name: {{ include "dremio.metrics.configmapName" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
- name: input-tls-certs
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.secretName" . }}
|
||||
items:
|
||||
{{- if .Values.dremio.tls.usePemCerts }}
|
||||
- key: {{ .Values.dremio.tls.certFilename }}
|
||||
path: tls.crt
|
||||
- key: {{ .Values.dremio.tls.certKeyFilename }}
|
||||
path: tls.key
|
||||
{{- else }}
|
||||
- key: {{ .Values.dremio.tls.keystoreFilename }}
|
||||
path: dremio.jks
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.coordinator.persistence.existingClaim }}
|
||||
{{- else if (not .Values.coordinator.persistence.enabled)}}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.coordinator.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
{{- if or .Values.coordinator.persistence.annotations .Values.commonAnnotations }}
|
||||
{{- $claimAnnotations := include "common.tplvalues.merge" (dict "values" .Values.coordinator.persistence.annotations .Values.commonAnnotations "context" .) | fromYaml }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $claimAnnotations "context" $ ) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
labels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.coordinator.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.coordinator.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.persistence.dataSource "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.coordinator.persistence.size | quote }}
|
||||
{{- if .Values.coordinator.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.coordinator.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.coordinator.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") .Values.coordinator.autoscaling.vpa.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.vpa.apiVersion" (dict "context" $) }}
|
||||
kind: VerticalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.coordinator.autoscaling.vpa.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.coordinator.autoscaling.vpa.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
resourcePolicy:
|
||||
containerPolicies:
|
||||
- containerName: dremio
|
||||
{{- with .Values.coordinator.autoscaling.vpa.controlledResources }}
|
||||
controlledResources:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.coordinator.autoscaling.vpa.maxAllowed }}
|
||||
maxAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.coordinator.autoscaling.vpa.minAllowed }}
|
||||
minAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
targetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.coordinator.fullname" . }}
|
||||
{{- if .Values.coordinator.autoscaling.vpa.updatePolicy }}
|
||||
updatePolicy:
|
||||
{{- with .Values.coordinator.autoscaling.vpa.updatePolicy.updateMode }}
|
||||
updateMode: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,64 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/* Adding the helper in here for better readability */}}
|
||||
{{- define "dremio.dremio-conf.executor.default" -}}
|
||||
{{/* Common configuration */}}
|
||||
{{- include "dremio.dremio-conf.common.default" . }}
|
||||
{{/* Master coordinator settings */}}
|
||||
services.coordinator.enabled: false
|
||||
services.coordinator.master.enabled: false
|
||||
services.coordinator.master.embedded-zookeeper.enabled: false
|
||||
services.executor.enabled: true
|
||||
{{- end }}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- if not $executorValues.dremioConf.existingConfigmap }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name)) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $extraFiles := mustMergeOverwrite $.Values.dremio.dremioConf.extraFiles $executorValues.dremioConf.extraFiles }}
|
||||
{{- if not (hasKey $extraFiles "dremio.conf") }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.executor.default" $ | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $.Values.dremio.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $executorValues.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
{{- /* Adding this engine specific configuration as we cannot put a "define" inside a "range" */}}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration (dict "services.node-tag" $engine.name) }}
|
||||
dremio.conf: |
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,64 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- if $executorValues.autoscaling.hpa.enabled }}
|
||||
---
|
||||
apiVersion: {{ include "common.capabilities.hpa.apiVersion" (dict "context" $) }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" $ }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
minReplicas: {{ $executorValues.autoscaling.hpa.minReplicas }}
|
||||
maxReplicas: {{ $executorValues.autoscaling.hpa.maxReplicas }}
|
||||
metrics:
|
||||
{{- if $executorValues.autoscaling.hpa.targetMemory }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" $) }}
|
||||
targetAverageUtilization: {{ $executorValues.autoscaling.hpa.targetMemory }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ $executorValues.autoscaling.hpa.targetMemory }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.autoscaling.hpa.targetCPU }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" $) }}
|
||||
targetAverageUtilization: {{ $executorValues.autoscaling.hpa.targetCPU }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ $executorValues.autoscaling.hpa.targetCPU }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,131 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- if $executorValues.networkPolicy.enabled }}
|
||||
---
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" $ }}
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list $executorValues.podLabels $.Values.commonLabels ) "context" $ ) }}
|
||||
podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
engine: {{ $engine.name }}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
{{- if $executorValues.networkPolicy.allowExternalEgress }}
|
||||
egress:
|
||||
- {}
|
||||
{{- else }}
|
||||
egress:
|
||||
# Allow dns resolution
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
- port: 53
|
||||
protocol: TCP
|
||||
# Allow outbound connections to other cluster pods
|
||||
- ports:
|
||||
- port: {{ $.Values.dremio.containerPorts.web }}
|
||||
- port: {{ $.Values.dremio.containerPorts.client }}
|
||||
- port: {{ $.Values.dremio.containerPorts.flight }}
|
||||
- port: {{ $.Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ $.Values.dremio.containerPorts.conduit }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 14 }}
|
||||
part-of: dremio
|
||||
# Allow outbound connections to S3
|
||||
- ports:
|
||||
- port: {{ include "dremio.s3.port" $ }}
|
||||
{{- if $.Values.minio.enabled }}
|
||||
- port: {{ $.Values.minio.containerPorts.api }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: minio
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
# Allow outbound connections to zookeeper
|
||||
- ports:
|
||||
- port: {{ include "dremio.zookeeper.port" $ }}
|
||||
to:
|
||||
{{- if $.Values.zookeeper.enabled }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.networkPolicy.extraEgress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $executorValues.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ingress:
|
||||
- ports:
|
||||
- port: {{ $.Values.dremio.containerPorts.conduit }}
|
||||
- port: {{ $.Values.dremio.containerPorts.fabric }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- port: {{ $.Values.dremio.containerPorts.jmx }}
|
||||
{{- end }}
|
||||
{{- range $executorValues.extraContainerPorts }}
|
||||
- port: {{ . }}
|
||||
{{- end }}
|
||||
{{- if not $executorValues.networkPolicy.allowExternal }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if $executorValues.networkPolicy.addExternalClientAccess }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ template "dremio.executor.fullname" $ }}-client: "true"
|
||||
{{- end }}
|
||||
{{- if $executorValues.networkPolicy.ingressPodMatchLabels }}
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.tplvalues.render" (dict "value" $executorValues.networkPolicy.ingressPodMatchLabels "context" $ ) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.networkPolicy.ingressNSMatchLabels }}
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := $executorValues.networkPolicy.ingressNSMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.networkPolicy.ingressNSPodMatchLabels }}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := $executorValues.networkPolicy.ingressNSPodMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.networkPolicy.extraIngress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $executorValues.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,45 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- if $executorValues.pdb.create }}
|
||||
---
|
||||
apiVersion: {{ include "common.capabilities.policy.apiVersion" $ }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $executorValues.pdb.minAvailable }}
|
||||
minAvailable: {{ $executorValues.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if or $executorValues.pdb.maxUnavailable ( not $executorValues.pdb.minAvailable ) }}
|
||||
maxUnavailable: {{ $executorValues.pdb.maxUnavailable | default 1 }}
|
||||
{{- end }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list $executorValues.podLabels $.Values.commonLabels ) "context" . ) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
engine: {{ $engine.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,54 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- $extraFiles := mustMergeOverwrite $.Values.dremio.dremioConf.extraSecretFiles $executorValues.dremioConf.extraSecretFiles }}
|
||||
{{- $createDremioConf := or $.Values.dremio.dremioConf.secretConfigOverrides $executorValues.dremioConf.secretConfigOverrides $.Values.dremio.tls.enabled }}
|
||||
{{- if and (not $executorValues.dremioConf.existingSecret) (or $createDremioConf $extraFiles) }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name)) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- /* We use stringData to simplify the templating of this file. It is as insecure as using base64 */}}
|
||||
stringData:
|
||||
{{- if and (not (hasKey $extraFiles "dremio.conf")) $createDremioConf }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.common.defaultSecret" $ | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $.Values.dremio.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $executorValues.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
{{- $result := include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) }}
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
dremio.conf: |
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,34 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
{{- if $executorValues.serviceAccount.create }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.serviceAccountName" (dict "engine" $engine.name "executorValues" $executorValues "context" $) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if or $executorValues.serviceAccount.annotations $.Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list $executorValues.serviceAccount.annotations $.Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ $executorValues.serviceAccount.automountServiceAccountToken }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,396 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
---
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" $ }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if or $executorValues.statefulsetAnnotations $.Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list $executorValues.statefulsetAnnotations $.Values.commonAnnotations) "context" $) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not $executorValues.autoscaling.hpa.enabled }}
|
||||
replicas: {{ $executorValues.replicaCount }}
|
||||
{{- end }}
|
||||
podManagementPolicy: {{ $executorValues.podManagementPolicy | quote }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list $executorValues.podLabels $.Values.commonLabels) "context" $) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
engine: {{ $engine.name }}
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" $) | trunc 63 | trimSuffix "-" }}
|
||||
{{- if $executorValues.updateStrategy }}
|
||||
updateStrategy: {{- toYaml $executorValues.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/dremio-conf-cm: {{ include (print $.Template.BasePath "/executor/configmap-dremio-conf.yaml") $ | sha256sum }}
|
||||
checksum/dremio-conf-secret: {{ include (print $.Template.BasePath "/executor/secret-dremio-conf.yaml") $ | sha256sum }}
|
||||
checksum/core-site-secret: {{ include (print $.Template.BasePath "/secret-core-site.yaml") $ | sha256sum }}
|
||||
{{- if $executorValues.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" (dict "customLabels" $podLabels "context" $) | nindent 8 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
engine: {{ $engine.name }}
|
||||
spec:
|
||||
{{- include "dremio.imagePullSecrets" $ | nindent 6 }}
|
||||
serviceAccountName: {{ include "dremio.executor.serviceAccountName" (dict "engine" $engine.name "executorValues" $executorValues "context" $) }}
|
||||
automountServiceAccountToken: {{ $executorValues.automountServiceAccountToken }}
|
||||
{{- if $executorValues.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" $executorValues.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" ( dict "value" $executorValues.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" $executorValues.podAffinityPreset "component" (printf "executor-%s" $engine.name) "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $executorValues.podAntiAffinityPreset "component" (printf "executor-%s" $engine.name) "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $executorValues.nodeAffinityPreset.type "key" $executorValues.nodeAffinityPreset.key "values" $executorValues.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" $executorValues.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" $executorValues.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.priorityClassName }}
|
||||
priorityClassName: {{ $executorValues.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.schedulerName }}
|
||||
schedulerName: {{ $executorValues.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" $executorValues.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.podSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $executorValues.podSecurityContext "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ $executorValues.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- /* As most Bitnami charts have volumePermissions in the root, we add a volumePermissions.enabled check to maintain a similar UX */}}
|
||||
{{- if and (or $.Values.defaultInitContainers.volumePermissions.enabled (($.Values.volumePermissions).enabled)) $executorValues.persistence.enabled }}
|
||||
{{- include "dremio.init-containers.volume-permissions" (dict "context" $ "componentValues" $executorValues) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- if $.Values.defaultInitContainers.copyDefaultConf.enabled }}
|
||||
{{- include "dremio.init-containers.copy-default-conf" $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.defaultInitContainers.wait.enabled }}
|
||||
{{- include "dremio.init-containers.wait-for-s3" $ | nindent 8 }}
|
||||
{{- include "dremio.init-containers.wait-for-zookeeper" $ | nindent 8 }}
|
||||
{{- include "dremio.init-containers.wait-for-master-coordinator" $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.defaultInitContainers.generateConf.enabled }}
|
||||
{{- include "dremio.init-containers.generate-conf" (dict "context" $ "mountDremioConfSecret" (include "dremio.executor.dremio-conf.useSecret" (dict "context" $ "executorValues" $executorValues))) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and $.Values.dremio.tls.enabled $.Values.defaultInitContainers.initCerts.enabled }}
|
||||
{{- include "dremio.init-containers.init-certs" $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: dremio
|
||||
image: {{ template "dremio.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.dremio.image.pullPolicy }}
|
||||
{{- if $executorValues.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $executorValues.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if $executorValues.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" $executorValues.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if $executorValues.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" $executorValues.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or $.Values.dremio.image.debug $.Values.diagnosticMode.enabled) | quote }}
|
||||
- name: DREMIO_JAVA_SERVER_EXTRA_OPTS
|
||||
value: |
|
||||
{{- if and (eq $.Values.dremio.distStorageType "minio") (or (and $.Values.minio.enabled ((($.Values.minio).tls).enabled) ((($.Values.minio).tls).autoGenerated)) $.Values.externalS3.disableCertChecking) }}
|
||||
-Dcom.amazonaws.sdk.disableCertChecking=true
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
-Dcom.sun.management.jmxremote.port={{ $.Values.dremio.containerPorts.jmx }}
|
||||
-Dcom.sun.management.jmxremote.authenticate=false
|
||||
-Dcom.sun.management.jmxremote.ssl=false
|
||||
{{- end }}
|
||||
{{- if $executorValues.extraJavaOpts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.extraJavaOpts "context" $) | nindent 16 }}
|
||||
{{- end }}
|
||||
- name: DREMIO_MAX_MEMORY_SIZE_MB
|
||||
valueFrom:
|
||||
resourceFieldRef:
|
||||
containerName: dremio
|
||||
resource: limits.memory
|
||||
divisor: 1Mi
|
||||
{{- if $executorValues.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if $executorValues.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" $executorValues.extraEnvVarsCM "context" $) }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" $executorValues.extraEnvVarsSecret "context" $) }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.resources }}
|
||||
resources: {{- toYaml $executorValues.resources | nindent 12 }}
|
||||
{{- else if ne $executorValues.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" $executorValues.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ $.Values.dremio.containerPorts.liveness }}
|
||||
name: liveness
|
||||
- containerPort: {{ $.Values.dremio.containerPorts.fabric }}
|
||||
name: server-fabric
|
||||
- containerPort: {{ $.Values.dremio.containerPorts.conduit }}
|
||||
name: server-conduit
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- containerPort: {{ $.Values.dremio.containerPorts.jmx }}
|
||||
name: jmx
|
||||
{{- end }}
|
||||
{{- if $executorValues.extraContainerPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.extraContainerPorts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $executorValues.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" $executorValues.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if $executorValues.livenessProbe.enabled }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $executorValues.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||
{{- /* Using the fabric port because of a strange issue in which the liveness port is working but not the fabric one, in which case we want to restart the executor */}}
|
||||
tcpSocket:
|
||||
port: server-fabric
|
||||
{{- end }}
|
||||
{{- if $executorValues.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" $executorValues.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- else if $executorValues.readinessProbe.enabled }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $executorValues.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- if $executorValues.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" $executorValues.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- else if $executorValues.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit $executorValues.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" $executorValues.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ $executorValues.persistence.mountPath }}
|
||||
{{- if $executorValues.persistence.subPath }}
|
||||
subPath: {{ $executorValues.persistence.subPath }}
|
||||
{{- end }}
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/tmp
|
||||
subPath: app-tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/run
|
||||
subPath: app-run-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/log
|
||||
subPath: app-log-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/conf
|
||||
subPath: app-conf-dir
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
mountPath: /opt/bitnami/dremio/conf/dremio-telemetry.yaml
|
||||
subPath: dremio-telemetry.yaml
|
||||
{{- end }}
|
||||
{{- if $.Values.dremio.tls.enabled }}
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/certs
|
||||
subPath: app-processed-certs-dir
|
||||
{{- end }}
|
||||
{{- if $executorValues.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "dremio.metrics.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if $.Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $.Values.metrics.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- java
|
||||
args:
|
||||
- -XX:MaxRAMPercentage=100
|
||||
- -XshowSettings:vm
|
||||
- -jar
|
||||
- jmx_prometheus_httpserver.jar
|
||||
- {{ $.Values.metrics.containerPorts.metrics | quote }}
|
||||
- /etc/jmx-dremio/jmx-prometheus.yml
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ $.Values.metrics.containerPorts.metrics }}
|
||||
{{- if $.Values.metrics.resources }}
|
||||
resources: {{- toYaml $.Values.metrics.resources | nindent 12 }}
|
||||
{{- else if ne $.Values.metrics.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" $.Values.metrics.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $.Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe: {{- omit $.Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.readinessProbe.enabled }}
|
||||
readinessProbe: {{- omit $.Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.startupProbe.enabled }}
|
||||
startupProbe: {{- omit $.Values.metrics.startupProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: metrics-configuration
|
||||
mountPath: /etc/jmx-dremio/jmx-prometheus.yml
|
||||
subPath: jmx-prometheus.yml
|
||||
{{- end }}
|
||||
{{- if $executorValues.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $executorValues.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: empty-dir
|
||||
emptyDir: {}
|
||||
- name: input-dremio-conf-cm
|
||||
configMap:
|
||||
name: {{ include "dremio.executor.dremio-conf.configmapName" (dict "context" $ "executorValues" $executorValues "engine" $engine.name) }}
|
||||
{{- if (include "dremio.executor.dremio-conf.useSecret" (dict "context" $ "executorValues" $executorValues "engine" $engine.name)) }}
|
||||
- name: input-dremio-conf-secret
|
||||
secret:
|
||||
secretName: {{ include "dremio.executor.dremio-conf.secretName" (dict "context" $ "executorValues" $executorValues "engine" $engine.name) }}
|
||||
{{- end }}
|
||||
- name: input-core-site
|
||||
secret:
|
||||
secretName: {{ include "dremio.core-site.secretName" $ }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
configMap:
|
||||
name: {{ include "dremio.metrics.configmapName" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.dremio.tls.enabled }}
|
||||
- name: input-tls-certs
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.secretName" $ }}
|
||||
items:
|
||||
{{- if $.Values.dremio.tls.usePemCerts }}
|
||||
- key: {{ $.Values.dremio.tls.certFilename }}
|
||||
path: tls.crt
|
||||
- key: {{ $.Values.dremio.tls.certKeyFilename }}
|
||||
path: tls.key
|
||||
{{- else }}
|
||||
- key: {{ $.Values.dremio.tls.keystoreFilename }}
|
||||
path: dremio.jks
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and $executorValues.persistence.enabled $executorValues.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $executorValues.persistence.existingClaim }}
|
||||
{{- else if (not $executorValues.persistence.enabled)}}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
{{- if or $.Values.dremio.tls.passwordSecret $.Values.dremio.tls.password $.Values.dremio.tls.autoGenerated.enabled $.Values.dremio.tls.usePemCerts }}
|
||||
- name: keystore-password
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.passwordSecretName" $ }}
|
||||
items:
|
||||
- key: keystore-password
|
||||
path: DREMIO_KEYSTORE_PASSWORD
|
||||
{{- end }}
|
||||
{{- if or (eq $.Values.dremio.distStorageType "minio") (eq $.Values.dremio.distStorageType "aws") }}
|
||||
- name: s3-credentials
|
||||
secret:
|
||||
secretName: {{ include "dremio.s3.secretName" $ }}
|
||||
items:
|
||||
- key: {{ include "dremio.s3.accessKeyIDKey" $ }}
|
||||
path: DREMIO_AWS_ACCESS_KEY_ID
|
||||
- key: {{ include "dremio.s3.secretAccessKeyKey" $ }}
|
||||
path: DREMIO_AWS_SECRET_ACCESS_KEY
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $executorValues.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
{{- if or $executorValues.persistence.annotations $.Values.commonAnnotations }}
|
||||
{{- $claimAnnotations := include "common.tplvalues.merge" (dict "values" $executorValues.persistence.annotations $.Values.commonAnnotations "context" $) | fromYaml }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $claimAnnotations "context" $ ) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.commonLabels }}
|
||||
labels: {{- include "common.labels.matchLabels" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range $executorValues.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- if $executorValues.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" $executorValues.persistence.dataSource "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $executorValues.persistence.size | quote }}
|
||||
{{- if $executorValues.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" $executorValues.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" $executorValues.persistence "global" $.Values.global) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,60 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
Dremio supports different executor groups called "engines".
|
||||
These are defined in executor.engines and all the executor-specific k8s objects are created per engine.
|
||||
Each engine contains an "overrides" section which allows replacing the common executor configuration
|
||||
set in executor.common. This logic is inspired in upstream Dremio chart.
|
||||
|
||||
https://docs.dremio.com/cloud/sonar/workloads/engines/
|
||||
*/}}
|
||||
{{- range $engine := .Values.executor.engines }}
|
||||
{{- $executorValues := mustMergeOverwrite $.Values.executor.common $engine.overrides }}
|
||||
|
||||
{{- if and ($.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") $executorValues.autoscaling.vpa.enabled }}
|
||||
---
|
||||
apiVersion: {{ include "common.capabilities.vpa.apiVersion" (dict "context" $) }}
|
||||
kind: VerticalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: executor
|
||||
{{- /* We need an extra label for the engine */}}
|
||||
engine: {{ $engine.name }}
|
||||
{{- if or $executorValues.autoscaling.vpa.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list $executorValues.autoscaling.vpa.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
resourcePolicy:
|
||||
containerPolicies:
|
||||
- containerName: dremio
|
||||
{{- with $executorValues.autoscaling.vpa.controlledResources }}
|
||||
controlledResources:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $executorValues.autoscaling.vpa.maxAllowed }}
|
||||
maxAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $executorValues.autoscaling.vpa.minAllowed }}
|
||||
minAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
targetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" $ }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.executor.fullname" (dict "context" $ "engine" $engine.name) }}
|
||||
{{- if $executorValues.autoscaling.vpa.updatePolicy }}
|
||||
updatePolicy:
|
||||
{{- with $executorValues.autoscaling.vpa.updatePolicy.updateMode }}
|
||||
updateMode: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and (not .Values.minio.enabled) (not .Values.externalS3.existingSecret) .Values.enableS3 }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-externals3" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{ .Values.externalS3.existingSecretAccessKeyIDKey }}: {{ .Values.externalS3.accessKeyID | b64enc | quote }}
|
||||
{{ .Values.externalS3.existingSecretKeySecretKey }}: {{ .Values.externalS3.accessKeySecret | b64enc | quote }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- range .Values.extraDeploy }}
|
||||
---
|
||||
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if or .Values.commonAnnotations .Values.service.headless.annotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
publishNotReadyAddresses: true
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: http-web
|
||||
port: {{ .Values.dremio.containerPorts.web }}
|
||||
targetPort: web
|
||||
protocol: TCP
|
||||
- name: tcp-client
|
||||
port: {{ .Values.dremio.containerPorts.client }}
|
||||
targetPort: client
|
||||
protocol: TCP
|
||||
- name: tcp-flight
|
||||
port: {{ .Values.dremio.containerPorts.flight }}
|
||||
targetPort: flight
|
||||
protocol: TCP
|
||||
- name: tcp-fabric
|
||||
port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
targetPort: fabric
|
||||
protocol: TCP
|
||||
- name: tcp-conduit
|
||||
port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
targetPort: conduit
|
||||
protocol: TCP
|
||||
- name: tcp-liveness
|
||||
port: {{ .Values.dremio.containerPorts.liveness }}
|
||||
targetPort: conduit
|
||||
protocol: TCP
|
||||
- name: tcp-jmx
|
||||
port: {{ .Values.dremio.containerPorts.jmx }}
|
||||
targetPort: jmx
|
||||
protocol: TCP
|
||||
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
@@ -0,0 +1,50 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- if .Values.ingress.secrets }}
|
||||
{{- range .Values.ingress.secrets }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
namespace: {{ include "common.names.namespace" $ | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ .certificate | b64enc }}
|
||||
tls.key: {{ .key | b64enc }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- else if and .Values.ingress.tls .Values.ingress.selfSigned }}
|
||||
{{- $secretName := printf "%s-tls" .Values.ingress.hostname }}
|
||||
{{- $ca := genCA "dremio-ca" 365 }}
|
||||
{{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $secretName }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }}
|
||||
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }}
|
||||
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,62 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.ingress.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.ingress.annotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.ingress.hostname }}
|
||||
- host: {{ .Values.ingress.hostname }}
|
||||
http:
|
||||
paths:
|
||||
{{- if .Values.ingress.extraPaths }}
|
||||
{{- toYaml .Values.ingress.extraPaths | nindent 10 }}
|
||||
{{- end }}
|
||||
- path: {{ .Values.ingress.path }}
|
||||
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
||||
pathType: {{ .Values.ingress.pathType }}
|
||||
{{- end }}
|
||||
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- range .Values.ingress.extraHosts }}
|
||||
- host: {{ .name | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ default "/" .path }}
|
||||
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
|
||||
pathType: {{ default "ImplementationSpecific" .pathType }}
|
||||
{{- end }}
|
||||
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.extraRules }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned)) .Values.ingress.extraTls }}
|
||||
tls:
|
||||
{{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
|
||||
- hosts:
|
||||
- {{ .Values.ingress.hostname | quote }}
|
||||
secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.extraTls }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,50 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/* Adding the helper in here for better readability */}}
|
||||
{{- define "dremio.dremio-conf.master-coordinator.default" -}}
|
||||
{{/* Common configuration */}}
|
||||
{{- include "dremio.dremio-conf.common.default" . }}
|
||||
{{/* Master coordinator settings */}}
|
||||
services.coordinator.enabled: true
|
||||
services.coordinator.master.enabled: true
|
||||
services.coordinator.master.embedded-zookeeper.enabled: false
|
||||
services.executor.enabled: false
|
||||
{{- end }}
|
||||
|
||||
{{- if not .Values.masterCoordinator.dremioConf.existingConfigmap -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.master-coordinator.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $extraFiles := mustMergeOverwrite .Values.dremio.dremioConf.extraFiles .Values.masterCoordinator.dremioConf.extraFiles }}
|
||||
{{- if not (hasKey $extraFiles "dremio.conf") }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.master-coordinator.default" . | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.dremio.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.masterCoordinator.dremioConf.configOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
dremio.conf: |
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.masterCoordinator.autoscaling.hpa.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.hpa.apiVersion" (dict "context" $) }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
minReplicas: {{ .Values.masterCoordinator.autoscaling.hpa.minReplicas }}
|
||||
maxReplicas: {{ .Values.masterCoordinator.autoscaling.hpa.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.masterCoordinator.autoscaling.hpa.targetMemory }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.masterCoordinator.autoscaling.hpa.targetMemory }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.masterCoordinator.autoscaling.hpa.targetMemory }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.autoscaling.hpa.targetCPU }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.masterCoordinator.autoscaling.hpa.targetCPU }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.masterCoordinator.autoscaling.hpa.targetCPU }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,124 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.masterCoordinator.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ template "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.masterCoordinator.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
app: dremio-coordinator
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
{{- if .Values.masterCoordinator.networkPolicy.allowExternalEgress }}
|
||||
egress:
|
||||
- {}
|
||||
{{- else }}
|
||||
egress:
|
||||
# Allow dns resolution
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
- port: 53
|
||||
protocol: TCP
|
||||
# Allow outbound connections to other cluster pods
|
||||
- ports:
|
||||
- port: {{ .Values.dremio.containerPorts.web }}
|
||||
- port: {{ .Values.dremio.containerPorts.client }}
|
||||
- port: {{ .Values.dremio.containerPorts.flight }}
|
||||
- port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||
part-of: dremio
|
||||
# Allow outbound connections to S3
|
||||
- ports:
|
||||
- port: {{ include "dremio.s3.port" . }}
|
||||
{{- if .Values.minio.enabled }}
|
||||
- port: {{ .Values.minio.containerPorts.api }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: minio
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
# Allow outbound connections to zookeeper
|
||||
- ports:
|
||||
- port: {{ include "dremio.zookeeper.port" . }}
|
||||
to:
|
||||
{{- if .Values.zookeeper.enabled }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.networkPolicy.extraEgress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.masterCoordinator.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ingress:
|
||||
- ports:
|
||||
- port: {{ .Values.dremio.containerPorts.web }}
|
||||
{{- if (le (int .Values.coordinator.replicaCount) 0) }}
|
||||
- port: {{ .Values.dremio.containerPorts.client }}
|
||||
- port: {{ .Values.dremio.containerPorts.flight }}
|
||||
{{- end }}
|
||||
- port: {{ .Values.dremio.containerPorts.fabric }}
|
||||
- port: {{ .Values.dremio.containerPorts.conduit }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- port: {{ .Values.dremio.containerPorts.jmx }}
|
||||
{{- end }}
|
||||
{{- range .Values.masterCoordinator.extraContainerPorts }}
|
||||
- port: {{ . }}
|
||||
{{- end }}
|
||||
{{- if not .Values.masterCoordinator.networkPolicy.allowExternal }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if .Values.masterCoordinator.networkPolicy.addExternalClientAccess }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ template "dremio.master-coordinator.fullname" . }}-client: "true"
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.networkPolicy.ingressPodMatchLabels }}
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.networkPolicy.ingressPodMatchLabels "context" $ ) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.networkPolicy.ingressNSMatchLabels }}
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.masterCoordinator.networkPolicy.ingressNSMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.networkPolicy.ingressNSPodMatchLabels }}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.masterCoordinator.networkPolicy.ingressNSPodMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.networkPolicy.extraIngress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.masterCoordinator.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.masterCoordinator.pdb.create }}
|
||||
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.masterCoordinator.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.masterCoordinator.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if or .Values.masterCoordinator.pdb.maxUnavailable ( not .Values.masterCoordinator.pdb.minAvailable ) }}
|
||||
maxUnavailable: {{ .Values.masterCoordinator.pdb.maxUnavailable | default 1 }}
|
||||
{{- end }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.masterCoordinator.podLabels .Values.commonLabels ) "context" . ) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- end }}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.masterCoordinator.persistence.enabled (not .Values.masterCoordinator.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
app: dremio-coordinator
|
||||
annotations:
|
||||
{{- if .Values.masterCoordinator.persistence.resourcePolicy }}
|
||||
helm.sh/resource-policy: {{ .Values.masterCoordinator.persistence.resourcePolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if or .Values.masterCoordinator.persistence.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.masterCoordinator.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.masterCoordinator.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.masterCoordinator.persistence.size | quote }}
|
||||
{{- if .Values.masterCoordinator.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.persistence.selector "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.persistence.dataSource "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.masterCoordinator.persistence "global" .Values.global) | nindent 2 }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,42 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- $extraFiles := mustMergeOverwrite .Values.dremio.dremioConf.extraSecretFiles .Values.masterCoordinator.dremioConf.extraSecretFiles }}
|
||||
{{- $createDremioConf := or .Values.dremio.dremioConf.secretConfigOverrides .Values.masterCoordinator.dremioConf.secretConfigOverrides .Values.dremio.tls.enabled }}
|
||||
{{- if and (not .Values.masterCoordinator.dremioConf.existingSecret) (or $createDremioConf $extraFiles) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-dremio-conf" (include "dremio.master-coordinator.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- /* We use stringData to simplify the templating of this file. It is as insecure as using base64 */}}
|
||||
stringData:
|
||||
{{- if and (not (hasKey $extraFiles "dremio.conf")) $createDremioConf }}
|
||||
{{- /* dremio.conf uses HOCON, in which flattened YAML is a subset. So converting all values to flattened YAML generates a valid HOCON configuration */}}
|
||||
{{- $defaultConfiguration := include "dremio.dremio-conf.common.defaultSecret" . | fromYaml -}}
|
||||
{{- /* Obtain first the flattened version of all YAML content so the merge works as expected */}}
|
||||
{{- $defaultConfigurationFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" $defaultConfiguration "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $commonConfigOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.dremio.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- $configOverridesFlat := include "dremio.dremio-conf.flattenYAML" (dict "config" .Values.masterCoordinator.dremioConf.secretConfigOverrides "prefix" "" "context" $) | fromYaml -}}
|
||||
{{- /* Override order: default configuration <- common overrides <- specific overrides */}}
|
||||
{{- $mergedConfiguration := mustMergeOverwrite $defaultConfigurationFlat $commonConfigOverridesFlat }}
|
||||
{{- $mergedConfiguration = mustMergeOverwrite $mergedConfiguration $configOverridesFlat }}
|
||||
{{- $result := include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) }}
|
||||
{{- /* Apply the helper again to avoid arrays having a HOCON incompatible format */}}
|
||||
dremio.conf: |
|
||||
{{- include "dremio.dremio-conf.flattenYAML" (dict "config" $mergedConfiguration "prefix" "" "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $extraFiles }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $extraFiles "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.masterCoordinator.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.serviceAccountName" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.masterCoordinator.serviceAccount.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.masterCoordinator.serviceAccount.annotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.masterCoordinator.serviceAccount.automountServiceAccountToken }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,371 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.masterCoordinator.statefulsetAnnotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.masterCoordinator.statefulsetAnnotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not .Values.masterCoordinator.autoscaling.hpa.enabled }}
|
||||
replicas: {{ .Values.masterCoordinator.replicaCount }}
|
||||
{{- end }}
|
||||
podManagementPolicy: {{ .Values.masterCoordinator.podManagementPolicy | quote }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.masterCoordinator.podLabels .Values.commonLabels) "context" .) }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
app: dremio-coordinator
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- if .Values.masterCoordinator.updateStrategy }}
|
||||
updateStrategy: {{- toYaml .Values.masterCoordinator.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/dremio-conf-cm: {{ include (print $.Template.BasePath "/master-coordinator/configmap-dremio-conf.yaml") . | sha256sum }}
|
||||
checksum/dremio-conf-secret: {{ include (print $.Template.BasePath "/master-coordinator/secret-dremio-conf.yaml") . | sha256sum }}
|
||||
checksum/core-site-secret: {{ include (print $.Template.BasePath "/secret-core-site.yaml") . | sha256sum }}
|
||||
{{- if .Values.masterCoordinator.podAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" (dict "customLabels" $podLabels "context" $) | nindent 8 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
app: dremio-coordinator
|
||||
spec:
|
||||
{{- include "dremio.imagePullSecrets" . | nindent 6 }}
|
||||
serviceAccountName: {{ template "dremio.master-coordinator.serviceAccountName" . }}
|
||||
automountServiceAccountToken: {{ .Values.masterCoordinator.automountServiceAccountToken }}
|
||||
{{- if .Values.masterCoordinator.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.masterCoordinator.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.masterCoordinator.podAffinityPreset "component" "master-coordinator" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.masterCoordinator.podAntiAffinityPreset "component" "master-coordinator" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.masterCoordinator.nodeAffinityPreset.type "key" .Values.masterCoordinator.nodeAffinityPreset.key "values" .Values.masterCoordinator.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.masterCoordinator.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.tolerations "context" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.priorityClassName }}
|
||||
priorityClassName: {{ .Values.masterCoordinator.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.schedulerName }}
|
||||
schedulerName: {{ .Values.masterCoordinator.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.topologySpreadConstraints "context" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.podSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.masterCoordinator.podSecurityContext "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.masterCoordinator.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- /* As most Bitnami charts have volumePermissions in the root, we add a volumePermissions.enabled check to maintain a similar UX */}}
|
||||
{{- if and (or .Values.defaultInitContainers.volumePermissions.enabled ((.Values.volumePermissions).enabled)) .Values.masterCoordinator.persistence.enabled }}
|
||||
{{- include "dremio.init-containers.volume-permissions" (dict "context" . "componentValues" .Values.masterCoordinator) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.copyDefaultConf.enabled }}
|
||||
{{- include "dremio.init-containers.copy-default-conf" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.wait.enabled }}
|
||||
{{- include "dremio.init-containers.wait-for-s3" . | nindent 8 }}
|
||||
{{- include "dremio.init-containers.wait-for-zookeeper" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.generateConf.enabled }}
|
||||
{{- include "dremio.init-containers.generate-conf" (dict "context" . "mountDremioConfSecret" (include "dremio.master-coordinator.dremio-conf.useSecret" .)) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.dremio.tls.enabled .Values.defaultInitContainers.initCerts.enabled }}
|
||||
{{- include "dremio.init-containers.init-certs" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.defaultInitContainers.upgradeKeystore.enabled }}
|
||||
{{- include "dremio.init-containers.upgrade-keystore" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: dremio
|
||||
image: {{ template "dremio.image" . }}
|
||||
imagePullPolicy: {{ .Values.dremio.image.pullPolicy }}
|
||||
{{- if .Values.masterCoordinator.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.masterCoordinator.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.masterCoordinator.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.masterCoordinator.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.dremio.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
- name: DREMIO_JAVA_SERVER_EXTRA_OPTS
|
||||
value: |
|
||||
{{- if and (eq .Values.dremio.distStorageType "minio") (or (and .Values.minio.enabled (((.Values.minio).tls).enabled) (((.Values.minio).tls).autoGenerated)) .Values.externalS3.disableCertChecking) }}
|
||||
-Dcom.amazonaws.sdk.disableCertChecking=true
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
-Dcom.sun.management.jmxremote.port={{ .Values.dremio.containerPorts.jmx }}
|
||||
-Dcom.sun.management.jmxremote.authenticate=false
|
||||
-Dcom.sun.management.jmxremote.ssl=false
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.extraJavaOpts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraJavaOpts "context" $) | nindent 16 }}
|
||||
{{- end }}
|
||||
- name: DREMIO_MAX_MEMORY_SIZE_MB
|
||||
valueFrom:
|
||||
resourceFieldRef:
|
||||
containerName: dremio
|
||||
resource: limits.memory
|
||||
divisor: 1Mi
|
||||
{{- if .Values.masterCoordinator.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if .Values.masterCoordinator.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraEnvVarsCM "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraEnvVarsSecret "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.resources }}
|
||||
resources: {{- toYaml .Values.masterCoordinator.resources | nindent 12 }}
|
||||
{{- else if ne .Values.masterCoordinator.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.masterCoordinator.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.dremio.containerPorts.web }}
|
||||
name: web
|
||||
- containerPort: {{ .Values.dremio.containerPorts.liveness }}
|
||||
name: liveness
|
||||
{{- if (le (int .Values.coordinator.replicaCount) 0) }}
|
||||
- containerPort: {{ .Values.dremio.containerPorts.client }}
|
||||
name: client
|
||||
- containerPort: {{ .Values.dremio.containerPorts.flight }}
|
||||
name: flight
|
||||
{{- end }}
|
||||
- containerPort: {{ .Values.dremio.containerPorts.fabric }}
|
||||
name: server-fabric
|
||||
- containerPort: {{ .Values.dremio.containerPorts.conduit }}
|
||||
name: server-conduit
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- containerPort: {{ .Values.dremio.containerPorts.jmx }}
|
||||
name: jmx
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.extraContainerPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraContainerPorts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.masterCoordinator.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.masterCoordinator.livenessProbe.enabled }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.masterCoordinator.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.masterCoordinator.readinessProbe.enabled }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.masterCoordinator.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: web
|
||||
scheme: {{ ternary "HTTPS" "HTTP" .Values.dremio.tls.enabled }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.masterCoordinator.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.masterCoordinator.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: liveness
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ .Values.masterCoordinator.persistence.mountPath }}
|
||||
{{- if .Values.masterCoordinator.persistence.subPath }}
|
||||
subPath: {{ .Values.masterCoordinator.persistence.subPath }}
|
||||
{{- end }}
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
subPath: tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/tmp
|
||||
subPath: app-tmp-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/run
|
||||
subPath: app-run-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/log
|
||||
subPath: app-log-dir
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/conf
|
||||
subPath: app-conf-dir
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
mountPath: /opt/bitnami/dremio/conf/dremio-telemetry.yaml
|
||||
subPath: dremio-telemetry.yaml
|
||||
{{- end }}
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
- name: empty-dir
|
||||
mountPath: /opt/bitnami/dremio/certs
|
||||
subPath: app-processed-certs-dir
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "dremio.metrics.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.metrics.containerSecurityContext "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- java
|
||||
args:
|
||||
- -XX:MaxRAMPercentage=100
|
||||
- -XshowSettings:vm
|
||||
- -jar
|
||||
- jmx_prometheus_httpserver.jar
|
||||
- {{ .Values.metrics.containerPorts.metrics | quote }}
|
||||
- /etc/jmx-dremio/jmx-prometheus.yml
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.containerPorts.metrics }}
|
||||
{{- if .Values.metrics.resources }}
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.startupProbe.enabled }}
|
||||
startupProbe: {{- omit .Values.metrics.startupProbe "enabled" | toYaml | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: metrics-configuration
|
||||
mountPath: /etc/jmx-dremio/jmx-prometheus.yml
|
||||
subPath: jmx-prometheus.yml
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.masterCoordinator.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: empty-dir
|
||||
emptyDir: {}
|
||||
- name: input-dremio-conf-cm
|
||||
configMap:
|
||||
name: {{ include "dremio.master-coordinator.dremio-conf.configmapName" . }}
|
||||
{{- if .Values.usePasswordFile }}
|
||||
{{- if or .Values.dremio.tls.passwordSecret .Values.dremio.tls.password .Values.dremio.tls.autoGenerated.enabled .Values.dremio.tls.usePemCerts }}
|
||||
- name: keystore-password
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.passwordSecretName" . }}
|
||||
items:
|
||||
- key: keystore-password
|
||||
path: DREMIO_KEYSTORE_PASSWORD
|
||||
{{- end }}
|
||||
{{- if or (eq .Values.dremio.distStorageType "minio") (eq .Values.dremio.distStorageType "aws") }}
|
||||
- name: s3-credentials
|
||||
secret:
|
||||
secretName: {{ include "dremio.s3.secretName" . }}
|
||||
items:
|
||||
- key: {{ include "dremio.s3.accessKeyIDKey" . }}
|
||||
path: DREMIO_AWS_ACCESS_KEY_ID
|
||||
- key: {{ include "dremio.s3.secretAccessKeyKey" . }}
|
||||
path: DREMIO_AWS_SECRET_ACCESS_KEY
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if (include "dremio.master-coordinator.dremio-conf.useSecret" .) }}
|
||||
- name: input-dremio-conf-secret
|
||||
secret:
|
||||
secretName: {{ include "dremio.master-coordinator.dremio-conf.secretName" . }}
|
||||
{{- end }}
|
||||
- name: input-core-site
|
||||
secret:
|
||||
secretName: {{ include "dremio.core-site.secretName" . }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics-configuration
|
||||
configMap:
|
||||
name: {{ include "dremio.metrics.configmapName" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.dremio.tls.enabled }}
|
||||
- name: input-tls-certs
|
||||
secret:
|
||||
secretName: {{ include "dremio.tls.secretName" . }}
|
||||
items:
|
||||
{{- if .Values.dremio.tls.usePemCerts }}
|
||||
- key: {{ .Values.dremio.tls.certFilename }}
|
||||
path: tls.crt
|
||||
- key: {{ .Values.dremio.tls.certKeyFilename }}
|
||||
path: tls.key
|
||||
{{- else }}
|
||||
- key: {{ .Values.dremio.tls.keystoreFilename }}
|
||||
path: dremio.jks
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /*
|
||||
All Dremio master-coordinator instances need to share the same PVC:
|
||||
https://docs.dremio.com/current/get-started/cluster-deployments/architecture/high-availability/
|
||||
*/}}
|
||||
- name: data
|
||||
{{- if .Values.masterCoordinator.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ default (include "dremio.master-coordinator.fullname" .) .Values.masterCoordinator.persistence.existingClaim }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.masterCoordinator.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.masterCoordinator.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") .Values.masterCoordinator.autoscaling.vpa.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.vpa.apiVersion" (dict "context" $) }}
|
||||
kind: VerticalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: master-coordinator
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.masterCoordinator.autoscaling.vpa.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.masterCoordinator.autoscaling.vpa.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
resourcePolicy:
|
||||
containerPolicies:
|
||||
- containerName: dremio
|
||||
{{- with .Values.masterCoordinator.autoscaling.vpa.controlledResources }}
|
||||
controlledResources:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.masterCoordinator.autoscaling.vpa.maxAllowed }}
|
||||
maxAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.masterCoordinator.autoscaling.vpa.minAllowed }}
|
||||
minAllowed:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
targetRef:
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ include "dremio.master-coordinator.fullname" . }}
|
||||
{{- if .Values.masterCoordinator.autoscaling.vpa.updatePolicy }}
|
||||
updatePolicy:
|
||||
{{- with .Values.masterCoordinator.autoscaling.vpa.updatePolicy.updateMode }}
|
||||
updateMode: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/* Adding the helper in here for better readability */}}
|
||||
{{- define "dremio.metrics.jmxConfiguration.default" }}
|
||||
jmxUrl: service:jmx:rmi:///jndi/rmi://127.0.0.1:{{ .Values.dremio.containerPorts.jmx }}/jmxrmi
|
||||
lowercaseOutputName: true
|
||||
lowercaseOutputLabelNames: true
|
||||
ssl: false
|
||||
rules:
|
||||
- pattern: ".*"
|
||||
{{- end }}
|
||||
|
||||
{{- define "dremio.metrics.telemetryConfiguration.default" }}
|
||||
{{- /* Taken from https://docs.dremio.com/current/sonar/monitoring/dremio-nodes/#enabling-node-metrics */}}
|
||||
auto-reload:
|
||||
enabled: True
|
||||
period: 90
|
||||
unit: SECONDS
|
||||
|
||||
metrics:
|
||||
- name: jmx_reporter
|
||||
comment: "Publish metrics on jmx"
|
||||
reporter:
|
||||
type: jmx
|
||||
rate: SECONDS
|
||||
duration: MILLISECONDS
|
||||
{{- end }}
|
||||
|
||||
{{- if and .Values.metrics.enabled (not .Values.metrics.existingConfigmap) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-metrics-configuration" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $jmxConfiguration := mustMergeOverwrite (include "dremio.metrics.jmxConfiguration.default" . | fromYaml) (include "common.tplvalues.render" (dict "value" .Values.metrics.jmxConfigOverrides "context" $) | fromYaml) }}
|
||||
jmx-prometheus.yml: |
|
||||
{{- toYaml $jmxConfiguration | nindent 4 }}
|
||||
{{- $telemetryConfiguration := mustMergeOverwrite (include "dremio.metrics.telemetryConfiguration.default" . | fromYaml) (include "common.tplvalues.render" (dict "value" .Values.metrics.telemetryConfigOverrides "context" $) | fromYaml) }}
|
||||
dremio-telemetry.yaml: |
|
||||
{{- toYaml $telemetryConfiguration | nindent 4 }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonLabels .Values.metrics.service.labels) "context" . ) }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- $defaultAnnotations := dict "prometheus.io/scrape" "true" "prometheus.io/port" (.Values.metrics.service.ports.metrics | quote) "prometheus.io/path" "/" }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list $defaultAnnotations .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" $) | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
sessionAffinity: {{ .Values.metrics.service.sessionAffinity }}
|
||||
{{- if .Values.metrics.service.clusterIP }}
|
||||
clusterIP: {{ .Values.metrics.service.clusterIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.service.ports.metrics }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- end }}
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
|
||||
namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }}
|
||||
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.labels .Values.commonLabels ) "context" . ) }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if or .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.metrics.serviceMonitor.jobLabel }}
|
||||
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
|
||||
{{- if .Values.metrics.serviceMonitor.selector }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
app.kubernetes.io/component: metrics
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: "/"
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.relabelings }}
|
||||
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ include "common.names.namespace" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,82 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if not .Values.dremio.coreSite.existingSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-core-site" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
stringData:
|
||||
core-site.xml: |
|
||||
{{- /* There are values that depend on other secrets, so we make them relative to env vars. These will be rendered using an init container */}}
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
{{- if or (eq .Values.dremio.distStorageType "minio") (eq .Values.dremio.distStorageType "aws") }}
|
||||
<property>
|
||||
<name>fs.dremioS3.impl</name>
|
||||
<description>The FileSystem implementation. Must be set to com.dremio.plugins.s3.store.S3FileSystem</description>
|
||||
<value>com.dremio.plugins.s3.store.S3FileSystem</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.connection.ssl.enabled</name>
|
||||
<description>Value can either be true or false, set to true to use SSL with a secure Minio server.</description>
|
||||
<value>{{ ternary "true" "false" (eq (include "dremio.s3.protocol" .) "https") }}</value>
|
||||
</property>
|
||||
{{- if or (eq .Values.dremio.distStorageType "minio") (eq .Values.externalS3.authentication "accesskey") }}
|
||||
<property>
|
||||
<name>fs.s3a.aws.credentials.provider</name>
|
||||
<description>The credential provider type.</description>
|
||||
<value>org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.access.key</name>
|
||||
<description>AWS access key ID.</description>
|
||||
<value>{{ print "{{ DREMIO_AWS_ACCESS_KEY_ID }}" }}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.secret.key</name>
|
||||
<description>AWS secret key.</description>
|
||||
<value>{{ print "{{ DREMIO_AWS_SECRET_ACCESS_KEY }}" }}</value>
|
||||
</property>
|
||||
{{- end }}
|
||||
{{- if eq .Values.dremio.distStorageType "minio" }}
|
||||
{{- /* MinIO specific settings */}}
|
||||
<property>
|
||||
<name>fs.s3a.endpoint</name>
|
||||
<value>{{ include "dremio.s3.host" . }}:{{ include "dremio.s3.port" . }}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.path.style.access</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>dremio.s3.compat</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
{{- else }}
|
||||
{{- /* AWS specific settings */}}
|
||||
{{- if .Values.externalS3.host }}
|
||||
<property>
|
||||
<name>fs.s3a.endpoint</name>
|
||||
<value>{{ include "dremio.s3.host" . }}</value>
|
||||
</property>
|
||||
{{- end }}
|
||||
<property>
|
||||
<name>fs.s3a.endpoint.region</name>
|
||||
<value>{{ include "dremio.s3.region" . }}</value>
|
||||
</property>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.dremio.coreSite.appendConfiguration }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.dremio.coreSite.appendConfiguration "context" $) | nindent 6 }}
|
||||
{{- end }}
|
||||
</configuration>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
{{- if .Values.dremio.auth.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
dremio-password: {{ include "common.secrets.passwords.manage" (dict "secret" ( include "common.names.fullname" .) "key" "dremio-password" "providedValues" (list "dremio.auth.password") "context" $) }}
|
||||
{{- end }}
|
||||
{{- if and (or .Values.dremio.tls.autoGenerated.enabled .Values.dremio.tls.existingSecret) (not .Values.dremio.tls.passwordSecret) }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-tls-pass" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if .Values.dremio.tls.existingSecret }}
|
||||
{{- $pass := required "If 'dremio.tls.existingSecret' is provided, providing a JKS password is mandatory" .Values.dremio.tls.password }}
|
||||
{{- end }}
|
||||
keystore-password: {{ include "common.secrets.passwords.manage" (dict "secret" ( printf "%s-tls-pass" (include "common.names.fullname" .)) "key" "keystore-password" "providedValues" (list "dremio.tls.password") "context" $) }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,69 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if or .Values.service.annotations .Values.commonAnnotations }}
|
||||
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.annotations .Values.commonAnnotations) "context" .) }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }}
|
||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }}
|
||||
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP)) }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-web
|
||||
port: {{ .Values.service.ports.web }}
|
||||
targetPort: web
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.web)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.web }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
- name: tcp-client
|
||||
port: {{ .Values.service.ports.client }}
|
||||
targetPort: client
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.client)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.client }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
- name: tcp-flight
|
||||
port: {{ .Values.service.ports.flight }}
|
||||
targetPort: flight
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.flight)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.flight }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
{{- if .Values.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.commonLabels) "context" .) | fromYaml }}
|
||||
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||
app: dremio-coordinator
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- /*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if and (include "dremio.tls.createSecret" . ) (eq .Values.dremio.tls.autoGenerated.engine "helm") }}
|
||||
{{- $ca := genCA "dremio-ca" 365 }}
|
||||
{{- $caSecretName := printf "%s-ca-crt" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $caSecretName }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $caSecretName "key" "tls.crt" "defaultValue" $ca.Cert "context" $) }}
|
||||
tls.key: {{ include "common.secrets.lookup" (dict "secret" $caSecretName "key" "tls.key" "defaultValue" $ca.Key "context" $) }}
|
||||
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $caSecretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }}
|
||||
|
||||
---
|
||||
{{- $fullname := include "common.names.fullname" . }}
|
||||
{{- $releaseNamespace := include "common.names.namespace" . }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
{{- $serviceName := include "common.names.fullname" . }}
|
||||
{{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- $altNames := list (printf "*.%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) "localhost" "127.0.0.1" $fullname }}
|
||||
{{- $cert := genSignedCert $fullname nil $altNames 365 $ca }}
|
||||
{{- $secretName := printf "%s-crt" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $secretName }}
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
app.kubernetes.io/part-of: dremio
|
||||
{{- /* We need an extra label that applies to both master and non-master coordinators. Taken from upstream dremio chart */}}
|
||||
app: dremio-coordinator
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }}
|
||||
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }}
|
||||
{{- end }}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user