mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-28 18:18:41 +00:00
Compare commits
1 Commits
untie-ingr
...
v0.31.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df07e7b95d |
1
Makefile
1
Makefile
@@ -28,6 +28,7 @@ build: build-deps
|
||||
|
||||
repos:
|
||||
rm -rf _out
|
||||
make -C packages/library check-version-map
|
||||
make -C packages/apps check-version-map
|
||||
make -C packages/extra check-version-map
|
||||
make -C packages/system repo
|
||||
|
||||
@@ -16,10 +16,15 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.8.0
|
||||
version: 0.9.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "24.9.2"
|
||||
|
||||
dependencies:
|
||||
- name: cozy-lib
|
||||
version: 0.1.0
|
||||
repository: "http://cozystack.cozy-system.svc/repos/library"
|
||||
|
||||
1
packages/apps/clickhouse/charts/cozy-lib
Symbolic link
1
packages/apps/clickhouse/charts/cozy-lib
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../library/cozy-lib
|
||||
@@ -122,9 +122,9 @@ spec:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:24.9.2.42
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- toYaml .Values.resources | nindent 16 }}
|
||||
resources: {{- include "cozy-lib.resources.sanitize" .Values.resources | nindent 16 }}
|
||||
{{- else if ne .Values.resourcesPreset "none" }}
|
||||
resources: {{- include "resources.preset" (dict "type" .Values.resourcesPreset "Release" .Release) | nindent 16 }}
|
||||
resources: {{- include "cozy-lib.resources.preset" .Values.resourcesPreset | nindent 16 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data-volume-template
|
||||
|
||||
@@ -9,7 +9,7 @@ clickhouse 0.6.0 1ec10165
|
||||
clickhouse 0.6.1 c62a83a7
|
||||
clickhouse 0.6.2 8267072d
|
||||
clickhouse 0.7.0 93bdf411
|
||||
clickhouse 0.8.0 HEAD
|
||||
clickhouse 0.9.0 HEAD
|
||||
ferretdb 0.1.0 e9716091
|
||||
ferretdb 0.1.1 91b0499a
|
||||
ferretdb 0.2.0 6c5cf5bf
|
||||
|
||||
21
packages/library/Makefile
Normal file
21
packages/library/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
OUT=../../_out/repos/library
|
||||
TMP=../../_out/repos/library/historical
|
||||
|
||||
repo:
|
||||
rm -rf "$(OUT)"
|
||||
mkdir -p "$(OUT)"
|
||||
awk '$$3 != "HEAD" {print "mkdir -p $(TMP)/" $$1 "-" $$2}' versions_map | sh -ex
|
||||
awk '$$3 != "HEAD" {print "git archive " $$3 " " $$1 " | tar -xf- --strip-components=1 -C $(TMP)/" $$1 "-" $$2 }' versions_map | sh -ex
|
||||
helm package -d "$(OUT)" $$(find . $(TMP) -mindepth 2 -maxdepth 2 -name Chart.yaml | awk 'sub("/Chart.yaml", "")' | sort -V)
|
||||
cd "$(OUT)" && helm repo index . --url http://cozystack.cozy-system.svc/repos/library
|
||||
rm -rf "$(TMP)"
|
||||
|
||||
fix-chartnames:
|
||||
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
|
||||
|
||||
gen-versions-map: fix-chartnames
|
||||
../../hack/gen_versions_map.sh
|
||||
|
||||
check-version-map: gen-versions-map
|
||||
git diff --exit-code -- versions_map
|
||||
|
||||
23
packages/library/cozy-lib/.helmignore
Normal file
23
packages/library/cozy-lib/.helmignore
Normal file
@@ -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
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
18
packages/library/cozy-lib/Chart.yaml
Normal file
18
packages/library/cozy-lib/Chart.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: v2
|
||||
name: cozy-lib
|
||||
description: Common Cozystack templates
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: library
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
6
packages/library/cozy-lib/Makefile
Normal file
6
packages/library/cozy-lib/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
include ../../../scripts/common-envs.mk
|
||||
include ../../../scripts/package.mk
|
||||
|
||||
generate:
|
||||
readme-generator -v values.yaml -s values.schema.json -r README.md
|
||||
|
||||
1
packages/library/cozy-lib/README.md
Normal file
1
packages/library/cozy-lib/README.md
Normal file
@@ -0,0 +1 @@
|
||||
## Parameters
|
||||
49
packages/library/cozy-lib/templates/_resourcepresets.tpl
Normal file
49
packages/library/cozy-lib/templates/_resourcepresets.tpl
Normal file
@@ -0,0 +1,49 @@
|
||||
{{/*
|
||||
Copyright Broadcom, Inc. All Rights Reserved.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Return a resource request/limit object based on a given preset.
|
||||
These presets are for basic testing and not meant to be used in production
|
||||
{{ include "cozy-lib.resources.preset" "nano" -}}
|
||||
*/}}
|
||||
{{- define "cozy-lib.resources.preset" -}}
|
||||
{{- $presets := dict
|
||||
"nano" (dict
|
||||
"requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "128Mi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"micro" (dict
|
||||
"requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "256Mi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"small" (dict
|
||||
"requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "512Mi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"medium" (dict
|
||||
"requests" (dict "cpu" "500m" "memory" "1Gi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "1Gi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"large" (dict
|
||||
"requests" (dict "cpu" "1" "memory" "2Gi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "2Gi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"xlarge" (dict
|
||||
"requests" (dict "cpu" "2" "memory" "4Gi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "4Gi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
"2xlarge" (dict
|
||||
"requests" (dict "cpu" "4" "memory" "8Gi" "ephemeral-storage" "50Mi")
|
||||
"limits" (dict "memory" "8Gi" "ephemeral-storage" "2Gi")
|
||||
)
|
||||
}}
|
||||
{{- if hasKey $presets . -}}
|
||||
{{- index $presets . | toYaml -}}
|
||||
{{- else -}}
|
||||
{{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" . (join "," (keys $presets)) | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
53
packages/library/cozy-lib/templates/_resources.tpl
Normal file
53
packages/library/cozy-lib/templates/_resources.tpl
Normal file
@@ -0,0 +1,53 @@
|
||||
{{- /*
|
||||
A sanitized resource map is a dict with resource-name => resource-quantity.
|
||||
If not in such a form, requests are used, then limits. All resources are set
|
||||
to have equal requests and limits, except CPU, that has only requests. The
|
||||
template expects to receive a dict {"requests":{...}, "limits":{...}} as
|
||||
input, e.g. {{ include "cozy-lib.resources.sanitize" .Values.resources }}.
|
||||
Example input:
|
||||
==============
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 1024Mi
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
memory: 256Mi
|
||||
devices.com/nvidia: "1"
|
||||
|
||||
Example output:
|
||||
===============
|
||||
limits:
|
||||
devices.com/nvidia: "1"
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 200m
|
||||
devices.com/nvidia: "1"
|
||||
memory: 256Mi
|
||||
*/}}
|
||||
{{- define "cozy-lib.resources.sanitize" }}
|
||||
{{- $sanitizedMap := dict }}
|
||||
{{- if hasKey . "limits" }}
|
||||
{{- range $k, $v := .limits }}
|
||||
{{- $_ := set $sanitizedMap $k $v }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if hasKey . "requests" }}
|
||||
{{- range $k, $v := .requests }}
|
||||
{{- $_ := set $sanitizedMap $k $v }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $k, $v := . }}
|
||||
{{- if not (or (eq $k "requests") (eq $k "limits")) }}
|
||||
{{- $_ := set $sanitizedMap $k $v }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $output := dict "requests" dict "limits" dict }}
|
||||
{{- range $k, $v := $sanitizedMap }}
|
||||
{{- $_ := set $output.requests $k $v }}
|
||||
{{- if not (eq $k "cpu") }}
|
||||
{{- $_ := set $output.limits $k $v }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $output | toYaml }}
|
||||
{{- end }}
|
||||
5
packages/library/cozy-lib/values.schema.json
Normal file
5
packages/library/cozy-lib/values.schema.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"title": "Chart Values",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
1
packages/library/cozy-lib/values.yaml
Normal file
1
packages/library/cozy-lib/values.yaml
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
1
packages/library/versions_map
Normal file
1
packages/library/versions_map
Normal file
@@ -0,0 +1 @@
|
||||
cozy-lib 0.1.0 HEAD
|
||||
Reference in New Issue
Block a user