Giter VIP home page Giter VIP logo

Comments (2)

thirdgen88 avatar thirdgen88 commented on June 3, 2024 1

Some of what you described makes a lot of sense.. The reason for the difference in kcollins/ignition between /var/lib/ignition/data and /data as options for the persistent state relates to how volumes can operate in various situations. Use of /var/lib/ignition/data depends on the applied volume copying the existing files from within the container (at that location) into the volume on first-launch. If it doesn't do that, then the files (such as data/ignition.conf and others) that are expected to be at that location are missing. This is the reason I introduced the /data option, which takes care of pre-populating the volume with the required files within the entrypoint script.

Additionally, if you're using a bind-mount style (back to a path on your host system), you're correct to recognize that you'll need to apply appropriate permissions to that folder (either 999:999 UID/GID ownership (preferred) or global write).

Thank you for sharing some of your configurations, I'm sure that folks will benefit from them!

from ignition-docker.

thirdgen88 avatar thirdgen88 commented on June 3, 2024 1

As I start to dive deeper into K8s myself, I came across a strategy/alternative for volume persistence that doesn't necessarily depend on the /data empty-volume-mod feature of kcollins/ignition. Through the use of init containers, you can actually perform the "seeding" of your data volume fairly easily. Consider the following init container added to your Gateway pod:

initContainers:
- name: seed-volume
  image: kcollins/ignition:8.1.11
  command:
  - sh
  - -c
  - >
    if [ ! -f /seed-data/.seed-data-complete ]; then
      touch /seed-data/.seed-data-complete ;
      cp -dpR /var/lib/ignition/data/* /seed-data/ ;
    fi
  volumeMounts:
  - mountPath: /seed-data
    name: ignition-data

You'd then have your gateway container in the pod and point it to that same ignition-data volume. I kind of like this approach as it decouples that additional logic and keeps things simpler in the end! Hope this helps!

from ignition-docker.

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.