with version 0.4.0 (PR #7), Runner failed to start with custom Pod spec
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: my-runner
annotations:
iam.amazonaws.com/role: my-role
spec:
replicas: 1
template:
spec:
repository: example/repo
containers:
- name: runner
image: example/custom-action-runner:latest
imagePullPolicy: Always
Error log
kubectl logs muy-runner-8gcph-v7plj -f
RUNNER_NAME must be set
a fix PR will follow up soon.
Hmmmm, for me when you choose to override containers, you should be responsible to override all fields including env, field. So it's not a bug, it is expected behavior :)
BTW, my bad I completely forget to add README about the new features.
@alexandrst88 Hey! Thanks for chiming in. Yeah - I thought so initially, but that feature turned out to be unusable at all without the ability to inject the required env.
The env includes a dynamically generated runner token that is required by the runner to run. Can we somehow generate the runner token out of the band and provide it via containers so that the runner controller can use it as-is? Yeah - but that seemed to defeat the purpose of the controller.
Oh I see
Any updates on this? I'm also stuck on this issue of the runner name not being set.
How can we pass in the proper environment name?
Unfortunately, there's no update as I don't use this specific feature!
Do you have a hard requirement that needs RUNNER_NAME? Then my best bet is adding support for merging spec.template.containers[] by container name. spec.template.containers[].env should also be merged by environment name. It should be like how K8s strategic-merge patches work.
I'm just trying to get a runner up with the deployment in a custom runner.
Which file would I put that merging support in?
Where can I read up more on how "K8s strategic-merge patches work."?
@avik-so Unfortunately I have no reference to share. AFAIK it isn't well-documented as a reusable library.
I believe kustomize uses it for merging K8s resource manifests locally. So instead, I can suggest consuling kustomize codebase to see how it works.
If I am understanding correctly, you are suggesting that I create a new yaml file and do a patch with the missing environment variables/config maps, rather than making a PR which allows the RunnerDeployment file to patch the custom pods/images?