Make Log Search and Prometheus images configurable (#717)

Three new fields were added to let users customize the docker images for log search and prometheus

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
This commit is contained in:
Daniel Valdivia
2021-05-04 14:46:10 -07:00
committed by GitHub
parent 35da684ec9
commit 8a635fc0d7
22 changed files with 232 additions and 53 deletions

View File

@@ -32,6 +32,12 @@ import (
// swagger:model logSearchConfiguration
type LogSearchConfiguration struct {
// image
Image string `json:"image,omitempty"`
// postgres image
PostgresImage string `json:"postgres_image,omitempty"`
// storage class
StorageClass string `json:"storageClass,omitempty"`

View File

@@ -32,6 +32,9 @@ import (
// swagger:model prometheusConfiguration
type PrometheusConfiguration struct {
// image
Image string `json:"image,omitempty"`
// storage class
StorageClass string `json:"storageClass,omitempty"`

View File

@@ -1,25 +1,25 @@
{
"files": {
"main.css": "/static/css/main.a19f3d53.chunk.css",
"main.js": "/static/js/main.63747815.chunk.js",
"main.js.map": "/static/js/main.63747815.chunk.js.map",
"main.js": "/static/js/main.ca4ff6a7.chunk.js",
"main.js.map": "/static/js/main.ca4ff6a7.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
"static/css/2.32daf8f7.chunk.css": "/static/css/2.32daf8f7.chunk.css",
"static/js/2.f9fdac36.chunk.js": "/static/js/2.f9fdac36.chunk.js",
"static/js/2.f9fdac36.chunk.js.map": "/static/js/2.f9fdac36.chunk.js.map",
"static/js/2.1e7db62a.chunk.js": "/static/js/2.1e7db62a.chunk.js",
"static/js/2.1e7db62a.chunk.js.map": "/static/js/2.1e7db62a.chunk.js.map",
"index.html": "/index.html",
"static/css/2.32daf8f7.chunk.css.map": "/static/css/2.32daf8f7.chunk.css.map",
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
"static/js/2.f9fdac36.chunk.js.LICENSE.txt": "/static/js/2.f9fdac36.chunk.js.LICENSE.txt",
"static/js/2.1e7db62a.chunk.js.LICENSE.txt": "/static/js/2.1e7db62a.chunk.js.LICENSE.txt",
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
},
"entrypoints": [
"static/js/runtime-main.f48e99e5.js",
"static/css/2.32daf8f7.chunk.css",
"static/js/2.f9fdac36.chunk.js",
"static/js/2.1e7db62a.chunk.js",
"static/css/main.a19f3d53.chunk.css",
"static/js/main.63747815.chunk.js"
"static/js/main.ca4ff6a7.chunk.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.32daf8f7.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.f9fdac36.chunk.js"></script><script src="/static/js/main.63747815.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.32daf8f7.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.1e7db62a.chunk.js"></script><script src="/static/js/main.ca4ff6a7.chunk.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -362,13 +362,16 @@ export interface IErasureCodeCalc {
}
export interface LogSearchConfiguration {
storageClass: string;
storageSize: number;
storageClass?: string;
storageSize?: number;
image: string;
postgres_image: string;
}
export interface PrometheusConfiguration {
storageClass: string;
storageSize: number;
storageClass?: string;
storageSize?: number;
image: string;
}
export interface AffinityConfiguration {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useEffect, useState, Fragment } from "react";
import React, { Fragment, useEffect, useState } from "react";
import { connect } from "react-redux";
import Grid from "@material-ui/core/Grid";
import { LinearProgress } from "@material-ui/core";
@@ -160,6 +160,9 @@ const AddTenant = ({
const logSearchVolumeSize = fields.configure.logSearchVolumeSize;
const logSearchSelectedStorageClass =
fields.configure.logSearchSelectedStorageClass;
const logSearchImage = fields.configure.logSearchImage;
const logSearchPostgresImage = fields.configure.logSearchPostgresImage;
const prometheusImage = fields.configure.prometheusImage;
const prometheusSelectedStorageClass =
fields.configure.prometheusSelectedStorageClass;
const prometheusVolumeSize = fields.configure.prometheusVolumeSize;
@@ -239,6 +242,16 @@ const AddTenant = ({
logSearchConfiguration: {
storageClass: logSearchSelectedStorageClass,
storageSize: parseInt(logSearchVolumeSize),
image: logSearchImage,
postgres_image: logSearchPostgresImage,
},
};
} else {
dataSend = {
...dataSend,
logSearchConfiguration: {
image: logSearchImage,
postgres_image: logSearchPostgresImage,
},
};
}
@@ -249,6 +262,14 @@ const AddTenant = ({
prometheusConfiguration: {
storageClass: prometheusSelectedStorageClass,
storageSize: parseInt(prometheusVolumeSize),
image: prometheusImage,
},
};
} else {
dataSend = {
...dataSend,
prometheusConfiguration: {
image: prometheusImage,
},
};
}

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useEffect, useState, useCallback, Fragment } from "react";
import React, { Fragment, useCallback, useEffect, useState } from "react";
import { connect } from "react-redux";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Grid } from "@material-ui/core";
@@ -22,7 +22,7 @@ import {
modalBasic,
wizardCommon,
} from "../../../Common/FormComponents/common/styleLibrary";
import { updateAddField, isPageValid } from "../../actions";
import { isPageValid, updateAddField } from "../../actions";
import { AppState } from "../../../../../store";
import { clearValidationError } from "../../utils";
import {
@@ -54,7 +54,10 @@ interface IConfigureProps {
prometheusVolumeSize: string;
prometheusSizeFactor: string;
logSearchSelectedStorageClass: string;
logSearchImage: string;
logSearchPostgresImage: string;
prometheusSelectedStorageClass: string;
prometheusImage: string;
selectedStorageClass: string;
}
@@ -83,10 +86,13 @@ const Configure = ({
logSearchCustom,
logSearchVolumeSize,
logSearchSizeFactor,
logSearchImage,
logSearchPostgresImage,
prometheusVolumeSize,
prometheusSizeFactor,
logSearchSelectedStorageClass,
prometheusSelectedStorageClass,
prometheusImage,
updateAddField,
isPageValid,
selectedStorageClass,
@@ -151,19 +157,43 @@ const Configure = ({
...customAccountValidation,
{
fieldKey: "image",
required: true,
required: false,
value: imageName,
pattern: /^((.*?)\/(.*?):(.+))$/,
customPatternMessage: "Format must be of form: 'minio/minio:VERSION'",
},
{
fieldKey: "consoleImage",
required: true,
required: false,
value: consoleImage,
pattern: /^((.*?)\/(.*?):(.+))$/,
customPatternMessage:
"Format must be of form: 'minio/console:VERSION'",
},
{
fieldKey: "logSearchImage",
required: false,
value: logSearchImage,
pattern: /^((.*?)\/(.*?):(.+))$/,
customPatternMessage:
"Format must be of form: 'minio/logsearchapi:VERSION'",
},
{
fieldKey: "logSearchPostgresImage",
required: false,
value: logSearchPostgresImage,
pattern: /^((.*?)\/(.*?):(.+))$/,
customPatternMessage:
"Format must be of form: 'library/postgres:VERSION'",
},
{
fieldKey: "prometheusImage",
required: false,
value: prometheusImage,
pattern: /^((.*?)\/(.*?):(.+))$/,
customPatternMessage:
"Format must be of form: 'minio/prometheus:VERSION'",
},
];
if (customDockerhub) {
customAccountValidation = [
@@ -196,6 +226,9 @@ const Configure = ({
customImage,
imageName,
consoleImage,
logSearchImage,
logSearchPostgresImage,
prometheusImage,
customDockerhub,
imageRegistry,
imageRegistryUsername,
@@ -263,7 +296,7 @@ const Configure = ({
</Grid>
{customImage && (
<Fragment>
Please enter the MinIO image from dockerhub to use
Please enter the MinIO docker image to use
<Grid item xs={12}>
<InputBoxWrapper
id="image"
@@ -275,8 +308,7 @@ const Configure = ({
label="MinIO's Image"
value={imageName}
error={validationErrors["image"] || ""}
placeholder="E.g. minio/minio:RELEASE.2020-05-08T02-40-49Z"
required
placeholder="E.g. minio/minio:RELEASE.2021-04-22T15-44-28Z"
/>
</Grid>
<Grid item xs={12}>
@@ -290,8 +322,49 @@ const Configure = ({
label="Console's Image"
value={consoleImage}
error={validationErrors["consoleImage"] || ""}
placeholder="E.g. minio/console:v0.3.13"
required
placeholder="E.g. minio/console:v0.6.8"
/>
</Grid>
<Grid item xs={12}>
<InputBoxWrapper
id="logSearchImage"
name="logSearchImage"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
updateField("logSearchImage", e.target.value);
cleanValidation("logSearchImage");
}}
label="Log Search API's Image"
value={logSearchImage}
error={validationErrors["logSearchImage"] || ""}
placeholder="E.g. minio/logsearchapi:v4.0.9"
/>
</Grid>
<Grid item xs={12}>
<InputBoxWrapper
id="logSearchPostgresImage"
name="logSearchPostgresImage"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
updateField("logSearchPostgresImage", e.target.value);
cleanValidation("logSearchPostgresImage");
}}
label="Log Search Postgres's Image"
value={logSearchPostgresImage}
error={validationErrors["logSearchPostgresImage"] || ""}
placeholder="E.g. library/postgres:13"
/>
</Grid>
<Grid item xs={12}>
<InputBoxWrapper
id="prometheusImage"
name="prometheusImage"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
updateField("prometheusImage", e.target.value);
cleanValidation("prometheusImage");
}}
label="Prometheus Image"
value={prometheusImage}
error={validationErrors["prometheusImage"] || ""}
placeholder="E.g. quay.io/prometheus/prometheus:latest"
/>
</Grid>
</Fragment>
@@ -545,8 +618,12 @@ const mapState = (state: AppState) => ({
state.tenants.createTenant.fields.configure.prometheusSizeFactor,
logSearchSelectedStorageClass:
state.tenants.createTenant.fields.configure.logSearchSelectedStorageClass,
logSearchImage: state.tenants.createTenant.fields.configure.logSearchImage,
logSearchPostgresImage:
state.tenants.createTenant.fields.configure.logSearchPostgresImage,
prometheusSelectedStorageClass:
state.tenants.createTenant.fields.configure.prometheusSelectedStorageClass,
prometheusImage: state.tenants.createTenant.fields.configure.prometheusImage,
selectedStorageClass:
state.tenants.createTenant.fields.nameTenant.selectedStorageClass,
});

View File

@@ -30,7 +30,7 @@ import {
IValidation,
} from "../../../../../utils/validationFunctions";
import { AppState } from "../../../../../store";
import { clearValidationError } from "../../utils";
import { clearValidationError, getRandomString } from "../../utils";
import RadioGroupSelector from "../../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
import InputBoxWrapper from "../../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import FormSwitchWrapper from "../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
@@ -96,17 +96,6 @@ const IdentityProvider = ({
}: IIdentityProviderProps) => {
const [validationErrors, setValidationErrors] = useState<any>({});
// Common
let randomKey = function (length = 16): string {
let retval = "";
let legalcharacters =
"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (let i = 0; i < length; i++) {
retval +=
legalcharacters[Math.floor(Math.random() * legalcharacters.length)];
}
return retval;
};
const updateField = useCallback(
(field: string, value: any) => {
updateAddField("identityProvider", field, value);
@@ -275,8 +264,8 @@ const IdentityProvider = ({
<Tooltip title="Randomize Credentials" aria-label="add">
<IconButton
onClick={() => {
updateUserField(index, randomKey(16));
updatePwordField(index, randomKey(32));
updateUserField(index, getRandomString(16));
updatePwordField(index, getRandomString(32));
}}
size={"small"}
>

View File

@@ -39,6 +39,7 @@ import {
ADD_TENANT_RESET_FORM,
} from "./types";
import { KeyPair } from "./ListTenants/utils";
import { getRandomString } from "./utils";
const initialState: ITenantState = {
createTenant: {
@@ -67,10 +68,13 @@ const initialState: ITenantState = {
prometheusCustom: false,
logSearchVolumeSize: "5",
logSearchSizeFactor: "Gi",
logSearchImage: "",
logSearchPostgresImage: "",
prometheusVolumeSize: "5",
prometheusSizeFactor: "Gi",
logSearchSelectedStorageClass: "",
prometheusSelectedStorageClass: "",
prometheusImage: "",
},
identityProvider: {
idpSelection: "Built-in",
@@ -459,14 +463,17 @@ export function tenantsReducer(
logSearchVolumeSize: "5",
logSearchSizeFactor: "Gi",
logSearchSelectedStorageClass: "",
logSearchImage: "",
logSearchPostgresImage: "",
prometheusVolumeSize: "5",
prometheusSizeFactor: "Gi",
prometheusSelectedStorageClass: "",
prometheusImage: "",
},
identityProvider: {
idpSelection: "Built-in",
accessKeys: [""],
secretKeys: [""],
accessKeys: [getRandomString(16)],
secretKeys: [getRandomString(32)],
openIDURL: "",
openIDClientID: "",
openIDSecretID: "",

View File

@@ -104,9 +104,12 @@ export interface IConfigureFields {
logSearchVolumeSize: string;
logSearchSizeFactor: string;
logSearchSelectedStorageClass: string;
logSearchImage: string;
logSearchPostgresImage: string;
prometheusVolumeSize: string;
prometheusSizeFactor: string;
prometheusSelectedStorageClass: string;
prometheusImage: string;
}
export interface IIdentityProviderFields {

View File

@@ -23,3 +23,15 @@ export const clearValidationError = (
return newValidationElement;
};
// Generates a valid access/secret key string
export const getRandomString = function (length = 16): string {
let retval = "";
let legalcharacters =
"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (let i = 0; i < length; i++) {
retval +=
legalcharacters[Math.floor(Math.random() * legalcharacters.length)];
}
return retval;
};

View File

@@ -32,6 +32,10 @@ export const commonFormValidation = (fieldsValidate: IValidation[]) => {
returnErrors[field.fieldKey] = "Field cannot be empty";
return;
}
// if it's not required and the value is empty, we are done here
if (!field.required && field.value.trim() === "") {
return;
}
if (field.customValidation && field.customValidationMessage) {
returnErrors[field.fieldKey] = field.customValidationMessage;

View File

@@ -941,21 +941,34 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
//Default class name for Log search
diskSpaceFromAPI := int64(5) // Default is 5
logSearchStorageClass := "" // Default is ""
logSearchImage := ""
logSearchPgImage := ""
if tenantReq.LogSearchConfiguration != nil {
diskSpaceFromAPI = int64(*tenantReq.LogSearchConfiguration.StorageSize)
logSearchStorageClass = tenantReq.LogSearchConfiguration.StorageClass
if tenantReq.LogSearchConfiguration.StorageSize != nil {
diskSpaceFromAPI = int64(*tenantReq.LogSearchConfiguration.StorageSize)
}
if tenantReq.LogSearchConfiguration.StorageClass != "" {
logSearchStorageClass = tenantReq.LogSearchConfiguration.StorageClass
}
if tenantReq.LogSearchConfiguration.StorageClass == "" && len(tenantReq.Pools) > 0 {
logSearchStorageClass = tenantReq.Pools[0].VolumeConfiguration.StorageClassName
}
if tenantReq.LogSearchConfiguration.Image != "" {
logSearchImage = tenantReq.LogSearchConfiguration.Image
}
if tenantReq.LogSearchConfiguration.PostgresImage != "" {
logSearchPgImage = tenantReq.LogSearchConfiguration.PostgresImage
}
}
logSearchDiskSpace := resource.NewQuantity(diskSpaceFromAPI, resource.DecimalExponent)
// default activate lgo search and prometheus
minInst.Spec.Log = &miniov2.LogConfig{
Image: "minio/logsearchapi:v4.0.0",
Audit: &miniov2.AuditConfig{DiskCapacityGB: swag.Int(10)},
Db: &miniov2.LogDbConfig{
VolumeClaimTemplate: &corev1.PersistentVolumeClaim{
@@ -976,24 +989,42 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
},
},
}
if logSearchImage != "" {
minInst.Spec.Log.Image = logSearchImage
}
if logSearchPgImage != "" {
minInst.Spec.Log.Db.Image = logSearchPgImage
}
prometheusDiskSpace := int(5) // Default is 5 by API
prometheusStorageClass := "" // Default is ""
prometheusDiskSpace := 5 // Default is 5 by API
prometheusStorageClass := "" // Default is ""
prometheusImage := "" // Default is ""
if tenantReq.PrometheusConfiguration != nil {
prometheusDiskSpace = int(*tenantReq.PrometheusConfiguration.StorageSize)
prometheusStorageClass = tenantReq.PrometheusConfiguration.StorageClass
if tenantReq.PrometheusConfiguration.StorageSize != nil {
prometheusDiskSpace = int(*tenantReq.PrometheusConfiguration.StorageSize)
}
if tenantReq.PrometheusConfiguration.StorageClass != "" {
prometheusStorageClass = tenantReq.PrometheusConfiguration.StorageClass
}
// Default class name for prometheus
if tenantReq.PrometheusConfiguration.StorageClass == "" && len(tenantReq.Pools) > 0 {
prometheusStorageClass = tenantReq.Pools[0].VolumeConfiguration.StorageClassName
}
if tenantReq.PrometheusConfiguration.Image != "" {
prometheusImage = tenantReq.PrometheusConfiguration.Image
}
}
minInst.Spec.Prometheus = &miniov2.PrometheusConfig{
DiskCapacityDB: swag.Int(prometheusDiskSpace),
StorageClassName: &prometheusStorageClass,
}
if prometheusImage != "" {
minInst.Spec.Prometheus.Image = prometheusImage
}
// expose services
if tenantReq.ExposeMinio || tenantReq.ExposeConsole {
@@ -1001,7 +1032,6 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
MinIO: tenantReq.ExposeMinio,
Console: tenantReq.ExposeConsole,
}
log.Println("happened")
}
opClient, err := cluster.OperatorClient(session.STSSessionToken)

View File

@@ -5002,6 +5002,12 @@ func init() {
"logSearchConfiguration": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"postgres_image": {
"type": "string"
},
"storageClass": {
"type": "string",
"default": ""
@@ -5867,6 +5873,9 @@ func init() {
"prometheusConfiguration": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"storageClass": {
"type": "string",
"default": ""
@@ -12319,6 +12328,12 @@ func init() {
"logSearchConfiguration": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"postgres_image": {
"type": "string"
},
"storageClass": {
"type": "string",
"default": ""
@@ -13049,6 +13064,9 @@ func init() {
"prometheusConfiguration": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"storageClass": {
"type": "string",
"default": ""

View File

@@ -4661,6 +4661,10 @@ definitions:
storageSize:
type: number
default: 5
image:
type: string
postgres_image:
type: string
prometheusConfiguration:
type: object
@@ -4671,6 +4675,8 @@ definitions:
storageSize:
type: number
default: 5
image:
type: string
tier_s3:
type: object
properties: