Peer

apiVersion: ipfs.kotal.io/v1alpha1
kind: Peer
metadata:
Name: my-peer
spec:
# your peer spec goes here

Peer resource spec parameters are summrized in the following table:

SyntaxTypeDescriptionDefault
initProfilesArrayList of initial configuration profilesdefault-datastore
apiHoststringAPI server host0.0.0.0
apiPortnumberAPI server port5001
gatewayHoststringLocal ipfs gateway host0.0.0.0
gatewayPortnumberLocal ipfs gateway port8080
routingstringContent routing mechanismdht
swarmKeySecretstringName of the k8s secret holding swarm key
resourcesobjectCompute and storage resources

initProfiles#

initProfiles is the list of initial ipfs configuration profile.

initialProfiles available values are server, randomports, default-datastore, local-discovery, test, default-networking, flatfs, badgerds, and lowpower.

initProfiles can't be updated (immutable).

apiHost#

apiHost is API server host.

note

If you set apiHost to host other than 0.0.0.0, api calls forwarded to the container won't hit the API server. This is useful if you want to disallow calls to API server.

apiPort#

apiPort is API server port.

gatewayHost#

gatewayHost is local ipfs gateway host.

note

If you set gatewayHost to host other than 0.0.0.0, gateway won't work. This is useful if you want to disable to access gateway from outside.

gatewayPort#

gatewayPort is API server port.

routing#

routing is the content routing mechanism.

routing available values are none, dht, dhtclient, dhtserver.

swarmKeySecret#

swarmKeySecret is the kubernetes secret name tha holds the swarm key in a key called key.

$ kubectl create secret generic swarm-key --from-literal=secret=$w@rmk3y

resources#

resources allocates compute and storage resources to the peer.

resources object has the following fields:

SyntaxTypeDescriptionDefalt
cpustringnumber of cpu cores this peer requires1
cpuLimitstringnumber of cpu cores this peer is limited to2
memorystringmemory this peer requires2Gi
memoryLimitstringmemory this peer is limited to4Gi
storagestringdisk space this peer requires10Gi

Memory and storage requests and limits must use the pattern ^[1-9][0-9]*[KMGTPE]i$ for example 1500Mi, 30Gi, and 1Ti.

cpu requests and limits must use the pattern ^[1-9][0-9]*m?$ for example 1000m (which is equal to 1 core), 1500m which is 1.5 core, 2 cores, and 4 cores.

cpuLimit can't be less than cpu.

memoryLimit can't be less than or equal to memory.