question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to run dat inside kubernetes

See original GitHub issue

Is 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:open
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ninabreznikcommented, Oct 30, 2019

@dwiel that’s great. Can you share your dockerfile to see your configuration and hopefully make it run too?

Thanks @RangerMauve for a ping!

1reaction
dwielcommented, Oct 30, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found