Skip to content

Commit

Permalink
Merge pull request s3gw-tech#29 from votdev/various_improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
votdev authored Apr 28, 2022
2 parents 9739971 + ae6740c commit 7bfa3d5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions k3s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ $ s3cmd -c ./s3cmd.cfg ls s3://

Please adapt the `host_base` and `host_bucket` properties in the `s3cmd.cfg`
configuration file if your K3s cluster is not accessible via localhost.

# Configure s3gw as Longhorn backup target

Use the following values in the Longhorn settings page to use the s3gw as
backup target.

Backup Target: `s3://<BUCKET_NAME>@us/`
Backup Target Credential Secret: `s3gw-secret`
10 changes: 10 additions & 0 deletions k3s/longhorn-s3gw-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: s3gw-secret
namespace: longhorn-system
type: Opaque
data:
AWS_ACCESS_KEY_ID: MDU1NWIzNTY1NGFkMTY1NmQ4MDQ=
AWS_SECRET_ACCESS_KEY: aDdHaHh1QkxUcmxoVlV5eFNQVUtVVjhyLzJFSTRuZ3FKeEQ3aUJkQllMaHdsdU4zMEphVDNRPT0=
AWS_ENDPOINTS: aHR0cDovL3MzZ3ctc2VydmljZS5zM2d3LXN5c3RlbTo4MC8= # http://s3gw-service.s3gw-system:80/
8 changes: 5 additions & 3 deletions k3s/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sudo k3s ctr images import ./s3gw.ctr.tar || (
exit 1
)

# Workaround a k8s behaviour that CustomResourceDefinition must be
# Workaround a K8s behaviour that CustomResourceDefinition must be
# established before they can be used by a resource.
# https://github.com/kubernetes/kubectl/issues/1117
# k3s kubectl wait --for=condition=established --timeout=60s crd middlewares.traefik.containo.us
Expand All @@ -96,12 +96,13 @@ done
echo

apply "longhorn storage class" longhorn-storageclass.yaml
apply "Longhorn ingress" longhorn-ingress.yaml
apply "Longhorn s3gw secret" longhorn-s3gw-secret.yaml
apply "s3gw namespace" s3gw-namespace.yaml
apply "s3gw persistent volume claim" s3gw-pvc.yaml
apply "s3gw pod" s3gw-pod.yaml
apply "s3gw service" s3gw-service.yaml
apply "s3gw ingress" s3gw-ingress.yaml
apply "longhorn ingress" longhorn-ingress.yaml

echo -n "Waiting for cluster to become ready..."
ip=""
Expand All @@ -110,6 +111,7 @@ do
echo -n "." && sleep 1;
ip=$(kubectl get -n s3gw-system ingress s3gw-ingress -o 'jsonpath={.status.loadBalancer.ingress[].ip}');
done
echo -e "\n\n"
echo -e "\n"
echo "Longhorn UI available at http://${ip}:80/longhorn/"
echo "s3gw available at http://${ip}:80/s3gw/"
echo -e "\n"

0 comments on commit 7bfa3d5

Please sign in to comment.