Repository navigation
Alpine: mount AlpineConfig.files into the primary container - #802
Open
abhishek-7 wants to merge 2 commits into
Open
abhishek-7 wants to merge 2 commits into
abhishek-7 wants to merge 2 commits into
Conversation
Contributor
|
/gcbrun |
manizzzz
approved these changes
Nov 4, 2026
manizzzz
left a comment
Contributor
There was a problem hiding this comment.
Thanks Abhishek, LGTM! Left a couple of small non-blocking notes below.
abhishek-7
force-pushed
the
alpine-primary-container-files
branch
from
November 4, 2026 11:32
3abff11 to
53afe36
Compare
Contributor
|
/gcbrun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change is needed
Previously in
topo/node/alpine/alpine.go(CreatePod):Single-container
ALPINEdeployments had the<node>-filesConfigMapand pod volume created, but never mounted into the primary container.Summary of changes
topo/node/alpine/alpine.go:extraMountstoalpineContainers[0].VolumeMountswhenAlpineConfig.filesis populated so that the configured file mounts are available in the primary Alpine container as well as any custom sidecar containers.topo/node/alpine/alpine_test.go:Test Results
Unit tests (
go test -v ./topo/node/alpine/...)KNE cluster verification
Deployed a single-container
ALPINEtopology with bothconfig_db.json(innode.config) andattributes.json(inAlpineConfig.filesmounted at/etc/files) on a Kind/KNE cluster:name: "poc-files" nodes: { name: "dut" type: ALPINE config: { image: "us-west1-docker.pkg.dev/gpins-av/kne/alpine/alpinevs:latest" config_path: "/etc/sonic" config_file: "config_db.json" file: "dut_config_db.json" } vendor_data: { [type.googleapis.com/alpine.AlpineConfig]: { files: { mount_dir: "/etc/files" files: { key: "attributes.json" value: { file: "attributes.json" } } } } } }Verified on the running pod (
kubectl get pod -n poc-files dutandkubectl exec):Pod Container
VolumeMounts:[{"mountPath":"/etc/files","name":"files"},{"mountPath":"/etc/sonic/config_db.json","name":"startup-config-volume","readOnly":true,"subPath":"config_db.json"}]Inside the container: