How to run dat inside kubernetes
See original GitHub issueIs anyone successfully running dat from inside kubernetes? The following Deployment is currently working for me, but it would be nice to avoid requiring hostNetwork: true
. Also wondering how to best specify the .dat keys. I am currently sharing them from the host which works all right in this scenario, but isn’t a very general solution. Also, the node this container is running on essentially has a public ip which might be making this easier. I haven’t yet tested it from inside kubernetes on a node without a public ip.
apiVersion: apps/v1
kind: Deployment
metadata:
name: dat-server
labels:
app: dat-server
spec:
replicas: 1
selector:
matchLabels:
app: dat-server
template:
metadata:
labels:
app: dat-server
spec:
volumes:
- name: nfs
hostPath:
path: /mnt/nfs
type: Directory
- name: dat-key
hostPath:
path: /root/.dat
type: Directory
# kubernetes secrets can't have subdirectories so this doesn't work
# - name: dat-key
# secret:
# secretName: dat-key
containers:
- name: dat-server
image: registry/dat:latest
command:
- "dat"
- "share"
- "/mnt/nfs/"
# - "sleep"
# - "300"
volumeMounts:
- name: nfs
mountPath: /mnt/nfs
- name: dat-key
mountPath: /root/.dat
# this gets dat network access, otherwise i get symmetric nat errors from dat doctor
hostNetwork: true
# sort of a hack, run this only on the node running the nfs server
nodeSelector:
nfs: server
# ---
# # I was still unable to access dat with this service
# kind: Service
# apiVersion: v1
# metadata:
# name: dat-server
# spec:
# type: NodePort
# selector:
# app: dat-server
# ports:
# - name: dat-tcp
# protocol: TCP
# nodePort: 30282
# port: 30282
# targetPort: 30282
# - name: dat-udp
# protocol: UDP
# nodePort: 30282
# port: 30282
# targetPort: 30282
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
How we run Kubernetes in Kubernetes aka Kubeception
Editor's note: Today's post is by the team at Giant Swarm, showing how they run Kubernetes in Kubernetes.
Read more >Encrypting Secret Data at Rest - Kubernetes
It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts....
Read more >Some things you didn't know about kubectl - Kubernetes
Run interactive commands ... The above kubectl command is equivalent to docker run -i -t busybox sh. Sadly we mistakenly used -t for...
Read more >Ingress - Kubernetes
An API object that manages external access to the services in a cluster, typically HTTP. Ingress may provide load balancing, SSL termination ...
Read more >Run a Single-Instance Stateful Application | Kubernetes
Create a PersistentVolume referencing a disk in your environment. · Create a MySQL Deployment. · Expose MySQL to other pods in the cluster...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dwiel that’s great. Can you share your dockerfile to see your configuration and hopefully make it run too?
Thanks @RangerMauve for a ping!
Thanks, btw I’ve tested the above solution on nodes that dont have public ips with success. Would still like avoid
hostNetwork: true
, but it is running. I’ve also had it working in docker with udp and TCP ports opened as well.