Code Monkey home page Code Monkey logo

Comments (10)

metacosm avatar metacosm commented on May 18, 2024 1

Hehe, good to see you're on top of things, @lburgazzoli! I was thinking that kcp could indeed be interesting in a testing context for operators.

from kcp.

ncdc avatar ncdc commented on May 18, 2024 1

We are now publishing a kcp image (see https://github.com/kcp-dev/kcp/pkgs/container/kcp).

@lburgazzoli can your test automation use a docker cp/podman cp command to copy the admin.kubeconfig out of the container for use by your tests?

from kcp.

lburgazzoli avatar lburgazzoli commented on May 18, 2024 1

@ncdc @metacosm added an initial testcontainer impl that spins up a kcp server https://github.com/lburgazzoli/testcontainers-kcp

from kcp.

ncdc avatar ncdc commented on May 18, 2024 1

I believe we can close this. If there are still any issues, please let us know.

from kcp.

imjasonh avatar imjasonh commented on May 18, 2024

Images are already published in CI to GHCR: https://github.com/kcp-dev/kcp/pkgs/container/kcp%2Fsyncer-c2e3073d5026a8f7f2c47a50c16bdbec -- with tags for short commit SHAs:

docker pull ghcr.io/kcp-dev/kcp/syncer-c2e3073d5026a8f7f2c47a50c16bdbec:7471fb9

We can improve this over time (in particular the image name, which is terrible). If you try it out and give feedback about what worked/didn't that would help us improve it.

from kcp.

lburgazzoli avatar lburgazzoli commented on May 18, 2024

As per #111, I tough the image is just the syncer, not kcp.
Am I wrong ?

from kcp.

imjasonh avatar imjasonh commented on May 18, 2024

You are totally correct, sorry for misreading.

It should be easy enough to build the image, but if the intention is to run kcp inside a Kubernetes cluster, I'm not sure that's something we've really explored or prioritized yet, so things might not work very well. In particular, kcp presents a K8s control plane backed by etcd, which should run fine inside K8s with its own etcd storage, but it might end up being confusing to have both running.

from kcp.

lburgazzoli avatar lburgazzoli commented on May 18, 2024

if the intention is to run kcp inside a Kubernetes cluster

Not at all, my only goal is to be able to spin up kcp as part of my integration tests running locally on my PC or as part of GitHub Actions. As today I use kind or minikube but they are overkill for my use case where in essence I don't need any of the controller that they ship.

from kcp.

lburgazzoli avatar lburgazzoli commented on May 18, 2024

It should be easy enough to build the image,

so yes it is quite simple to generate a container image for kcp with ko however, what should be the best and easier way to access the kcp ?

I initially tough to use volumes thus having the .kcp persisted outside of the container but it may cause troubles:

➜ docker run --rm -ti -v $PWD/conf:/.kcp/data:Z -p 6443:6443 ko.local/kcp.go start

{
  "level":"warn",
  "ts":1634314144.2230017,
  "caller":"fileutil/fileutil.go:57",
  "msg":"check file permission","error":"directory \".kcp/data\" exist, but the permission is \"dtrwxr-xr-x\". The recommended permission is \"-rwx------\" to prevent possible unprivileged access to the data"
}

Even if kcp starts, then content of the volume is owned by root and it is not accessible by standard users:

➜ ll conf/
total 16
-rw-------. 1 root root 6896 Oct 15 18:27 admin.kubeconfig
-rw-r--r--. 1 root root 2275 Oct 15 18:27 apiserver.crt
-rw-------. 1 root root 1675 Oct 15 18:27 apiserver.key
drwx------. 4 root root   29 Oct 15 18:27 member
drwx------. 5 root root   42 Oct 15 18:27 secrets

This can be fixed by using podman or rootles docker but it may require some additional set-up so, is there a better way to access a kcp instance running in a container ?

from kcp.

metacosm avatar metacosm commented on May 18, 2024

@lburgazzoli let me know how it goes, would be interested to see if this works nicely in GitHub Actions…

from kcp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.