File tree Expand file tree Collapse file tree
components/understack-cdn Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ apiVersion : v2
2+ name : understack-cdn
3+ description : HTTP service to serve firmware images from central store
4+ type : application
5+ version : 0.1.0
Original file line number Diff line number Diff line change @@ -12,16 +12,15 @@ cluster-local tendot IP address.
1212
1313The proxy edge service caches files locally on a persistent volume.
1414
15- Nginx configuration contains:
16- - the service address for rook-ceph
17- - the name of our bucket
18-
19- All files are proxied to that object bucket. Anonymous credentials are used,
15+ All files are proxied to our object bucket. Anonymous credentials are used,
2016therefore we need to make the files in our bucket readable by anonymous if they
2117are to be accessible via HTTP.
2218
2319## Uploading file to object storage
2420
21+ We have an ObjectBucket provisioned via rook/ceph. The operator for our
22+ ObjectBucketClaim creates credentials for us to access this bucket.
23+
2524Our credentials and bucket info is in a secret and a configmap both named after
2625the bucketclaim:
2726
Load diff This file was deleted.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 4343 proxy_cache_path /var/cache/nginx/cdn
4444 levels= 1:2
4545 keys_zone= cdn_cache:50m
46- max_size=5g
47- inactive=7d
46+ max_size= {{ .Values.cdn.cacheSize }}
47+ inactive= {{ .Values.cdn.inactive }}
4848 use_temp_path= off;
4949
5050 # Don't buffer large files to disk before sending — stream them
6464 include /etc/nginx/conf.d /* .conf;
6565 }
6666 default.conf: |
67- # Upstream: your S3 S3 origin
68- # In production this points at your S3 service endpoint.
69- # Can also point at R2/S3 by changing the server and Host header.
7067 upstream s3_origin {
71- server rook-ceph-rgw-ceph-objectstore.rook-ceph.svc:80 ;
68+ server {{ .Values.cdn.objectStorageServerHostname }}:{{ .Values.cdn.objectStorageServerPort }} ;
7269 keepalive 32;
7370 }
7471
@@ -102,10 +99,10 @@ data:
10299 proxy_no_cache 0;
103100 proxy_ignore_headers Cache-Control Expires Set-Cookie;
104101
105- location /firmware-images / {
102+ location /{{ .Values.cdn.bucketName }} / {
106103 # Forward to Object Storage.
107- # S3-compatible API expects requests in the form: /bucket/key
108- # Our bucket is called firmware-images
104+ # S3-compatible API expects requests in the form: /bucket-name /key
105+ # Our clients are using URL paths in the exact same format.
109106 proxy_pass http://s3_origin$request_uri;
110107
111108 proxy_http_version 1.1;
Original file line number Diff line number Diff line change 1+ {{- if .Values.cdn.objectBucketIsLocal }}
12apiVersion: objectbucket.io /v1alpha1
23kind: ObjectBucketClaim
34metadata:
4- name : firmware-images
5+ name: {{ .Values.cdn.bucketName }}
56 namespace: understack-cdn
67spec:
7- bucketName : firmware-images
8+ bucketName: {{ .Values.cdn.bucketName }}
89 storageClassName: ceph-bucket
910 additionalConfig:
1011 maxObjects: " 1000"
11- maxSize : " 5G"
12+ maxSize: {{ .Values.cdn.bucketMaxSize }}
13+ {{- end }}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ cdn :
2+ # Cache is limited to this size. We will provision a volume this size so
3+ # changing it would require the filesystem to be rebuilt/resized:
4+ cacheSize : 10g
5+ # Files are evicted from the cache if they have not been accessed in:
6+ inactive : 7d
7+
8+ # The location of our object bucket (s3-compatible object store) providing us
9+ # with anonymous access to our image files:
10+ objectStorageServerHostname : rook-ceph-rgw-ceph-objectstore.rook-ceph.svc
11+ objectStorageServerPort : 80
12+ bucketName : firmware-images
13+
14+ # Whether to create a local ObjectBucketClaim (true) or use external storage (false)
15+ objectBucketIsLocal : false
16+ # If above is true, how much space to claim for this object bucket:
17+ bucketMaxSize : 40g
You can’t perform that action at this time.
0 commit comments