-
Notifications
You must be signed in to change notification settings - Fork 186
add soci snapshotter extension #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+155
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [proxy_plugins] | ||
| [proxy_plugins.soci] | ||
| type = "snapshot" | ||
| address = "/var/run/soci-snapshotter/soci-snapshotter-grpc.sock" | ||
|
|
||
| [plugins."io.containerd.cri.v1.images"] | ||
| snapshotter = "soci" | ||
| disable_snapshot_annotations = false |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # AWS SOCI Snapshotter extension | ||
|
|
||
| ## Installation | ||
|
|
||
| See [Installing Extensions](https://github.com/siderolabs/extensions#installing-extensions). | ||
|
|
||
| ## Pulling from Privte Registries | ||
|
|
||
| To pull from private registries an additional step is required. You must configure the Kubelet to use the SOCI snapshotter as an image service proxy. This is explained in more detail in the [SOCI docs](https://github.com/awslabs/soci-snapshotter/blob/main/docs/registry-authentication.md#kubernetes-cri-credentials). An example config patch: | ||
|
|
||
| ```yaml | ||
| machine: | ||
| kubelet: | ||
| extraConfig: | ||
| imageServiceEndpoint: unix:///var/run/soci-snapshotter/soci-snapshotter-grpc.sock | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # SOCI Snapshotter configuration | ||
|
|
||
| # Enable use of the SOCI snapshotter as a proxy ImageService so it can pull | ||
| # images from private registries. | ||
| [cri_keychain] | ||
| enable_keychain = true | ||
| image_service_path = "/var/run/containerd/containerd.sock" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| version: v1alpha1 | ||
| metadata: | ||
| name: soci-snapshotter | ||
| version: "{{ .VERSION }}" | ||
| author: Sidero Labs | ||
| description: | | ||
| [{{ .TIER }}] This system extension provides AWS SOCI Snapshotter using containerd's runtime handler. | ||
| compatibility: | ||
| talos: | ||
| version: ">= v1.8.0" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: soci-snapshotter | ||
| variant: scratch | ||
| shell: /bin/bash | ||
| dependencies: | ||
| - stage: base | ||
| steps: | ||
| - sources: | ||
| - url: https://github.com/awslabs/soci-snapshotter/archive/refs/tags/{{ .SOCI_SNAPSHOTTER_VERSION }}.tar.gz | ||
| destination: soci-snapshotter.tar.gz | ||
| sha256: {{ .SOCI_SNAPSHOTTER_SHA256 }} | ||
| sha512: {{ .SOCI_SNAPSHOTTER_SHA512 }} | ||
| env: | ||
| GOPATH: /tmp/go | ||
| VERSION: {{ .SOCI_SNAPSHOTTER_VERSION }} | ||
| REVISION: {{ .SOCI_SNAPSHOTTER_REV }} | ||
| cachePaths: | ||
| - /.cache/go-build | ||
| - /tmp/go/pkg | ||
| - network: default | ||
| prepare: | ||
| - | | ||
| mkdir -p ${GOPATH}/src/github.com/awslabs/soci-snapshotter | ||
|
|
||
| tar -xzf soci-snapshotter.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/awslabs/soci-snapshotter | ||
| - | | ||
| cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter/cmd | ||
| go mod download | ||
| - network: none | ||
| build: | ||
| - | | ||
| cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter | ||
|
|
||
| make soci-snapshotter-grpc | ||
| make soci | ||
| install: | ||
| - | | ||
| mkdir -p /rootfs/usr/local/bin | ||
| mkdir -p /rootfs/usr/local/lib/containers/soci-snapshotter | ||
|
|
||
| cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter | ||
|
|
||
| cp ./out/soci-snapshotter-grpc /rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc | ||
| chmod +x /rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc | ||
|
|
||
| cp ./out/soci /rootfs/usr/local/lib/containers/soci-snapshotter/soci | ||
| chmod +x /rootfs/usr/local/lib/containers/soci-snapshotter/soci | ||
|
|
||
| mkdir -p /rootfs/usr/local/lib/containers/soci-snapshotter/etc/soci-snapshotter-grpc/ | ||
| cp /pkg/config.toml /rootfs/usr/local/lib/containers/soci-snapshotter/etc/soci-snapshotter-grpc/config.toml | ||
| - | | ||
| mkdir -p /rootfs/etc/cri/conf.d | ||
| cp /pkg/10-soci-snapshotter.part /rootfs/etc/cri/conf.d/10-soci-snapshotter.part | ||
|
|
||
| mkdir -p /rootfs/usr/local/etc/containers | ||
| cp /pkg/soci-snapshotter.yaml /rootfs/usr/local/etc/containers/ | ||
| test: | ||
| - | | ||
| mkdir -p /extensions-validator-rootfs | ||
| cp -r /rootfs/ /extensions-validator-rootfs/rootfs | ||
| cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml | ||
| /extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}" | ||
| sbom: | ||
| outputPath: /rootfs/usr/local/share/spdx/soci-snapshotter.spdx.json | ||
| version: {{ .SOCI_SNAPSHOTTER_VERSION }} | ||
| licenses: | ||
| - Apache-2.0 | ||
| finalize: | ||
| - from: /rootfs | ||
| to: /rootfs | ||
| - from: /pkg/manifest.yaml | ||
| to: / | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: soci-snapshotter | ||
| depends: | ||
| - service: cri | ||
| restart: always | ||
| container: | ||
| entrypoint: ./soci-snapshotter-grpc | ||
| args: | ||
| - -log-level=debug | ||
| - -address=/var/run/soci-snapshotter/soci-snapshotter-grpc.sock | ||
| - -root=/var/lib/containerd/io.containerd.snapshotter.v1.soci | ||
| security: | ||
| rootfsPropagation: shared | ||
| mounts: | ||
| - source: /var | ||
| destination: /var | ||
| type: bind | ||
| options: | ||
| - rshared | ||
| - rbind | ||
| - rw | ||
| - source: /run | ||
| destination: /run | ||
| type: bind | ||
| options: | ||
| - rshared | ||
| - rbind | ||
| - rw | ||
| - source: /etc/ssl/certs | ||
| destination: /etc/ssl/certs | ||
| type: bind | ||
| options: | ||
| - rbind | ||
| - ro |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| VERSION: "{{ .SOCI_SNAPSHOTTER_VERSION }}" | ||
| TIER: "extra" |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.