puppetlabs / pupperware

Container fun time lives here.
Other
183 stars 67 forks source link

K8S: Inconsistent R10K module deployment #187

Closed slconley closed 5 years ago

slconley commented 5 years ago

Describe the Bug

In K8S deployment, R10K does not retrieve modules for any environments if the responsible cronjob is not triggered quickly enough after initial deployment.

Expected Behavior

The /etc/puppetlabs/code/environments/production/modules should be populated with modules listed in the Puppetfile.

Steps to Reproduce

Steps to reproduce the behavior:

  1. In values.yaml, configure puppetserver.puppeturl to valid puppet-control repo, which should contain a Puppetfile on at least one branch.That Puppetfile should list a number of modules to be downloaded for the environment.
  2. Also in values.yaml, set r10k.cronJob.schedule so that it would run less frequently, i.e. every 5 minutes.
  3. Run "helm install -n puppetserver ." with at least 2 minutes time before the cronJob would be triggered.
  4. Wait for the cronJob to run, and exec into the main puppetserver container. Examine the /etc/puppetlabs/code/environments/production to see that there is no "modules" sub-directory.

Environment

Additional Context

If the cronJob is triggered within roughly 30 seconds of the initial deployment, then the modules to get populated as expected.

In case this is relevant, I have been testing with private git repos via ssh for puppet-control, hiera, and most of the modules. All of that gets fetched properly except for this timing issue, so it seems the repo/transport types are not factors.

underscorgan commented 5 years ago

@Xtigyro have you run into anything like this?

Xtigyro commented 5 years ago

@underscorgan Will look into this and let you know. Sounds valid.