Skip to content

Commit a220f92

Browse files
Eneman DonatienEneman Donatien
authored andcommitted
[ENH] add charts in repo
1 parent 4a29bd1 commit a220f92

20 files changed

+1434
-1
lines changed

.github/workflows/ci-chart.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Helm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release_helm:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Install Helm on Runner
16+
uses: azure/[email protected]
17+
18+
- name: Lint Chart
19+
run: helm lint .
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "[email protected]"
25+
26+
- name: Run chart-releaser
27+
uses: helm/[email protected]
28+
with:
29+
charts_dir: deploy/charts
30+
skip_existing: true
31+
env:
32+
CR_TOKEN: "${{ secrets.CR_TOKEN }}"

.github/workflows/ci.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
on: [push]
21
name: build
2+
3+
on: [push]
4+
35
jobs:
46
build:
57
outputs:
@@ -8,21 +10,26 @@ jobs:
810
steps:
911
- name: Checkout code
1012
uses: actions/checkout@v4
13+
1114
- name: Docker meta
1215
id: docker_meta
1316
uses: crazy-max/[email protected]
1417
with:
1518
images: inseefrlab/s3-operator # list of Docker images to use as base name for tags
19+
1620
- name: Set up QEMU
1721
uses: docker/setup-qemu-action@v3
22+
1823
- name: Set up Docker Buildx
1924
uses: docker/setup-buildx-action@v3
25+
2026
- name: Login to DockerHub
2127
if: github.event_name != 'pull_request'
2228
uses: docker/login-action@v3
2329
with:
2430
username: ${{ secrets.DOCKERHUB_USERNAME }}
2531
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
2633
- name: Build and push
2734
uses: docker/build-push-action@v5
2835
with:
@@ -35,5 +42,6 @@ jobs:
3542
${{ github.ref == 'refs/heads/main' && 'inseefrlab/s3-operator:latest' || '' }}
3643
labels: ${{ steps.docker_meta.outputs.labels }}
3744
platforms: linux/amd64,linux/arm64
45+
3846
- name: Image digest
3947
run: echo ${{ steps.docker_build.outputs.digest }}
File renamed without changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: s3-operator
3+
description: A Helm chart for deploying an operator to manage S3 resources (eg buckets, policies)
4+
# A chart can be either an 'application' or a 'library' chart.
5+
#
6+
# Application charts are a collection of templates that can be packaged into versioned archives
7+
# to be deployed.
8+
#
9+
# Library charts provide useful utilities or functions for the chart developer. They're included as
10+
# a dependency of application charts to inject those utilities and functions into the rendering
11+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
12+
type: application
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16+
version: 0.6.0
17+
# This is the version number of the application being deployed. This version number should be
18+
# incremented each time you make changes to the application. Versions are not expected to
19+
# follow Semantic Versioning. They should reflect the version the application is using.
20+
# It is recommended to use it with quotes.
21+
appVersion: "0.8.0"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# s3-operator
2+
3+
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.0](https://img.shields.io/badge/AppVersion-0.8.0-informational?style=flat-square)
4+
5+
A Helm chart for deploying an operator to manage S3 resources (eg buckets, policies)
6+
7+
## Values
8+
9+
| Key | Type | Default | Description |
10+
|-----|------|---------|-------------|
11+
| controllerManager.manager.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
12+
| controllerManager.manager.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | |
13+
| controllerManager.manager.image.repository | string | `"inseefrlab/s3-operator"` | |
14+
| controllerManager.manager.image.tag | string | `"latest"` | |
15+
| controllerManager.manager.imagePullPolicy | string | `"IfNotPresent"` | |
16+
| controllerManager.manager.imagePullSecrets | list | `[]` | |
17+
| controllerManager.manager.resources.limits.cpu | string | `"1000m"` | |
18+
| controllerManager.manager.resources.limits.memory | string | `"512Mi"` | |
19+
| controllerManager.manager.resources.requests.cpu | string | `"50m"` | |
20+
| controllerManager.manager.resources.requests.memory | string | `"64Mi"` | |
21+
| controllerManager.replicas | int | `1` | |
22+
| crds.install | bool | `true` | Install and upgrade CRDs |
23+
| crds.keep | bool | `true` | Keep CRDs on chart uninstall |
24+
| kubernetesClusterDomain | string | `"cluster.local"` | |
25+
| s3.deletion.bucket | bool | `false` | |
26+
| s3.deletion.path | bool | `false` | |
27+
| s3.deletion.policy | bool | `false` | |
28+
| s3.endpointUrl | string | `"localhost:9000"` | |
29+
| s3.existingSecret | string | `"my-s3-operator-auth-secret"` | |
30+
31+
----------------------------------------------
32+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "s3-operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "s3-operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "s3-operator.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "s3-operator.labels" -}}
37+
helm.sh/chart: {{ include "s3-operator.chart" . }}
38+
{{ include "s3-operator.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "s3-operator.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "s3-operator.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "s3-operator.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "s3-operator.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{{- if .Values.crds.install }}
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
{{- if .Values.crds.keep }}
7+
helm.sh/resource-policy: keep
8+
{{- end }}
9+
controller-gen.kubebuilder.io/version: v0.11.1
10+
labels:
11+
{{- include "s3-operator.labels" . | nindent 4 }}
12+
name: buckets.s3.onyxia.sh
13+
spec:
14+
group: s3.onyxia.sh
15+
names:
16+
kind: Bucket
17+
listKind: BucketList
18+
plural: buckets
19+
singular: bucket
20+
scope: Namespaced
21+
versions:
22+
- name: v1alpha1
23+
schema:
24+
openAPIV3Schema:
25+
description: Bucket is the Schema for the buckets API
26+
properties:
27+
apiVersion:
28+
description: 'APIVersion defines the versioned schema of this representation
29+
of an object. Servers should convert recognized schemas to the latest
30+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
31+
type: string
32+
kind:
33+
description: 'Kind is a string value representing the REST resource this
34+
object represents. Servers may infer this from the endpoint the client
35+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: BucketSpec defines the desired state of Bucket
41+
properties:
42+
name:
43+
description: Name of the bucket
44+
type: string
45+
paths:
46+
description: Paths (folders) to create inside the bucket
47+
items:
48+
type: string
49+
type: array
50+
quota:
51+
description: Quota to apply to the bucket
52+
properties:
53+
default:
54+
description: Default quota to apply, mandatory
55+
format: int64
56+
type: integer
57+
override:
58+
description: Optional override quota, to be used by cluster admin.
59+
format: int64
60+
type: integer
61+
required:
62+
- default
63+
type: object
64+
s3InstanceRef:
65+
default: s3-operator/default
66+
description: s3InstanceRef where create the bucket
67+
maxLength: 127
68+
minLength: 1
69+
pattern: ^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?(/[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)?$
70+
type: string
71+
x-kubernetes-validations:
72+
- message: s3InstanceRef is immutable
73+
rule: self == oldSelf
74+
required:
75+
- name
76+
- quota
77+
- s3InstanceRef
78+
type: object
79+
status:
80+
description: BucketStatus defines the observed state of Bucket
81+
properties:
82+
conditions:
83+
description: 'Status management using Conditions. See also : https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties'
84+
items:
85+
description: "Condition contains details for one aspect of the current
86+
state of this API Resource. --- This struct is intended for direct
87+
use as an array at the field path .status.conditions. For example,
88+
\n type FooStatus struct{ // Represents the observations of a
89+
foo's current state. // Known .status.conditions.type are: \"Available\",
90+
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
91+
// +listType=map // +listMapKey=type Conditions []metav1.Condition
92+
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
93+
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
94+
properties:
95+
lastTransitionTime:
96+
description: lastTransitionTime is the last time the condition
97+
transitioned from one status to another. This should be when
98+
the underlying condition changed. If that is not known, then
99+
using the time when the API field changed is acceptable.
100+
format: date-time
101+
type: string
102+
message:
103+
description: message is a human readable message indicating
104+
details about the transition. This may be an empty string.
105+
maxLength: 32768
106+
type: string
107+
observedGeneration:
108+
description: observedGeneration represents the .metadata.generation
109+
that the condition was set based upon. For instance, if .metadata.generation
110+
is currently 12, but the .status.conditions[x].observedGeneration
111+
is 9, the condition is out of date with respect to the current
112+
state of the instance.
113+
format: int64
114+
minimum: 0
115+
type: integer
116+
reason:
117+
description: reason contains a programmatic identifier indicating
118+
the reason for the condition's last transition. Producers
119+
of specific condition types may define expected values and
120+
meanings for this field, and whether the values are considered
121+
a guaranteed API. The value should be a CamelCase string.
122+
This field may not be empty.
123+
maxLength: 1024
124+
minLength: 1
125+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
126+
type: string
127+
status:
128+
description: status of the condition, one of True, False, Unknown.
129+
enum:
130+
- "True"
131+
- "False"
132+
- Unknown
133+
type: string
134+
type:
135+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
136+
--- Many .condition.type values are consistent across resources
137+
like Available, but because arbitrary conditions can be useful
138+
(see .node.status.conditions), the ability to deconflict is
139+
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
140+
maxLength: 316
141+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
142+
type: string
143+
required:
144+
- lastTransitionTime
145+
- message
146+
- reason
147+
- status
148+
- type
149+
type: object
150+
type: array
151+
type: object
152+
type: object
153+
served: true
154+
storage: true
155+
subresources:
156+
status: {}
157+
{{- end }}

0 commit comments

Comments
 (0)