Skip to content

Instantly share code, notes, and snippets.

@skylenet
Created January 17, 2019 16:50
Show Gist options
  • Select an option

  • Save skylenet/dade47102be4b612759153d7ffb1fd1d to your computer and use it in GitHub Desktop.

Select an option

Save skylenet/dade47102be4b612759153d7ffb1fd1d to your computer and use it in GitHub Desktop.
Deploy multiple private swarm clusters within the same k8s namespace
#!/bin/bash -xe
NAMESPACE=${VARIABLE:-rafael}
HELM_INSTALL="helm install --tiller-namespace=$NAMESPACE --namespace=$NAMESPACE"
HELM_UPDATE="helm upgrade --tiller-namespace=$NAMESPACE"
HELM_DELETE="helm delete --tiller-namespace=$NAMESPACE"
if [ $# -lt 1 ]; then
echo "Usage: NAMESPACE=your-namespace $0 [install|upgrade|delete] ..."
exit 1
fi
if [ "$1" = "install" ]; then
$HELM_INSTALL --name sw1 ethersphere/swarm-private --values sw1.yaml
$HELM_INSTALL --name sw2 ethersphere/swarm-private --values sw2.yaml
fi
if [ "$1" = "upgrade" ]; then
$HELM_UPDATE sw1 ethersphere/swarm-private --values sw1.yaml
$HELM_UPDATE sw2 ethersphere/swarm-private --values sw2.yaml
fi
if [ "$1" = "delete" ]; then
$HELM_DELETE sw1 --purge
$HELM_DELETE sw2 --purge
fi
swarm:
metricsEnabled: true
replicaCount: 2
podManagementPolicy: Parallel
terminationGracePeriodSeconds: 5
image:
repository: ethdevops/swarm
tag: edge
config:
ens_api: http://mainnet-geth-geth.geth:8545
persistence:
enabled: false
ingress:
domain: stg.swarm-gateways.net
enabled: true
tls:
enabled: true
acmeEnabled: false
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/ssl-redirect: "false"
resources:
requests:
memory: 512Mi
cpu: 0.1
limits:
memory: 1024Mi
cpu: 0.3
grafana:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: metrics
type: influxdb
url: http://sw1-influxdb:8086
database: metrics
user: swarm
password: swarm
access: proxy
isDefault: true
swarm:
metricsEnabled: true
replicaCount: 2
podManagementPolicy: Parallel
terminationGracePeriodSeconds: 5
image:
repository: ethdevops/swarm
tag: edge
config:
ens_api: http://mainnet-geth-geth.geth:8545
persistence:
enabled: false
ingress:
domain: stg.swarm-gateways.net
enabled: true
tls:
enabled: true
acmeEnabled: false
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/ssl-redirect: "false"
resources:
requests:
memory: 512Mi
cpu: 0.1
limits:
memory: 1024Mi
cpu: 0.3
grafana:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: metrics
type: influxdb
url: http://sw2-influxdb:8086
database: metrics
user: swarm
password: swarm
access: proxy
isDefault: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment