-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcharmcraft.yaml
More file actions
120 lines (100 loc) · 3.93 KB
/
charmcraft.yaml
File metadata and controls
120 lines (100 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.
# (Required)
name: seaweedfs-k8s
# (Required)
type: charm
assumes:
- k8s-api
- juju >= 3.6
# (Recommended)
title: SeaweedFS
links:
website: https://github.com/sed-i/seaweedfs-k8s-operator
source: https://github.com/sed-i/seaweedfs-k8s-operator
issues: https://github.com/sed-i/seaweedfs-k8s-operator/issues
# (Required)
summary: A stand-in for s3-integrator + (micro)ceph for testing purposes.
# (Required)
description: |
## Purpose
This charm is intended to use as a stand-in for s3-integrator + (micro)ceph for testing purposes.
When testing charms, instead of deploying (micro)ceph, s3-integrator, setting config options and
running the sync-credentials action, this charm mimics the s3 relation interface and provides an
s3 endpoint.
## Compared to s3-integrator
### Relation data
This charm does not use the s3 library. Instead, it renderes the relation data itself.
For a related charm, relation data may look like this:
```yaml
- relation-id: 7
endpoint: s3
related-endpoint: s3-credentials
application-data:
access-key: placeholder
bucket: s3-credentials-7
endpoint: http://swfs-0.swfs-endpoints.welcome-k8s.svc.cluster.local:8333
secret-key: placeholder
```
Note that the bucket name is automatically derived from the relation id. No config options needed.
### Bucket name
In the past there has been some confusion about who decides on the bucket name - the requesting charm
(e.g. mimir, loki, tempo), or the s3-integrator charm. It seems like everyone agrees now that it's the
s3-integrator where the bucket name should be set (via config option).
In this charm, the same principle holds, but there is no config option for bucket name, because:
1. For testing purposes, we don't care that the bucket name is not fixed.
2. This way we could relate multiple charms to the same seaweedfs charm, unlike s3-integrator where each
app (mimir, loki, tempo) have their own s3-integrator due to different bucket names.
# (Required for 'charm' type)
platforms:
ubuntu@24.04:amd64:
parts:
charm:
source: .
plugin: uv
build-packages: [git]
build-snaps: [astral-uv]
override-build: |
craftctl default
git describe --always > $CRAFT_PART_INSTALL/version
# (Optional) Configuration options for the charm
# This config section defines charm config options, and populates the Configure
# tab on Charmhub.
# More information on this section at https://juju.is/docs/sdk/charmcraft-yaml#heading--config
# General configuration documentation: https://juju.is/docs/sdk/config
config:
options:
bucket:
type: string
default: "default-bucket"
description: |
This config option does nothing, because currently the bucket name
is prescribed by the relation id.
# The containers and resources metadata apply to Kubernetes charms only.
# See https://juju.is/docs/sdk/metadata-reference for a checklist and guidance.
# Your workload’s containers.
containers:
seaweedfs:
resource: seaweedfs-image
mounts:
- storage: data
location: /data
storage:
data:
type: filesystem
description: >
Storage dir for seaweedfs data, such as s3.
# This field populates the Resources tab on Charmhub.
resources:
# An OCI image resource for each container listed above.
# You may remove this if your charm will run without a workload sidecar container.
seaweedfs-image:
type: oci-image
description: OCI image for the 'seaweedfs' container
# The upstream-source field is ignored by Juju. It is included here as a reference
# so the integration testing suite knows which image to deploy during testing. This field
# is also used by the 'canonical/charming-actions' Github action for automated releasing.
upstream-source: chrislusf/seaweedfs:3.97
provides:
s3-credentials:
interface: s3