mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-02-02 23:16:03 +00:00
Compare commits
10 Commits
upd-seawee
...
cdi-scratc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f8786a96 | ||
|
|
16d3979bda | ||
|
|
dc9d8bb9e9 | ||
|
|
74649f8280 | ||
|
|
3842191288 | ||
|
|
de70081821 | ||
|
|
249bf35446 | ||
|
|
c2b6636fe7 | ||
|
|
4631ea26f7 | ||
|
|
18d658c73d |
1
Makefile
1
Makefile
@@ -10,6 +10,7 @@ build:
|
||||
make -C packages/system/kubeovn image
|
||||
make -C packages/system/dashboard image
|
||||
make -C packages/system/kamaji image
|
||||
make -C packages/system/bucket image
|
||||
make -C packages/core/testing image
|
||||
make -C packages/core/installer image
|
||||
make manifests
|
||||
|
||||
@@ -36,7 +36,7 @@ mkdir -p srv1 srv2 srv3
|
||||
|
||||
# Prepare cloud-init
|
||||
for i in 1 2 3; do
|
||||
echo "local-hostname: srv$i" > "srv$i/meta-data"
|
||||
echo "hostname: srv$i" > "srv$i/meta-data"
|
||||
echo '#cloud-config' > "srv$i/user-data"
|
||||
cat > "srv$i/network-config" <<EOT
|
||||
version: 2
|
||||
@@ -182,7 +182,7 @@ timeout 60 sh -c 'until nc -nzv 192.168.123.11 50000 && nc -nzv 192.168.123.12 5
|
||||
talosctl bootstrap -n 192.168.123.11 -e 192.168.123.11
|
||||
|
||||
# Wait for etcd
|
||||
timeout 120 sh -c 'while talosctl etcd members -n 192.168.123.11,192.168.123.12,192.168.123.13 -e 192.168.123.10 2>&1 | grep "rpc error"; do sleep 1; done'
|
||||
timeout 180 sh -c 'while talosctl etcd members -n 192.168.123.11,192.168.123.12,192.168.123.13 -e 192.168.123.10 2>&1 | grep "rpc error"; do sleep 1; done'
|
||||
|
||||
rm -f kubeconfig
|
||||
talosctl kubeconfig kubeconfig -e 192.168.123.10 -n 192.168.123.10
|
||||
@@ -217,6 +217,10 @@ timeout 60 sh -c 'until kubectl get hr -A | grep cozy; do sleep 1; done'
|
||||
sleep 5
|
||||
|
||||
kubectl get hr -A | awk 'NR>1 {print "kubectl wait --timeout=15m --for=condition=ready -n " $1 " hr/" $2 " &"} END{print "wait"}' | sh -x
|
||||
|
||||
# Wait for Cluster-API providers
|
||||
kubectl wait deploy --timeout=30s --for=condition=available -n cozy-cluster-api capi-controller-manager capi-kamaji-controller-manager capi-kubeadm-bootstrap-controller-manager capi-operator-cluster-api-operator capk-controller-manager
|
||||
|
||||
# Wait for linstor controller
|
||||
kubectl wait deploy --timeout=5m --for=condition=available -n cozy-linstor linstor-controller
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ spec:
|
||||
serviceAccountName: cozystack
|
||||
containers:
|
||||
- name: cozystack
|
||||
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.16.2"
|
||||
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.16.4"
|
||||
env:
|
||||
- name: KUBERNETES_SERVICE_HOST
|
||||
value: localhost
|
||||
@@ -87,7 +87,7 @@ spec:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: darkhttpd
|
||||
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.16.2"
|
||||
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.16.4"
|
||||
command:
|
||||
- /usr/bin/darkhttpd
|
||||
- /cozystack/assets
|
||||
|
||||
@@ -9,4 +9,12 @@ rules:
|
||||
- secrets
|
||||
resourceNames:
|
||||
- {{ .Release.Name }}
|
||||
- {{ .Release.Name }}-credentials
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
resourceNames:
|
||||
- {{ .Release.Name }}-ui
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
18
packages/apps/bucket/templates/helmrelease.yaml
Normal file
18
packages/apps/bucket/templates/helmrelease.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-system
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: cozy-bucket
|
||||
reconcileStrategy: Revision
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: cozystack-system
|
||||
namespace: cozy-system
|
||||
version: '*'
|
||||
interval: 1m0s
|
||||
timeout: 5m0s
|
||||
values:
|
||||
bucketName: {{ .Release.Name }}
|
||||
@@ -76,3 +76,5 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
spec:
|
||||
enableServiceLinks: false
|
||||
|
||||
@@ -1 +1 @@
|
||||
ghcr.io/aenix-io/cozystack/cluster-autoscaler:0.11.1@sha256:7f617de5a24de790a15d9e97c6287ff2b390922e6e74c7a665cbf498f634514d
|
||||
ghcr.io/aenix-io/cozystack/cluster-autoscaler:0.12.0@sha256:7f617de5a24de790a15d9e97c6287ff2b390922e6e74c7a665cbf498f634514d
|
||||
|
||||
@@ -1 +1 @@
|
||||
ghcr.io/aenix-io/cozystack/kubevirt-cloud-provider:0.11.1@sha256:b5aa62a53be566b49dea635ce8f6b9280566e260f8493ff3d71f8c7501fb4cbc
|
||||
ghcr.io/aenix-io/cozystack/kubevirt-cloud-provider:0.12.0@sha256:df4a937b6fb2b345110174227170691d48189ffe1900c3f848cd5085990a58df
|
||||
@@ -1 +1 @@
|
||||
ghcr.io/aenix-io/cozystack/kubevirt-csi-driver:0.11.1@sha256:705e20e638315501aaa8b8156ceb8b260086b21876aa994bec9d6c406955c6d4
|
||||
ghcr.io/aenix-io/cozystack/kubevirt-csi-driver:0.12.0@sha256:86029548078960feecca116087b2135230d676b83c503f292eb50e1199be2790
|
||||
|
||||
@@ -3,7 +3,7 @@ ARG builder_image=docker.io/library/golang:1.22.5
|
||||
FROM ${builder_image} AS builder
|
||||
RUN git clone https://github.com/kubevirt/csi-driver /src/kubevirt-csi-driver \
|
||||
&& cd /src/kubevirt-csi-driver \
|
||||
&& git checkout fa92820448e583c7fd722dc20270544e0c3eca53
|
||||
&& git checkout 35836e0c8b68d9916d29a838ea60cdd3fc6199cf
|
||||
|
||||
WORKDIR /src/kubevirt-csi-driver
|
||||
RUN make build
|
||||
|
||||
@@ -16,6 +16,7 @@ spec:
|
||||
app: {{ .Release.Name }}-cluster-autoscaler
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
spec:
|
||||
enableServiceLinks: false
|
||||
tolerations:
|
||||
- key: CriticalAddonsOnly
|
||||
operator: Exists
|
||||
|
||||
@@ -15,6 +15,7 @@ spec:
|
||||
app: {{ .Release.Name }}-kcsi-driver
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
spec:
|
||||
enableServiceLinks: false
|
||||
serviceAccountName: {{ .Release.Name }}-kcsi
|
||||
priorityClassName: system-cluster-critical
|
||||
tolerations:
|
||||
|
||||
@@ -15,6 +15,7 @@ spec:
|
||||
k8s-app: {{ .Release.Name }}-kccm
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
spec:
|
||||
enableServiceLinks: false
|
||||
tolerations:
|
||||
- key: CriticalAddonsOnly
|
||||
operator: Exists
|
||||
|
||||
@@ -16,6 +16,8 @@ spec:
|
||||
statefulSet:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
enableServiceLinks: false
|
||||
metadata:
|
||||
labels:
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
cozystack:
|
||||
image: ghcr.io/aenix-io/cozystack/cozystack:v0.16.2@sha256:0ee9d03a0453f19cc8deabf9ee4b9c6d9cc61e4ba833546a62a2f6b2265868f3
|
||||
image: ghcr.io/aenix-io/cozystack/cozystack:v0.16.4@sha256:e2de79d1dd00a95a6876f6e4daf281eb27e8cc9d57fa2e9ea137192b544d38a7
|
||||
@@ -1,2 +1,2 @@
|
||||
e2e:
|
||||
image: ghcr.io/aenix-io/cozystack/e2e-sandbox:v0.16.2@sha256:25b298d621ec79431d106184d59849bbae634588742583d111628126ad8615c5
|
||||
image: ghcr.io/aenix-io/cozystack/e2e-sandbox:v0.16.4@sha256:25b298d621ec79431d106184d59849bbae634588742583d111628126ad8615c5
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.2.0
|
||||
version: 0.2.1
|
||||
|
||||
# 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
|
||||
|
||||
@@ -38,6 +38,10 @@ spec:
|
||||
storageClass: {{ . }}
|
||||
{{- end }}
|
||||
maxVolumes: 0
|
||||
|
||||
filer:
|
||||
s3:
|
||||
domainName: {{ .Values.host | default (printf "s3.%s" $host) }}
|
||||
|
||||
s3:
|
||||
ingress:
|
||||
|
||||
@@ -15,4 +15,5 @@ monitoring 1.3.0 6c5cf5b
|
||||
monitoring 1.4.0 adaf603b
|
||||
monitoring 1.5.0 HEAD
|
||||
seaweedfs 0.1.0 5ca8823
|
||||
seaweedfs 0.2.0 HEAD
|
||||
seaweedfs 0.2.0 9e33dc0
|
||||
seaweedfs 0.2.1 HEAD
|
||||
|
||||
2
packages/system/bucket/.helmignore
Normal file
2
packages/system/bucket/.helmignore
Normal file
@@ -0,0 +1,2 @@
|
||||
hack
|
||||
.gitkeep
|
||||
3
packages/system/bucket/Chart.yaml
Normal file
3
packages/system/bucket/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
name: cozy-bucket
|
||||
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process
|
||||
25
packages/system/bucket/Makefile
Normal file
25
packages/system/bucket/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
S3MANAGER_TAG=v0.5.0
|
||||
|
||||
export NAME=s3manager-system
|
||||
|
||||
include ../../../scripts/common-envs.mk
|
||||
include ../../../scripts/package.mk
|
||||
|
||||
update:
|
||||
rm -rf charts
|
||||
helm pull oci://ghcr.io/aenix-io/charts/etcd-operator --untar --untardir charts
|
||||
|
||||
image: image-s3manager
|
||||
|
||||
image-s3manager:
|
||||
docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 images/s3manager \
|
||||
--provenance false \
|
||||
--tag $(REGISTRY)/s3manager:$(call settag,$(S3MANAGER_TAG)) \
|
||||
--cache-from type=registry,ref=$(REGISTRY)/s3manager:latest \
|
||||
--cache-to type=inline \
|
||||
--metadata-file images/s3manager.json \
|
||||
--push=$(PUSH) \
|
||||
--load=$(LOAD)
|
||||
echo "$(REGISTRY)/s3manager:$(call settag,$(S3MANAGER_TAG))@$$(yq e '."containerimage.digest"' images/s3manager.json -o json -r)" \
|
||||
> images/s3manager.tag
|
||||
rm -f images/s3manager.json
|
||||
1
packages/system/bucket/images/s3manager.tag
Normal file
1
packages/system/bucket/images/s3manager.tag
Normal file
@@ -0,0 +1 @@
|
||||
ghcr.io/aenix-io/cozystack/s3manager:latest@sha256:7a1a0864f823dc3343d79dffa44ab73f77f0e1b3642a0fe0fa29b280c3184a9b
|
||||
20
packages/system/bucket/images/s3manager/Dockerfile
Normal file
20
packages/system/bucket/images/s3manager/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Source: https://github.com/cloudlena/s3manager/blob/main/Dockerfile
|
||||
|
||||
FROM docker.io/library/golang:1 AS builder
|
||||
WORKDIR /usr/src/app
|
||||
RUN wget -O- https://github.com/cloudlena/s3manager/archive/9a7c8e446b422f8973b8c461990f39fdafee9c27.tar.gz | tar -xzf- --strip 1
|
||||
ADD cozystack.patch /
|
||||
RUN git apply /cozystack.patch
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix cgo -o bin/s3manager
|
||||
|
||||
FROM docker.io/library/alpine:latest
|
||||
WORKDIR /usr/src/app
|
||||
RUN addgroup -S s3manager && adduser -S s3manager -G s3manager
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
dumb-init
|
||||
COPY --from=builder --chown=s3manager:s3manager /usr/src/app/bin/s3manager ./
|
||||
USER s3manager
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT [ "/usr/bin/dumb-init", "--" ]
|
||||
CMD [ "/usr/src/app/s3manager" ]
|
||||
26
packages/system/bucket/images/s3manager/cozystack.patch
Normal file
26
packages/system/bucket/images/s3manager/cozystack.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
diff --git a/web/template/bucket.html.tmpl b/web/template/bucket.html.tmpl
|
||||
index e2f8d28..87add13 100644
|
||||
--- a/web/template/bucket.html.tmpl
|
||||
+++ b/web/template/bucket.html.tmpl
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<nav class="nav-extended">
|
||||
<div class="nav-wrapper container">
|
||||
- <a href="/buckets/{{$.BucketName}}" class="brand-logo center"><i class="material-icons">folder_open</i>{{ .BucketName }}</a>
|
||||
+ <a href="/" class="brand-logo">Cozystack S3 Manager</a>
|
||||
{{ if not .Objects }}
|
||||
<ul class="right">
|
||||
<li>
|
||||
diff --git a/web/template/buckets.html.tmpl b/web/template/buckets.html.tmpl
|
||||
index c7ea184..fb1dce7 100644
|
||||
--- a/web/template/buckets.html.tmpl
|
||||
+++ b/web/template/buckets.html.tmpl
|
||||
@@ -1,7 +1,7 @@
|
||||
{{ define "content" }}
|
||||
<nav>
|
||||
<div class="nav-wrapper container">
|
||||
- <a href="/" class="brand-logo">S3 Manager</a>
|
||||
+ <a href="/" class="brand-logo">Cozystack S3 Manager</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
35
packages/system/bucket/templates/deployment.yaml
Normal file
35
packages/system/bucket/templates/deployment.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.bucketName }}-ui
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.bucketName }}-ui
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.bucketName }}-ui
|
||||
spec:
|
||||
containers:
|
||||
- name: s3manager
|
||||
image: "{{ $.Files.Get "images/s3manager.tag" | trim }}"
|
||||
env:
|
||||
- name: ENDPOINT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.bucketName }}-credentials
|
||||
key: endpoint
|
||||
- name: SKIP_SSL_VERIFICATION
|
||||
value: "true"
|
||||
- name: ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.bucketName }}-credentials
|
||||
key: accessKey
|
||||
- name: SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.bucketName }}-credentials
|
||||
key: secretKey
|
||||
28
packages/system/bucket/templates/ingress.yaml
Normal file
28
packages/system/bucket/templates/ingress.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
|
||||
{{- $host := index $myNS.metadata.annotations "namespace.cozystack.io/host" }}
|
||||
{{- $ingress := index $myNS.metadata.annotations "namespace.cozystack.io/ingress" }}
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ .Values.bucketName }}-ui
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/auth-type: "basic"
|
||||
nginx.ingress.kubernetes.io/auth-secret: "{{ .Values.bucketName }}-ui-auth"
|
||||
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "99999"
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "99999"
|
||||
spec:
|
||||
ingressClassName: {{ $ingress }}
|
||||
rules:
|
||||
- host: {{ .Values.bucketName }}.{{ $host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Values.bucketName }}-ui
|
||||
port:
|
||||
number: 8080
|
||||
22
packages/system/bucket/templates/secret.yaml
Normal file
22
packages/system/bucket/templates/secret.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace .Values.bucketName }}
|
||||
{{- $bucketInfo := fromJson (b64dec (index $existingSecret.data "BucketInfo")) }}
|
||||
{{- $accessKeyID := index $bucketInfo.spec.secretS3 "accessKeyID" }}
|
||||
{{- $accessSecretKey := index $bucketInfo.spec.secretS3 "accessSecretKey" }}
|
||||
{{- $endpoint := index $bucketInfo.spec.secretS3 "endpoint" }}
|
||||
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.bucketName }}-credentials
|
||||
type: Opaque
|
||||
stringData:
|
||||
accessKey: {{ $accessKeyID | quote }}
|
||||
secretKey: {{ $accessSecretKey | quote }}
|
||||
endpoint: {{ trimPrefix "https://" $endpoint }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.bucketName }}-ui-auth
|
||||
data:
|
||||
auth: {{ htpasswd $accessKeyID $accessSecretKey | b64enc | quote }}
|
||||
12
packages/system/bucket/templates/service.yaml
Normal file
12
packages/system/bucket/templates/service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.bucketName }}-ui
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.bucketName }}-ui
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
type: ClusterIP
|
||||
1
packages/system/bucket/values.yaml
Normal file
1
packages/system/bucket/values.yaml
Normal file
@@ -0,0 +1 @@
|
||||
bucketName: ""
|
||||
@@ -1,8 +1,9 @@
|
||||
cluster-api-operator:
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
manager:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
@@ -33,11 +33,11 @@ kubeapps:
|
||||
image:
|
||||
registry: ghcr.io/aenix-io/cozystack
|
||||
repository: dashboard
|
||||
tag: v0.16.2
|
||||
tag: v0.16.4
|
||||
digest: "sha256:4818712e9fc9c57cc321512760c3226af564a04e69d4b3ec9229ab91fd39abeb"
|
||||
kubeappsapis:
|
||||
image:
|
||||
registry: ghcr.io/aenix-io/cozystack
|
||||
repository: kubeapps-apis
|
||||
tag: v0.16.2
|
||||
tag: v0.16.4
|
||||
digest: "sha256:55bc8e2495933112c7cb4bb9e3b1fcb8df46aa14e27fa007f78388a9757e3238"
|
||||
|
||||
@@ -3,7 +3,7 @@ kamaji:
|
||||
deploy: false
|
||||
image:
|
||||
pullPolicy: IfNotPresent
|
||||
tag: v0.16.2@sha256:95a9658cbbe1cbfbc42b9ab1df4f2a39342d7a8f1ff10a10b81b8656f3744c39
|
||||
tag: v0.16.4@sha256:95a9658cbbe1cbfbc42b9ab1df4f2a39342d7a8f1ff10a10b81b8656f3744c39
|
||||
repository: ghcr.io/aenix-io/cozystack/kamaji
|
||||
resources:
|
||||
limits:
|
||||
|
||||
@@ -4,6 +4,7 @@ metadata:
|
||||
name: cdi
|
||||
spec:
|
||||
config:
|
||||
scratchSpaceStorageClass: "local"
|
||||
featureGates:
|
||||
- HonorWaitForFirstConsumer
|
||||
- ExpandDisks
|
||||
|
||||
Reference in New Issue
Block a user