Skip to content

Commit

Permalink
SeaweedFS (#131)
Browse files Browse the repository at this point in the history
This PR adds SeaweedFS

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps authored Aug 12, 2024
1 parent 2f0373d commit 94c688f
Show file tree
Hide file tree
Showing 71 changed files with 8,028 additions and 6 deletions.
25 changes: 25 additions & 0 deletions packages/apps/bucket/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
name: bucket
description: S3 compatible storage
icon: /logos/bucket.svg

# 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: 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.1.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: "0.1.0"
2 changes: 2 additions & 0 deletions packages/apps/bucket/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generate:
readme-generator -v values.yaml -s values.schema.json -r README.md
1 change: 1 addition & 0 deletions packages/apps/bucket/logos/bucket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions packages/apps/bucket/templates/bucketclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $seaweedfs := index $myNS.metadata.annotations "namespace.cozystack.io/seaweedfs" }}
apiVersion: objectstorage.k8s.io/v1alpha1
kind: BucketClaim
metadata:
name: {{ .Release.Name }}
spec:
bucketClassName: {{ $seaweedfs }}
protocols:
- s3
---
apiVersion: objectstorage.k8s.io/v1alpha1
kind: BucketAccess
metadata:
name: {{ .Release.Name }}
spec:
bucketAccessClassName: {{ $seaweedfs }}
bucketClaimName: {{ .Release.Name }}
credentialsSecretName: {{ .Release.Name }}
protocol: s3
12 changes: 12 additions & 0 deletions packages/apps/bucket/templates/dashboard-resourcemap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Release.Name }}-dashboard-resources
rules:
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- {{ .Release.Name }}
verbs: ["get", "list", "watch"]
2 changes: 1 addition & 1 deletion packages/apps/tenant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: Separated tenant namespace
icon: /logos/tenant.svg

type: application
version: 1.3.1
version: 1.4.0
1 change: 1 addition & 0 deletions packages/apps/tenant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ tenant-u1
| `etcd` | Deploy own Etcd cluster | `false` |
| `monitoring` | Deploy own Monitoring Stack | `false` |
| `ingress` | Deploy own Ingress Controller | `false` |
| `seaweedfs` | Deploy own SeaweedFS | `false` |
| `isolated` | Enforce tenant namespace with network policies | `false` |
3 changes: 0 additions & 3 deletions packages/apps/tenant/templates/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ spec:
interval: 1m0s
timeout: 5m0s
values:
{{- with .Values.host }}
host: grafana.{{ . }}
{{- end }}
metricsStorages:
- name: shortterm
retentionPeriod: "3d"
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/tenant/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- define "cozystack.namespace-anotations" }}
{{- $context := index . 0 }}
{{- $existingNS := index . 1 }}
{{- range $x := list "etcd" "monitoring" "ingress" }}
{{- range $x := list "etcd" "monitoring" "ingress" "seaweedfs" }}
{{- if (index $context.Values $x) }}
namespace.cozystack.io/{{ $x }}: "{{ include "tenant.name" $context }}"
{{- else }}
Expand Down
25 changes: 25 additions & 0 deletions packages/apps/tenant/templates/seaweedfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.seaweedfs }}
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: seaweedfs
namespace: {{ include "tenant.name" . }}
annotations:
helm.sh/resource-policy: keep
labels:
cozystack.io/ui: "true"
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
chart:
spec:
chart: seaweedfs
reconcileStrategy: Revision
sourceRef:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public
version: "*"
interval: 1m0s
timeout: 5m0s
{{- end }}
5 changes: 5 additions & 0 deletions packages/apps/tenant/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"description": "Deploy own Ingress Controller",
"default": false
},
"seaweedfs": {
"type": "boolean",
"description": "Deploy own SeaweedFS",
"default": false
},
"isolated": {
"type": "boolean",
"description": "Enforce tenant namespace with network policies",
Expand Down
2 changes: 2 additions & 0 deletions packages/apps/tenant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
## @param etcd Deploy own Etcd cluster
## @param monitoring Deploy own Monitoring Stack
## @param ingress Deploy own Ingress Controller
## @param seaweedfs Deploy own SeaweedFS
## @param isolated Enforce tenant namespace with network policies
host: ""
etcd: false
monitoring: false
ingress: false
seaweedfs: false
isolated: false
4 changes: 3 additions & 1 deletion packages/apps/versions_map
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bucket 0.1.0 HEAD
clickhouse 0.1.0 ca79f72
clickhouse 0.2.0 7cd7de73
clickhouse 0.2.1 HEAD
Expand Down Expand Up @@ -40,7 +41,8 @@ tenant 1.0.0 7cd7de7
tenant 1.1.0 4da8ac3b
tenant 1.2.0 15478a88
tenant 1.3.0 ceefae03
tenant 1.3.1 HEAD
tenant 1.3.1 c56e5769
tenant 1.4.0 HEAD
virtual-machine 0.1.4 f2015d6
virtual-machine 0.1.5 7cd7de7
virtual-machine 0.2.0 HEAD
Expand Down
1 change: 1 addition & 0 deletions packages/core/platform/templates/apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ metadata:
namespace.cozystack.io/etcd: tenant-root
namespace.cozystack.io/monitoring: tenant-root
namespace.cozystack.io/ingress: tenant-root
namespace.cozystack.io/seaweedfs: tenant-root
namespace.cozystack.io/host: "{{ $host }}"
name: tenant-root
---
Expand Down
3 changes: 3 additions & 0 deletions packages/extra/seaweedfs/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.helmignore
/logos
/Makefile
25 changes: 25 additions & 0 deletions packages/extra/seaweedfs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
name: seaweedfs
description: Seaweedfs
icon: /logos/seaweedfs.svg

# 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: 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.1.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: "3.71"
2 changes: 2 additions & 0 deletions packages/extra/seaweedfs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generate:
readme-generator -v values.yaml -s values.schema.json -r README.md
12 changes: 12 additions & 0 deletions packages/extra/seaweedfs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Managed NATS Service

## Parameters

### Common parameters

| Name | Description | Value |
| ---------- | --------------------------------------------------------------------------------------------------------- | ----- |
| `host` | The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host). | `""` |
| `replicas` | Persistent Volume size for NATS | `2` |
| `size` | Persistent Volume size | `4Gi` |

Loading

0 comments on commit 94c688f

Please sign in to comment.