Compare commits

...

7 Commits

Author SHA1 Message Date
Feng Ruohang a8e5cc4c13 Merge the updated #351 branch into the Helm follow-up
Signed-off-by: Feng Ruohang <rh@vonng.com>
2026-11-25 12:06:00 +08:00
Feng Ruohang 3960a36853 Merge branch 'main' into helm-updates 2026-11-25 12:05:02 +08:00
Feng Ruohang c78813cac9 Merge pull request #358 from pgsty/codex/fix-gobwas-ws-6940
Signed-off-by: Feng Ruohang <rh@vonng.com>
2026-11-25 12:04:42 +08:00
Feng Ruohang e5296263f0 fix(grid): bound WebSocket read reservations and update gobwas/ws
Signed-off-by: Feng Ruohang <rh@vonng.com>
2026-11-25 11:46:51 +08:00
Feng Ruohang 7226aaf3fc fix(helm): preserve upgrade values and validate chart publication
Signed-off-by: Feng Ruohang <rh@vonng.com>
2026-11-25 11:35:05 +08:00
Trey Dockendorf 2b96153a61 [helm] Improvements to Helm chart
* Support releasing on “chart-<version>” tags, fixes #223
* Add commonLabels that are used on all resources
* Support templated values in numerous locations
* Add oidc.existingConfigMapName and oidc.existingConfigUrlKey
* Add networkPolicy.allowFrom
* support targetLabels on ServiceMonitor
* Support Probe relabelingConfigs
* Allow postJob default containerSecurityContext
* Allow policies to be templated string
* Set MINIO_BROWSER_REDIRECT_URL
* Ensure job egress only enabled when networkPolicy.egress.enabled set

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2026-11-24 16:34:30 -05:00
Feng Ruohang d66020003c docs(readme): update current release to SILO 20261112 and Console 2.7.2
Signed-off-by: Feng Ruohang <rh@vonng.com>
2026-11-12 14:20:56 +08:00
37 changed files with 486 additions and 259 deletions
+45
View File
@@ -0,0 +1,45 @@
name: Publish Helm Chart to GHCR
on:
push:
tags:
- "chart-*"
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install Helm
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
with:
version: v4.3.2
- name: Validate tag and package chart
run: |
set -euo pipefail
version="$(helm show chart helm/silo | sed -n 's/^version: //p')"
if [[ -z "$version" || "$GITHUB_REF_NAME" != "chart-$version" ]]; then
echo "Expected chart-$version for helm/silo, got $GITHUB_REF_NAME" >&2
exit 1
fi
helm lint helm/silo
helm package helm/silo --destination "$RUNNER_TEMP"
- name: Log in to GitHub Container Registry
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
printf '%s' "$GH_TOKEN" | helm registry login ghcr.io \
--username "$GITHUB_ACTOR" --password-stdin
- name: Push chart
run: |
helm push "$RUNNER_TEMP/silo-${GITHUB_REF_NAME#chart-}.tgz" \
"oci://ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/charts"
+1
View File
@@ -37,6 +37,7 @@ on:
- "buildscripts/rebrand-guard/**"
- "buildscripts/gen-ldflags.go"
- ".github/workflows/release.yml"
- ".github/workflows/release-helm.yml"
- ".github/workflows/docker-release.yml"
- ".github/workflows/finalize-release.yml"
- ".github/workflows/test-release.yml"
+20 -24
View File
File diff suppressed because one or more lines are too long
-27
View File
@@ -12037,33 +12037,6 @@ SOFTWARE.
================================================================
github.com/gobwas/pool
https://github.com/gobwas/pool
----------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2017-2019 Sergey Kamardin <gobwas@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================================
github.com/gobwas/ws
https://github.com/gobwas/ws
----------------------------------------------------------------
+4 -4
View File
@@ -44,10 +44,10 @@ It follows one rule: **the product and its delivery surfaces are renamed; the pr
<img src="https://silo.pgsty.com/images/silo-console/console-metrics-simple.webp" alt="Silo Console">
</p>
### SILO 20261109
### SILO 20261112
> [!WARNING]
> [SILO 20261109](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-11-09T00-00-00Z) (`20261109000000.0.0`, source `d998292387cc`) fixes storage, lifecycle, native restore, Object Lock, batch authorization, and IAM defects, embedding Console `v2.7.0` with `mcli 20261109`, `silo-pkg v3.16.0`, and Go `1.27.3`. Review the [release notes and upgrade requirements](https://silo.pgsty.com/blog/release/silo-20261109/) before upgrading.
> [SILO 20261112](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-11-12T00-00-00Z) (`20261112000000.0.0`, source `44e848fedf8c`) fixes S3 bulk-delete path validation and Object Lock boundaries, service-account inline-policy preservation and IAM import status, active-active tagging proxy authorization, streaming trailer replay windows, `GetObjectAttributes` and ZIP archive tag authorization, compressed encrypted range reads, lifecycle old-header revision matching, and multi-pass pool decommissioning, embedding Console `v2.7.2` with `mcli 20261112`, `silo-pkg v3.16.1`, and Go `1.27.4`. Review the [release notes and upgrade requirements](https://silo.pgsty.com/blog/release/silo-20261112/) before upgrading.
> [!NOTE]
> On 2026-08-06, `pgsty/minio` became `pgsty/silo`, and the default branch changed from `master` to `main`. The last MinIO-branded release is [`20260804`](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-08-04T00-00-00Z) on the [`minio`](https://github.com/pgsty/silo/tree/minio) branch.
@@ -59,7 +59,7 @@ docker run -d --name silo -p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=change-me-long-password \
-v "$PWD/data:/data" \
docker.io/pgsty/silo:RELEASE.2026-11-09T00-00-00Z server /data --console-address ":9001"
docker.io/pgsty/silo:RELEASE.2026-11-12T00-00-00Z server /data --console-address ":9001"
```
<p align="center">
@@ -98,7 +98,7 @@ Every divergence from upstream is listed in the code-verified [compatibility aud
### TLS and Go upgrades
Server 20260916 restored Go's default key exchange; Server 20261109 retains it with Go 1.27.3.
Server 20260916 restored Go's default key exchange; Server 20261112 retains it with Go 1.27.4.
TLS key exchange follows Go's defaults across the S3 listener, node links,
replication, identity providers, etcd, and external HTTP services. If an endpoint
cannot accept ML-KEM, `GODEBUG=tlsmlkem=0` disables the default hybrid exchanges
+4 -4
View File
@@ -44,10 +44,10 @@
<img src="https://silo.pgsty.com/images/silo-console/console-metrics-simple.webp" alt="Silo 控制台">
</p>
### SILO 20261109
### SILO 20261112
> [!WARNING]
> [SILO 20261109](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-11-09T00-00-00Z)(包版本 `20261109000000.0.0`,源码 `d998292387cc`)修复了多池生命周期、原生恢复、Object Lock、批处理授权与 IAM 等缺陷,内嵌 Console `v2.7.0` 并配套 `mcli 20261109`、`silo-pkg v3.16.0` 与 Go `1.27.3`。升级前请阅读[发布说明与升级要求](https://silo.pgsty.com/zh/blog/release/silo-20261109/)。
> [SILO 20261112](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-11-12T00-00-00Z)(包版本 `20261112000000.0.0`,源码 `44e848fedf8c`)修复了 S3 批量删除路径校验与对象锁边界、服务账号内联策略保留与 IAM 导入状态、双活标签代理鉴权、无签名尾标流重放窗口、`GetObjectAttributes` 与 ZIP 归档标签鉴权、压缩加密区间读取、生命周期旧头部修订匹配以及存储池多轮退役等缺陷,内嵌 Console `v2.7.2` 并配套 `mcli 20261112`、`silo-pkg v3.16.1` 与 Go `1.27.4`。升级前请阅读[发布说明与升级要求](https://silo.pgsty.com/zh/blog/release/silo-20261112/)。
> [!NOTE]
> 2026-08-06,`pgsty/minio` 更名为 `pgsty/silo`,默认分支由 `master` 改为 `main`。最后一个 MinIO 品牌发布是 [`minio`](https://github.com/pgsty/silo/tree/minio) 分支上的 [`20260804`](https://github.com/pgsty/silo/releases/tag/RELEASE.2026-08-04T00-00-00Z)。
@@ -59,7 +59,7 @@ docker run -d --name silo -p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=change-me-long-password \
-v "$PWD/data:/data" \
docker.io/pgsty/silo:RELEASE.2026-11-09T00-00-00Z server /data --console-address ":9001"
docker.io/pgsty/silo:RELEASE.2026-11-12T00-00-00Z server /data --console-address ":9001"
```
<p align="center">
@@ -98,7 +98,7 @@ Silo 保留 S3 与存储格式兼容性,包括既有 `MINIO_*` 环境变量、
### TLS 与 Go 升级
Server 20260916 恢复了 Go 默认密钥交换策略,Server 20261109 在 Go 1.27.3 下保留该行为。S3 监听端口、节点间连接、站点与桶复制、身份提供方、etcd 及外部 HTTP 服务均使用 Go 默认 TLS 密钥交换。若对端无法接受 ML-KEM,设置 `GODEBUG=tlsmlkem=0` 可在当前进程禁用默认混合密钥交换(证书校验保持开启);该选项不会禁用 ML-DSA 签名,也不能解决所有 TLS 连接重置问题,建议在升级不兼容对端后移除该临时配置。若仅新增的 SecP 混合组引发问题,可设置 `GODEBUG=tlssecpmlkem=0` 仅禁用这些组并保留 `X25519MLKEM768`。
Server 20260916 恢复了 Go 默认密钥交换策略,Server 20261112 在 Go 1.27.4 下保留该行为。S3 监听端口、节点间连接、站点与桶复制、身份提供方、etcd 及外部 HTTP 服务均使用 Go 默认 TLS 密钥交换。若对端无法接受 ML-KEM,设置 `GODEBUG=tlsmlkem=0` 可在当前进程禁用默认混合密钥交换(证书校验保持开启);该选项不会禁用 ML-DSA 签名,也不能解决所有 TLS 连接重置问题,建议在升级不兼容对端后移除该临时配置。若仅新增的 SecP 混合组引发问题,可设置 `GODEBUG=tlssecpmlkem=0` 仅禁用这些组并保留 `X25519MLKEM768`。
在 Go 1.27 构建中,macOS 上设置 `SSL_CERT_FILE` 或 `SSL_CERT_DIR` 会以磁盘根证书和 Go 验证器替代系统钥匙串信任;陈旧或不完整的 CA 路径可能导致原先受信任的连接失败,清除继承的环境变量即可恢复钥匙串信任。配置的 `CAs` 目录中的显式证书仍会叠加加入所选根证书池。Go 1.27 二进制要求 macOS 13 或更高版本。详见 [Go 1.27 发行说明](https://go.dev/doc/go1.27)与 [Go 1.27 TLS 与 OIDC 发现指南](https://silo.pgsty.com/zh/blog/design/go127-tls-oidc-discovery/)。
@@ -0,0 +1,32 @@
rootUser: silo-admin
rootPassword: 'literal-{{ .Release.Name }}'
buckets:
- name: chart-test
tls:
enabled: true
certSecret: silo-tls
trustedCertsSecret: silo-trusted-ca
ingress:
enabled: true
tls:
- hosts: [s3.example.test]
consoleIngress:
enabled: true
tls:
- hosts: [console.example.test]
networkPolicy:
enabled: true
podDisruptionBudget:
enabled: true
metrics:
serviceMonitor:
enabled: true
includeNode: true
oidc:
enabled: true
existingConfigMapName: chart-oidc
existingConfigUrlKey: discovery
redirectUri: https://console.example.test/oauth_callback
imagePullSecrets:
- name: primary-pull
- name: '{{ .Release.Name }}-pull'
@@ -0,0 +1,7 @@
apiVersion: v2
name: consumer
version: 0.1.0
dependencies:
- name: silo
alias: objects
version: "*"
@@ -0,0 +1,6 @@
global:
storageClass: site-storage
bucketSuffix: archive
objects:
buckets:
- name: '{{ .Release.Name }}-{{ .Values.global.bucketSuffix }}'
+40 -24
View File
@@ -40,6 +40,17 @@ else
}
fi
expect_rendered() {
local render="$1" expected
shift
for expected in "$@"; do
grep -F -- "${expected}" "${render}" >/dev/null || {
echo "${render} is missing: ${expected}" >&2
exit 1
}
done
}
helm_run lint "${new_chart}"
helm_run template silo "${new_chart}" \
--namespace silo \
@@ -53,23 +64,23 @@ helm_run template silo "${new_chart}" \
--set rootUser=silo-admin \
--set rootPassword=test-password-123456 >/dev/null
# Exercise optional templates that the default render leaves dormant.
helm_run template silo-all "${new_chart}" \
--namespace silo \
--set rootUser=silo-admin \
--set rootPassword=test-password-123456 \
--set tls.enabled=true \
--set tls.certSecret=silo-tls \
--set trustedCertsSecret=silo-trusted-ca \
--set ingress.enabled=true \
--set consoleIngress.enabled=true \
--set networkPolicy.enabled=true \
--set podDisruptionBudget.enabled=true \
--set metrics.serviceMonitor.enabled=true \
--set metrics.serviceMonitor.includeNode=true \
--set 'buckets[0].name=chart-test' \
--set 'buckets[0].policy=none' \
--set 'buckets[0].purge=false' >/dev/null
# Exercise the persisted standalone PVC, optional legacy values, and OIDC in both workloads.
cp buildscripts/helm-migration-guard/testdata/optional-values.yaml "${work_dir}/optional-values.yaml"
for mode in standalone distributed; do
render="${work_dir}/${mode}.yaml"
helm_run template silo-all "${new_chart}" --namespace silo \
-f "${output_dir}/optional-values.yaml" --set "mode=${mode}" >"${render}"
expect_rendered "${render}" \
'createBucket chart-test "none" false "" false' \
'name: "chart-oidc"' \
'key: "discovery"' \
'value: "https://console.example.test/oauth_callback"' \
"rootPassword: \"$(printf '%s' 'literal-{{ .Release.Name }}' | base64)\""
if grep -F -- 'name: MINIO_BROWSER_REDIRECT_URL' "${render}" >/dev/null; then
echo "${mode} sets a browser redirect without a configured URL" >&2
exit 1
fi
done
# Existing values commonly address the historical myminio target. Render the
# custom-command path explicitly so both the new and compatibility aliases are
@@ -81,15 +92,10 @@ helm_run template silo-custom "${new_chart}" \
--set rootPassword=test-password-123456 \
--set-string 'customCommands[0].command=admin info myminio' \
--show-only templates/configmap.yaml >"${custom_render}"
for expected in \
expect_rendered "${custom_render}" \
'alias set mysilo' \
'alias set myminio' \
'runCommand admin info myminio'; do
grep -F -- "${expected}" "${custom_render}" >/dev/null || {
echo "rendered custom command is missing: ${expected}" >&2
exit 1
}
done
'runCommand admin info myminio'
old_render="${work_dir}/legacy.yaml"
new_render="${work_dir}/candidate.yaml"
@@ -132,4 +138,14 @@ if find "${work_dir}" -maxdepth 1 -type f -name 'minio-*.tgz' | grep -q .; then
exit 1
fi
# Render the packaged chart under an alias, with values inherited from its parent.
cp -R buildscripts/helm-migration-guard/testdata/parent "${work_dir}/parent"
mkdir "${work_dir}/parent/charts"
cp "${work_dir}/silo-${chart_version}.tgz" "${work_dir}/parent/charts/"
helm_run template consumer "${output_dir}/parent" >"${work_dir}/parent.yaml"
expect_rendered "${work_dir}/parent.yaml" \
'name: consumer-objects' \
'storageClassName: "site-storage"' \
'createBucket consumer-archive "none" false "" false'
echo "Silo Helm lint, render, legacy-upgrade, and package checks passed"
+1 -2
View File
@@ -44,7 +44,7 @@ require (
github.com/go-ldap/ldap/v3 v3.4.15
github.com/go-openapi/loads v0.25.3
github.com/go-sql-driver/mysql v1.10.1
github.com/gobwas/ws v1.4.0
github.com/gobwas/ws v1.5.0
github.com/golang-jwt/jwt/v4 v4.5.2
github.com/gomodule/redigo v1.9.3
github.com/google/uuid v1.6.0
@@ -191,7 +191,6 @@ require (
github.com/go-openapi/validate v1.0.1 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/goccy/go-json v0.11.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
+2 -3
View File
@@ -247,11 +247,10 @@ github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPE
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs=
github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc=
github.com/gobwas/ws v1.5.0 h1:jWzPex0GE9QidvBrBNddDmC5aZzvCXTg2qCZ/UA6nLg=
github.com/gobwas/ws v1.5.0/go.mod h1:q9xc6wHP8xO4NsQjTN1y7E37A9+fV/Xz2LgNcyeRbyE=
github.com/goccy/go-json v0.11.2 h1:jdZv93Tt4ioR8yW1CoNsvSxrcZlCXAUU1aZXN7gpXUA=
github.com/goccy/go-json v0.11.2/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
description: S3-Interface Libre Object Storage
name: silo
version: 7.0.5
version: 7.1.0
appVersion: RELEASE.2026-11-12T00-00-00Z
keywords:
- silo
+14 -4
View File
@@ -7,12 +7,12 @@ The chart and server are licensed under AGPL-3.0-or-later.
## Prerequisites
- Kubernetes 1.19 or later
- Helm 3
- Helm 3 or 4
- A PersistentVolume provisioner unless `persistence.enabled=false`
## Install
From this repository:
From the source checkout:
```bash
helm install silo ./helm/silo \
@@ -21,6 +21,9 @@ helm install silo ./helm/silo \
--set rootPassword='replace-with-a-long-random-secret'
```
For a version published on GHCR, use `oci://ghcr.io/pgsty/charts/silo` in
place of `./helm/silo` and pass `--version <chart-version>`.
For a disposable standalone installation:
```bash
@@ -122,8 +125,12 @@ When upgrading an existing Silo release to `RELEASE.2026-11-12T00-00-00Z` (chart
## Persistence and TLS
The default PersistentVolumeClaim mounts at `/export`. Use an existing claim
with:
The default PersistentVolumeClaim mounts at `/export`. New claims use
`persistence.storageClass` or inherit `global.storageClass` from a parent chart.
Helm preserves the existing storage class during a connected upgrade when only
the parent supplies a default.
Use an existing claim with:
```bash
helm install silo ./helm/silo --set persistence.existingClaim=PVC_NAME
@@ -141,6 +148,9 @@ Additional trusted CAs can be supplied through `trustedCertsSecret`.
## Existing Secrets and post-install resources
The chart treats `rootUser` and `rootPassword` as literal values. A parent chart
can opt into evaluating both as Helm templates with `tplRootCredentials: true`.
Set `existingSecret` to a Secret containing `rootUser` and `rootPassword`.
Buckets, users, policies, service accounts, and custom commands can be created
with the existing `buckets`, `users`, `policies`, `svcaccts`, and
@@ -119,5 +119,5 @@ connectToSilo $scheme
{{ $global := . }}
# Create the buckets
{{- range .Values.buckets }}
createBucket {{ tpl .name $global }} {{ .policy | default "none" | quote }} {{ .purge | default false }} {{ .versioning | default "" }} {{ .objectlocking | default false }}{{- end }}
createBucket {{ tpl .name $global }} {{ tpl (default "none" .policy) $global | default "none" | quote }} {{ .purge | default false }} {{ ternary .versioning "" (ne .versioning nil) | quote }} {{ .objectlocking | default false }}{{- end }}
{{- end }}
@@ -68,8 +68,12 @@ scheme=http
connectToSilo $scheme
{{ if .Values.policies }}
{{- $policies := .Values.policies }}
{{- if typeIs "string" .Values.policies }}
{{- $policies = tpl .Values.policies . | fromYamlArray }}
{{- end }}
# Create the policies
{{- range $idx, $policy := .Values.policies }}
{{- range $idx, $policy := $policies }}
createPolicy {{ $policy.name }} policy_{{ $idx }}
{{- end }}
{{- end }}
+88 -20
View File
@@ -119,26 +119,34 @@ Properly format optional additional arguments to Silo binary
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "silo.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets }}
{{- else if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets }}
{{- with (or (.Values.global | default dict).imagePullSecrets .Values.imagePullSecrets) }}
imagePullSecrets: {{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
{{- end -}}
{{- else if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets }}
{{/* Keep the class already chosen for an existing claim when a parent supplies a default. */}}
{{- define "silo.storageClass" -}}
{{- $class := or .Values.persistence.storageClass (.Values.global | default dict).storageClass -}}
{{- if $class -}}
{{- $spec := dict "storageClassName" (ternary "" $class (eq $class "-")) -}}
{{- if and .Release.IsUpgrade (not .Values.persistence.storageClass) -}}
{{- $name := include "silo.fullname" . -}}
{{- if eq .Values.mode "standalone" -}}
{{- with (lookup "v1" "PersistentVolumeClaim" .Release.Namespace $name) -}}
{{- $spec = .spec -}}
{{- end -}}
{{- else -}}
{{- with (lookup "apps/v1" "StatefulSet" .Release.Namespace $name) -}}
{{- with .spec.volumeClaimTemplates -}}
{{- $spec = (first .).spec -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if hasKey $spec "storageClassName" -}}
storageClassName: {{ $spec.storageClassName | quote }}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -201,7 +209,11 @@ otherwise it generates a random value.
{{- define "silo.root.username" -}}
{{- if .Values.rootUser }}
{{- .Values.rootUser | toString }}
{{- if .Values.tplRootCredentials }}
{{- tpl (.Values.rootUser | toString) . }}
{{- else }}
{{- .Values.rootUser | toString }}
{{- end }}
{{- else }}
{{- include "silo.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "silo.fullname" .) "Length" 20 "Key" "rootUser") }}
{{- end }}
@@ -209,8 +221,64 @@ otherwise it generates a random value.
{{- define "silo.root.password" -}}
{{- if .Values.rootPassword }}
{{- .Values.rootPassword | toString }}
{{- if .Values.tplRootCredentials }}
{{- tpl (.Values.rootPassword | toString) . }}
{{- else }}
{{- .Values.rootPassword | toString }}
{{- end }}
{{- else }}
{{- include "silo.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "silo.fullname" .) "Length" 40 "Key" "rootPassword") }}
{{- end }}
{{- end -}}
{{/* OIDC environment shared by the standalone and distributed workloads. */}}
{{- define "silo.oidcEnv" -}}
{{- $oidc := .Values.oidc -}}
{{- if $oidc.enabled -}}
- name: MINIO_IDENTITY_OPENID_CONFIG_URL
{{- if and $oidc.existingConfigMapName $oidc.existingConfigUrlKey }}
valueFrom:
configMapKeyRef:
name: {{ $oidc.existingConfigMapName | quote }}
key: {{ $oidc.existingConfigUrlKey | quote }}
{{- else }}
value: {{ $oidc.configUrl | quote }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLIENT_ID
{{- if and $oidc.existingClientSecretName $oidc.existingClientIdKey }}
valueFrom:
secretKeyRef:
name: {{ $oidc.existingClientSecretName | quote }}
key: {{ $oidc.existingClientIdKey | quote }}
{{- else }}
value: {{ $oidc.clientId | quote }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
{{- if and $oidc.existingClientSecretName $oidc.existingClientSecretKey }}
valueFrom:
secretKeyRef:
name: {{ $oidc.existingClientSecretName | quote }}
key: {{ $oidc.existingClientSecretKey | quote }}
{{- else }}
value: {{ $oidc.clientSecret | quote }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
value: {{ $oidc.claimName | quote }}
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
value: {{ $oidc.claimPrefix | quote }}
- name: MINIO_IDENTITY_OPENID_SCOPES
value: {{ tpl $oidc.scopes . | quote }}
- name: MINIO_IDENTITY_OPENID_COMMENT
value: {{ $oidc.comment | quote }}
{{- with $oidc.redirectUri }}
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
value: {{ tpl . $ | quote }}
{{- end }}
{{- if and $oidc.redirectUrl (not (hasKey (.Values.environment | default dict) "MINIO_BROWSER_REDIRECT_URL")) }}
- name: MINIO_BROWSER_REDIRECT_URL
value: {{ tpl $oidc.redirectUrl . | quote }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_DISPLAY_NAME
value: {{ $oidc.displayName | quote }}
{{- end }}
{{- end -}}
@@ -8,6 +8,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
endpointSelector:
matchLabels:
+8 -1
View File
@@ -7,6 +7,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
data:
initialize: |-
{{- include (print $.Template.BasePath "/_helper_create_bucket.txt") . | nindent 4 }}
@@ -14,7 +17,11 @@ data:
{{- include (print $.Template.BasePath "/_helper_create_user.txt") . | nindent 4 }}
add-policy: |-
{{- include (print $.Template.BasePath "/_helper_create_policy.txt") . | nindent 4 }}
{{- range $idx, $policy := .Values.policies }}
{{- $policies := .Values.policies }}
{{- if typeIs "string" .Values.policies }}
{{- $policies = tpl .Values.policies . | fromYamlArray }}
{{- end }}
{{- range $idx, $policy := $policies }}
# Policy: {{ $policy.name }}
policy_{{ $idx }}.json: |-
{{- include (print $.Template.BasePath "/_helper_policy.tpl") . | nindent 4 }}
+9 -4
View File
@@ -12,10 +12,13 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.consoleIngress.labels }}
{{- toYaml . | nindent 4 }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.consoleIngress.annotations }}
annotations: {{- toYaml . | nindent 4 }}
annotations: {{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
{{- if .Values.consoleIngress.ingressClassName }}
@@ -26,9 +29,11 @@ spec:
{{- range .Values.consoleIngress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
- {{ tpl . $ | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ tpl . $ | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
+6 -2
View File
@@ -8,8 +8,12 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.consoleService.annotations }}
annotations: {{- toYaml .Values.consoleService.annotations | nindent 4 }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.consoleService.annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.consoleService.type }}
+16 -42
View File
@@ -10,11 +10,15 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{- toYaml .Values.additionalLabels | nindent 4 }}
{{- with .Values.additionalLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- if .Values.additionalAnnotations }}
annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
strategy:
@@ -35,8 +39,11 @@ spec:
labels:
app: {{ template "silo.name" . }}
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- with .Values.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
annotations:
{{- if not .Values.ignoreChartChecksums }}
@@ -62,7 +69,7 @@ spec:
{{- end }}
containers:
- name: {{ include "silo.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
image: "{{ tpl .Values.image.repository . }}:{{ tpl (.Values.image.tag | toString) . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- "/bin/sh"
@@ -109,40 +116,7 @@ spec:
- name: MINIO_PROMETHEUS_AUTH_TYPE
value: "public"
{{- end }}
{{- if .Values.oidc.enabled }}
- name: MINIO_IDENTITY_OPENID_CONFIG_URL
value: {{ .Values.oidc.configUrl }}
- name: MINIO_IDENTITY_OPENID_CLIENT_ID
{{- if and .Values.oidc.existingClientSecretName .Values.oidc.existingClientIdKey }}
valueFrom:
secretKeyRef:
name: {{ .Values.oidc.existingClientSecretName }}
key: {{ .Values.oidc.existingClientIdKey }}
{{- else }}
value: {{ .Values.oidc.clientId }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
{{- if and .Values.oidc.existingClientSecretName .Values.oidc.existingClientSecretKey }}
valueFrom:
secretKeyRef:
name: {{ .Values.oidc.existingClientSecretName }}
key: {{ .Values.oidc.existingClientSecretKey }}
{{- else }}
value: {{ .Values.oidc.clientSecret }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
value: {{ .Values.oidc.claimName }}
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
value: {{ .Values.oidc.claimPrefix }}
- name: MINIO_IDENTITY_OPENID_SCOPES
value: {{ .Values.oidc.scopes }}
- name: MINIO_IDENTITY_OPENID_COMMENT
value: {{ .Values.oidc.comment }}
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
value: {{ .Values.oidc.redirectUri }}
- name: MINIO_IDENTITY_OPENID_DISPLAY_NAME
value: {{ .Values.oidc.displayName }}
{{- end }}
{{- include "silo.oidcEnv" . | nindent 12 }}
{{- if .Values.etcd.endpoints }}
- name: MINIO_ETCD_ENDPOINTS
value: {{ join "," .Values.etcd.endpoints | quote }}
@@ -181,7 +155,7 @@ spec:
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
nodeSelector: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- include "silo.imagePullSecrets" . | indent 6 }}
{{- with .Values.affinity }}
+9 -4
View File
@@ -12,10 +12,13 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations: {{- toYaml . | nindent 4 }}
annotations: {{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
@@ -26,9 +29,11 @@ spec:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
- {{ tpl . $ | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ tpl . $ | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
+14 -3
View File
@@ -8,6 +8,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
podSelector:
matchLabels:
@@ -19,11 +22,16 @@ spec:
protocol: TCP
- port: {{ .Values.minioConsolePort }}
protocol: TCP
{{- if not .Values.networkPolicy.allowExternal }}
{{- if or (not .Values.networkPolicy.allowExternal) .Values.networkPolicy.allowFrom }}
from:
{{- if not .Values.networkPolicy.allowExternal }}
- podSelector:
matchLabels:
{{ template "silo.name" . }}-client: "true"
{{- end }}
{{- with .Values.networkPolicy.allowFrom }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.networkPolicy.egress.enabled }}
egress:
@@ -34,6 +42,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.networkPolicy.egress.enabled }}
---
kind: NetworkPolicy
apiVersion: {{ template "silo.networkPolicy.apiVersion" . }}
@@ -44,6 +53,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
podSelector:
matchLabels:
@@ -55,12 +67,11 @@ spec:
protocol: TCP
- port: {{ .Values.minioConsolePort }}
protocol: TCP
{{- if .Values.networkPolicy.egress.enabled }}
- ports:
{{ .Values.networkPolicy.egress.ports | toJson }}
{{- with .Values.networkPolicy.egress.to }}
to:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -9,6 +9,9 @@ metadata:
name: {{ template "silo.fullname" . }}
labels:
app: {{ template "silo.name" . }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
selector:
+21 -15
View File
@@ -8,11 +8,14 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
{{- with .Values.postJob.annotations }}
{{- toYaml . | nindent 4 }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
template:
@@ -21,7 +24,10 @@ spec:
app: {{ template "silo.name" . }}-job
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if .Values.postJob.podAnnotations }}
annotations: {{- toYaml .Values.postJob.podAnnotations | nindent 8 }}
@@ -29,8 +35,8 @@ spec:
spec:
restartPolicy: OnFailure
{{- include "silo.imagePullSecrets" . | indent 6 }}
{{- if .Values.nodeSelector }}
nodeSelector: {{- toYaml .Values.postJob.nodeSelector | nindent 8 }}
{{- with (.Values.postJob.nodeSelector | default .Values.nodeSelector) }}
nodeSelector: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.postJob.affinity }}
affinity: {{- toYaml . | nindent 8 }}
@@ -39,7 +45,7 @@ spec:
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.postJob.securityContext.enabled }}
securityContext: {{ omit .Values.postJob.securityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{ omit .Values.postJob.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
volumes:
- name: etc-path
@@ -88,9 +94,9 @@ spec:
{{- if .Values.policies }}
initContainers:
- name: silo-make-policy
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl (.Values.mcImage.tag | toString) . }}"
{{- if .Values.makePolicyJob.securityContext.enabled }}
{{- with .Values.makePolicyJob.containerSecurityContext }}
{{- with .Values.makePolicyJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
@@ -122,9 +128,9 @@ spec:
containers:
{{- if .Values.buckets }}
- name: silo-make-bucket
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl (.Values.mcImage.tag | toString) . }}"
{{- if .Values.makeBucketJob.securityContext.enabled }}
{{- with .Values.makeBucketJob.containerSecurityContext }}
{{- with .Values.makeBucketJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
@@ -155,9 +161,9 @@ spec:
{{- end }}
{{- if .Values.users }}
- name: silo-make-user
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl (.Values.mcImage.tag | toString) . }}"
{{- if .Values.makeUserJob.securityContext.enabled }}
{{- with .Values.makeUserJob.containerSecurityContext }}
{{- with .Values.makeUserJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
@@ -188,9 +194,9 @@ spec:
{{- end }}
{{- if .Values.customCommands }}
- name: silo-custom-command
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl (.Values.mcImage.tag | toString) . }}"
{{- if .Values.customCommandJob.securityContext.enabled }}
{{- with .Values.customCommandJob.containerSecurityContext }}
{{- with .Values.customCommandJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
@@ -224,9 +230,9 @@ spec:
{{- end }}
{{- if .Values.svcaccts }}
- name: silo-make-svcacct
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl (.Values.mcImage.tag | toString) . }}"
{{- if .Values.makeServiceAccountJob.securityContext.enabled }}
{{- with .Values.makeServiceAccountJob.containerSecurityContext }}
{{- with .Values.makeServiceAccountJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
+8 -8
View File
@@ -9,8 +9,12 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.persistence.annotations }}
annotations: {{- toYaml .Values.persistence.annotations | nindent 4 }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.persistence.annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
accessModes:
@@ -18,12 +22,8 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- with (include "silo.storageClass" .) }}
{{- . | nindent 2 }}
{{- end }}
{{- if .Values.persistence.volumeName }}
volumeName: "{{ .Values.persistence.volumeName }}"
+3
View File
@@ -8,6 +8,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
type: Opaque
data:
rootUser: {{ include "silo.root.username" . | b64enc | quote }}
@@ -8,6 +8,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
+6 -2
View File
@@ -9,8 +9,12 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
monitoring: "true"
{{- if .Values.service.annotations }}
annotations: {{- toYaml .Values.service.annotations | nindent 4 }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
+4
View File
@@ -3,4 +3,8 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name | quote }}
{{- with .Values.commonLabels }}
labels:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- end }}
+22 -8
View File
@@ -11,8 +11,11 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.annotations }}
annotations: {{- toYaml .Values.metrics.serviceMonitor.annotations | nindent 4 }}
@@ -39,8 +42,8 @@ spec:
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabelConfigs }}
{{- toYaml .Values.metrics.serviceMonitor.relabelConfigs | nindent 6 }}
{{- with .Values.metrics.serviceMonitor.relabelConfigs }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- if not .Values.metrics.serviceMonitor.public }}
bearerTokenSecret:
@@ -55,6 +58,10 @@ spec:
app: {{ include "silo.name" . }}
release: {{ .Release.Name }}
monitoring: "true"
{{- with .Values.metrics.serviceMonitor.targetLabels }}
targetLabels:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.enabled }}
---
@@ -70,8 +77,11 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
jobName: {{ template "silo.fullname" . }}
@@ -91,13 +101,17 @@ spec:
{{- else }}
scheme: http
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }}
{{- toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | nindent 2 }}
{{- with .Values.metrics.serviceMonitor.relabelConfigsCluster }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
targets:
staticConfig:
static:
- {{ template "silo.fullname" . }}.{{ .Release.Namespace }}
{{- with .Values.metrics.serviceMonitor.probeRelabelingConfigs }}
relabelingConfigs:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if not .Values.metrics.serviceMonitor.public }}
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
+24 -47
View File
@@ -9,7 +9,6 @@
{{ $subPath := .Values.persistence.subPath }}
{{ $penabled := .Values.persistence.enabled }}
{{ $accessMode := .Values.persistence.accessMode }}
{{ $storageClass := .Values.persistence.storageClass }}
{{ $psize := .Values.persistence.size }}
apiVersion: v1
kind: Service
@@ -20,6 +19,9 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
publishNotReadyAddresses: true
clusterIP: None
@@ -41,11 +43,15 @@ metadata:
chart: {{ template "silo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{- toYaml .Values.additionalLabels | nindent 4 }}
{{- with .Values.additionalLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- if .Values.additionalAnnotations }}
annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
updateStrategy:
@@ -63,8 +69,11 @@ spec:
labels:
app: {{ template "silo.name" . }}
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- with .Values.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.commonLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
annotations:
{{- if not .Values.ignoreChartChecksums }}
@@ -90,7 +99,7 @@ spec:
{{- end }}
containers:
- name: {{ include "silo.name" . }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ tpl .Values.image.repository . }}:{{ tpl (.Values.image.tag | toString) . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [
"/bin/sh",
@@ -147,40 +156,7 @@ spec:
- name: MINIO_PROMETHEUS_AUTH_TYPE
value: "public"
{{- end }}
{{- if .Values.oidc.enabled }}
- name: MINIO_IDENTITY_OPENID_CONFIG_URL
value: {{ .Values.oidc.configUrl }}
- name: MINIO_IDENTITY_OPENID_CLIENT_ID
{{- if and .Values.oidc.existingClientSecretName .Values.oidc.existingClientIdKey }}
valueFrom:
secretKeyRef:
name: {{ .Values.oidc.existingClientSecretName }}
key: {{ .Values.oidc.existingClientIdKey }}
{{- else }}
value: {{ .Values.oidc.clientId }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
{{- if and .Values.oidc.existingClientSecretName .Values.oidc.existingClientSecretKey }}
valueFrom:
secretKeyRef:
name: {{ .Values.oidc.existingClientSecretName }}
key: {{ .Values.oidc.existingClientSecretKey }}
{{- else }}
value: {{ .Values.oidc.clientSecret }}
{{- end }}
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
value: {{ .Values.oidc.claimName }}
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
value: {{ .Values.oidc.claimPrefix }}
- name: MINIO_IDENTITY_OPENID_SCOPES
value: {{ .Values.oidc.scopes }}
- name: MINIO_IDENTITY_OPENID_COMMENT
value: {{ .Values.oidc.comment }}
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
value: {{ .Values.oidc.redirectUri }}
- name: MINIO_IDENTITY_OPENID_DISPLAY_NAME
value: {{ .Values.oidc.displayName }}
{{- end }}
{{- include "silo.oidcEnv" . | nindent 12 }}
{{- range $key, $val := .Values.environment }}
- name: {{ $key }}
value: {{ tpl $val $ | quote }}
@@ -199,7 +175,7 @@ spec:
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
nodeSelector: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- include "silo.imagePullSecrets" . | indent 6 }}
{{- with .Values.affinity }}
@@ -227,6 +203,7 @@ spec:
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
{{- if .Values.persistence.enabled }}
{{- $storageClass := include "silo.storageClass" . }}
volumeClaimTemplates:
{{- if gt $drivesPerNode 1 }}
{{- range $diskId := until $drivesPerNode}}
@@ -239,8 +216,8 @@ spec:
{{- end }}
spec:
accessModes: [ {{ $accessMode | quote }} ]
{{- if $storageClass }}
storageClassName: {{ $storageClass }}
{{- with $storageClass }}
{{- . | nindent 8 }}
{{- end }}
resources:
requests:
@@ -256,8 +233,8 @@ spec:
{{- end }}
spec:
accessModes: [ {{ $accessMode | quote }} ]
{{- if $storageClass }}
storageClassName: {{ $storageClass }}
{{- with $storageClass }}
{{- . | nindent 8 }}
{{- end }}
resources:
requests:
+30 -3
View File
@@ -37,6 +37,9 @@ additionalLabels: {}
## Additional annotations to include with deployment or statefulset
additionalAnnotations: {}
## Common labels applied to all resources
commonLabels: {}
## Typically the deployment/statefulset includes checksums of secrets/config,
## So that when these change on a subsequent helm install, the deployment/statefulset
## is restarted. This can result in unnecessary restarts under GitOps tooling such as
@@ -92,6 +95,8 @@ runtimeClassName: ""
##
rootUser: ""
rootPassword: ""
## Evaluate rootUser and rootPassword as Helm templates when explicitly enabled.
tplRootCredentials: false
## Use existing Secret that store following variables:
##
@@ -157,8 +162,8 @@ persistence:
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
## Storage class of PV to bind. By default it looks for standard storage class.
## If the PV uses a different storage class, specify that here.
## An unset value inherits global.storageClass for new claims. During upgrade,
## existing claims retain their provisioned class.
storageClass: ""
volumeName: ""
accessMode: ReadWriteOnce
@@ -358,6 +363,7 @@ makePolicyJob:
enabled: false
runAsUser: 1000
runAsGroup: 1000
containerSecurityContext: {}
resources:
requests:
memory: 128Mi
@@ -388,6 +394,7 @@ makeUserJob:
enabled: false
runAsUser: 1000
runAsGroup: 1000
containerSecurityContext: {}
resources:
requests:
memory: 128Mi
@@ -428,6 +435,7 @@ makeServiceAccountJob:
enabled: false
runAsUser: 1000
runAsGroup: 1000
containerSecurityContext: {}
resources:
requests:
memory: 128Mi
@@ -465,6 +473,7 @@ makeBucketJob:
enabled: false
runAsUser: 1000
runAsGroup: 1000
containerSecurityContext: {}
resources:
requests:
memory: 128Mi
@@ -483,6 +492,7 @@ customCommandJob:
enabled: false
runAsUser: 1000
runAsGroup: 1000
containerSecurityContext: {}
resources:
requests:
memory: 128Mi
@@ -510,6 +520,7 @@ postJob:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containerSecurityContext: {}
nodeSelector: {}
tolerations: []
affinity: {}
@@ -532,6 +543,9 @@ extraSecret: ~
oidc:
enabled: false
configUrl: "https://identity-provider-url/.well-known/openid-configuration"
# Provide existing ConfigMap for the Config URL
existingConfigMapName: ""
existingConfigUrlKey: ""
clientId: "silo"
clientSecret: ""
# Provide existing client secret from the Kubernetes Secret resource, existing secret will have priority over `clientId` and/or `clientSecret``
@@ -540,7 +554,10 @@ oidc:
existingClientSecretKey: ""
claimName: "policy"
scopes: "openid,profile,email"
redirectUri: "https://console-endpoint-url/oauth_callback"
# Legacy callback URL, including /oauth_callback, for existing installations.
redirectUri: ""
# Public Console base URL. An explicit environment.MINIO_BROWSER_REDIRECT_URL takes priority.
redirectUrl: ""
# Can leave empty
claimPrefix: ""
comment: ""
@@ -553,6 +570,12 @@ networkPolicy:
flavor: kubernetes
# Allow external access to the Silo API.
allowExternal: true
# Additional from values to add to the Ingress
allowFrom: []
## E.X.
# - namespaceSelector:
# matchLabels:
# kubernetes.io/metadata.name: prometheus
## @params networkPolicy.egress configuration of the egress traffic
egress:
## @param networkPolicy.egress.enabled When enabled, an egress network policy will be
@@ -604,6 +627,8 @@ metrics:
public: true
additionalLabels: {}
annotations: {}
# targetLabels for the ServiceMonitor
targetLabels: []
# for node metrics
relabelConfigs: {}
# for cluster metrics
@@ -612,6 +637,8 @@ metrics:
# metricRelabelings:
# - regex: (server|pod)
# action: labeldrop
# Probe relabelingConfigs added to the probe target
probeRelabelingConfigs: []
namespace: ~
# Scrape interval, for example `interval: 30s`
interval: ~
+2 -5
View File
@@ -965,7 +965,6 @@ func (c *Connection) readStream(ctx context.Context, conn net.Conn, cancel conte
OnIntermediate: controlHandler,
}
readDataInto := func(dst []byte, s ws.State, want ws.OpCode) ([]byte, error) {
dst = dst[:0]
for {
hdr, err := wsReader.NextFrame()
if err != nil {
@@ -983,13 +982,11 @@ func (c *Connection) readStream(ctx context.Context, conn net.Conn, cancel conte
}
continue
}
if int64(cap(dst)) < hdr.Length+1 {
dst = make([]byte, 0, hdr.Length+hdr.Length>>3)
}
dst = frameReadBuffer(dst, hdr.Length)
if !hdr.Fin {
hdr.Length = -1
}
return readAllInto(dst[:0], &wsReader, hdr.Length)
return readAllInto(dst, &wsReader, hdr.Length)
}
}
+10
View File
@@ -122,6 +122,16 @@ var PutByteBuffer = func(b []byte) {
}
}
// frameReadBuffer reserves at most one read buffer from the frame header.
// readAllInto grows it as the payload arrives.
func frameReadBuffer(b []byte, length int64) []byte {
initial := min(length, int64(readBufferSize))
if int64(cap(b)) >= initial {
return b[:0]
}
return make([]byte, 0, initial)
}
// readAllInto reads from r and appends to b until an error or EOF and returns the data it read.
// A successful call returns err == nil, not err == EOF. Because readAllInto is
// defined to read from src until EOF, it does not treat an EOF from Read
+14
View File
@@ -34,6 +34,20 @@ import (
"github.com/minio/minio/internal/logger/target/testlogger"
)
func TestFrameReadBuffer(t *testing.T) {
for _, length := range []int64{0, 128, readBufferSize, 4 * readBufferSize} {
buf := frameReadBuffer(nil, length)
if len(buf) != 0 || int64(cap(buf)) != min(length, int64(readBufferSize)) {
t.Fatalf("length %d: got len %d, cap %d", length, len(buf), cap(buf))
}
}
buf := make([]byte, 128)
got := frameReadBuffer(buf, int64(len(buf)))
if len(got) != 0 || cap(got) != cap(buf) || &got[:1][0] != &buf[0] {
t.Fatal("did not reuse the existing read buffer")
}
}
func TestSingleRoundtrip(t *testing.T) {
defer testlogger.T.SetLogTB(t)()
errFatal := func(err error) {