Skip to content

Commit

Permalink
store registry data in minio
Browse files Browse the repository at this point in the history
  • Loading branch information
damoon committed May 23, 2021
1 parent 27aeae9 commit b310eb0
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 174 deletions.
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ docker_build(
k8s_resource(
'wedding',
port_forwards=['12376:2376'],
resource_deps=['setup-s3-bucket', 'wedding-registry'],
resource_deps=['minio-buckets', 'registry'],
)
6 changes: 3 additions & 3 deletions deployment/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ spec:
- name: wedding
image: davedamoon/wedding:latest
args:
- --s3-endpoint=minio:9000
- --s3-endpoint=wedding-minio:9000
- --s3-access-key-file=/secret/minio/MINIO_ACCESS_KEY
- --s3-secret-key-file=/secret/minio/MINIO_SECRET_KEY
- --s3-ssl=false
- --s3-bucket=wedding
- --s3-bucket=contexts
env:
- name: KEEP_FAILED_PODS
value: "yes"
Expand Down Expand Up @@ -74,7 +74,7 @@ spec:
volumes:
- name: minio
secret:
secretName: minio
secretName: wedding-minio
- name: buildkitd-config
configMap:
name: buildkitd-config
Expand Down
21 changes: 12 additions & 9 deletions service-dependencies/Tiltfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
k8s_yaml('minio.yaml')
k8s_resource('minio', port_forwards=9000)

k8s_yaml('minio-setup.yaml')
k8s_resource(
'setup-s3-bucket',
resource_deps=['minio'],
'wedding-minio',
new_name='minio',
port_forwards=9000,
)
k8s_resource(
'delete-old-files',
resource_deps=['setup-s3-bucket'],
'setup-minio-buckets',
new_name='minio-buckets',
resource_deps=['minio'],
)

k8s_yaml('wedding-registry.yaml')
k8s_resource('wedding-registry', port_forwards=5000)
k8s_yaml('registry.yaml')
k8s_resource(
'wedding-registry',
new_name='registry',
port_forwards=5000,
)
73 changes: 0 additions & 73 deletions service-dependencies/minio-setup.yaml

This file was deleted.

66 changes: 52 additions & 14 deletions service-dependencies/minio.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
apiVersion: v1
kind: Service
metadata:
name: minio
name: wedding-minio
spec:
ports:
- name: minio
port: 9000
selector:
app: minio
app: wedding-minio
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
name: wedding-minio
spec:
selector:
matchLabels:
app: minio
app: wedding-minio
strategy:
type: Recreate
replicas: 1
template:
metadata:
labels:
app: minio
app: wedding-minio
spec:
containers:
- name: minio
image: minio/minio:RELEASE.2020-05-16T01-33-21Z
image: minio/minio:RELEASE.2020-12-29T23-29-29Z
args:
- server
- /home/shared
envFrom:
- secretRef:
name: minio
name: wedding-minio
ports:
- name: http
containerPort: 9000
resources:
limits:
cpu: "100m"
memory: "500Mi"
cpu: "1000m"
memory: "1Gi"
requests:
cpu: "100m"
memory: "500Mi"
memory: "1Gi"
readinessProbe:
httpGet:
path: /minio/health/live
Expand All @@ -61,12 +61,12 @@ spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: minio
claimName: wedding-minio
---
apiVersion: v1
kind: Secret
metadata:
name: minio
name: wedding-minio
type: Opaque
stringData:
MINIO_ACCESS_KEY: minio123
Expand All @@ -75,10 +75,48 @@ stringData:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio
name: wedding-minio
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storage: 20Gi
---
apiVersion: batch/v1
kind: Job
metadata:
name: setup-minio-buckets
spec:
backoffLimit: 20
template:
metadata:
name: setup-minio-bucket
spec:
containers:
- name: mc
image: minio/mc:RELEASE.2020-12-18T10-53-53Z
command:
- sh
- -c
- |
set -euxo pipefail
mc config host add minio http://wedding-minio:9000 $(cat /secret/minio/MINIO_ACCESS_KEY) $(cat /secret/minio/MINIO_SECRET_KEY)
mc mb minio/contexts --ignore-existing
mc mb minio/registry --ignore-existing
resources:
limits:
cpu: 20m
memory: 100Mi
requests:
cpu: 20m
memory: 100Mi
volumeMounts:
- name: minio
mountPath: "/secret/minio"
readOnly: true
volumes:
- name: minio
secret:
secretName: wedding-minio
restartPolicy: OnFailure
Loading

0 comments on commit b310eb0

Please sign in to comment.