Skip to content

Commit

Permalink
added basic auth, exposed 9096, ports refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ironoa committed Oct 21, 2021
1 parent 6508d4f commit 37394ac
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 20 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

# ipfs-cluster-chart
Helm Chart for: https://cluster.ipfs.io/documentation/guides/k8s/

NOTE: all the secrets are hardcoded and will be replaced
2 changes: 1 addition & 1 deletion charts/ipfs-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: IPFS Cluster chart
name: ipfs-cluster
version: v0.0.1
version: v0.0.2
apiVersion: v2
5 changes: 5 additions & 0 deletions charts/ipfs-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@
{{/* Returns the service name http */}}
{{- define "ipfs-cluster.serviceNameHttp" -}}
{{ .Release.Name }}-http
{{- end }}

{{/* Returns the service name local */}}
{{- define "ipfs-cluster.serviceNameLocal" -}}
{{ .Release.Name }}-local
{{- end }}
1 change: 0 additions & 1 deletion charts/ipfs-cluster/templates/configmap-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@ data:
ipfs config --json Swarm.ConnMgr.HighWater 2000
ipfs config --json Datastore.BloomFilterSize 1048576
ipfs config Datastore.StorageMax 100GB
#ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://157.245.16.171:5001", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
44 changes: 29 additions & 15 deletions charts/ipfs-cluster/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Exposed
apiVersion: v1
kind: Service
metadata:
Expand All @@ -15,22 +16,14 @@ spec:
port: 4001
- name: swarm-udp
targetPort: swarm-udp
port: 4002
- name: ws
targetPort: ws
port: 8081
- name: api-http
targetPort: api-http
port: 9094
- name: proxy-http
targetPort: proxy-http
port: 9095
port: 4002
- name: cluster-swarm
targetPort: cluster-swarm
port: 9096
port: 9096 #public with secret protection
selector:
app: {{ .Release.Name }}
---
# Exposed behind Proxy
apiVersion: v1
kind: Service
metadata:
Expand All @@ -39,11 +32,32 @@ metadata:
node: {{ .Release.Name }}
spec:
ports:
- name: api
targetPort: api
port: 5001
- name: gateway
targetPort: gateway
port: 8080
selector:
app: {{ .Release.Name }}
app: {{ .Release.Name }}
---
# Not Exposed
apiVersion: v1
kind: Service
metadata:
name: {{ include "ipfs-cluster.serviceNameHttpLocal" . }}
labels:
node: {{ .Release.Name }}
spec:
ports:
- name: api
targetPort: api
port: 5001
- name: proxy-http
targetPort: proxy-http
port: 9095
- name: ws
targetPort: ws
port: 8081
- name: api-http
targetPort: api-http
port: 9094
selector:
app: {{ .Release.Name }}
10 changes: 8 additions & 2 deletions charts/ipfs-cluster/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ spec:
key: cluster-secret
- name: CLUSTER_MONITOR_PING_INTERVAL
value: "3m"
- name: CLUSTER_RESTAPI_HTTPLISTENMULTIADDRESS
value: "/ip4/0.0.0.0/tcp/9094"
- name: CLUSTER_RESTAPI_LIBP2PLISTENMULTIADDRESS
value: "/ip4/0.0.0.0/tcp/9096"
- name: CLUSTER_RESTAPI_ID
value: "12D3KooWMfXzp2nmNrb7DM4PETYZbaKALnrnwiqnhvrUC66KyYrb"
- name: CLUSTER_RESTAPI_PRIVATEKEY
value: "CAESQEmvGJbMboEibpcWCTKOtDYU2eEyyHLN9gDdJli6Z2tksAkhFWNx0Fk3vOlwLIitE2rfGtIj61Ovla/mHC42Plg="
- name: CLUSTER_RESTAPI_BASICAUTHCREDENTIALS
value: "w3f:password"
- name: SVC_NAME
value: {{ include "ipfs-cluster.serviceName" . }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion helmfile.d/10-ipfs-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ releases:
{{ if eq .Environment.Name "production" }}
chart: w3f/ipfs-cluster
namespace: ipfs
version: v0.0.1
version: v0.0.2
{{ else }}
chart: ../charts/ipfs-cluster
{{ end }}
Expand Down

0 comments on commit 37394ac

Please sign in to comment.