Skip to content

Use a custom entrypoint script for k8s container nodes - #2289

Merged
katiewasnothere merged 2 commits into
apple:mainfrom
katiewasnothere:k8s_custom_entrypoint_script
Oct 13, 2026
Merged

katiewasnothere merged 2 commits into
apple:mainfrom
katiewasnothere:k8s_custom_entrypoint_script

Conversation

@katiewasnothere

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix

Motivation and Context

This PR eliminates the use of the default entrypoint script in the kindest/node image, which has logic specific to kind's environment. For example, the kind entrypoint script has the function fix_machine_id() which is not necessary for apple/container since each cluster node runs in its own microVM, per the architectural design of container.

From my investigation, the main risks of this change are in keeping the list of files that need to be updated on a restart up to date over time. While this is a meaningful concern, considering that most of kind's entrypoint script code is irrelevant and possibly even harmful for the apple/container environment today, this is a fair tradeoff.

This PR additionally fixes #2156 by handling certificate update and IP changes on a restart specifically for our environment. With the kind entrypoint script, many of the files that we depend on elsewhere in this repo such as /root/.kube/config were not properly updated.

Testing

  • Tested locally
  • Added/updated tests

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 20.74%
Integration 66.78%
Combined 76.25%

@jglogan jglogan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a couple more comments in the script to guide viewers' eyes.

Comment thread Sources/ContainerK8s/K8sHelper.swift Resolved
Comment thread Sources/ContainerK8s/K8sHelper.swift Resolved
@katiewasnothere
katiewasnothere force-pushed the k8s_custom_entrypoint_script branch from 8bc5f95 to b823ce8 Compare October 12, 2026 21:00
@katiewasnothere
katiewasnothere force-pushed the k8s_custom_entrypoint_script branch from b823ce8 to 39436c9 Compare October 12, 2026 22:22
@katiewasnothere
katiewasnothere merged commit 17ea964 into apple:main Oct 13, 2026
3 checks passed
@katiewasnothere
katiewasnothere deleted the k8s_custom_entrypoint_script branch October 13, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kubernetes control-plane restart fails after node IP rotation

2 participants