Skip to content

Commit

Permalink
Merge pull request #298 from Sparksssj/k8s1.32
Browse files Browse the repository at this point in the history
packages: boilerplate kubernetes-1.32 and ecr-credential-provider-1.32
  • Loading branch information
Sparksssj authored Dec 5, 2024
2 parents 8150e6f + 312e628 commit e8fd3bf
Show file tree
Hide file tree
Showing 31 changed files with 971 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"packages/ecr-credential-provider-1.29",
"packages/ecr-credential-provider-1.30",
"packages/ecr-credential-provider-1.31",
"packages/ecr-credential-provider-1.32",
"packages/ecs-agent",
"packages/ecs-gpu-init",
"packages/ethtool",
Expand Down Expand Up @@ -56,6 +57,7 @@ members = [
"packages/kubernetes-1.29",
"packages/kubernetes-1.30",
"packages/kubernetes-1.31",
"packages/kubernetes-1.32",
"packages/libacl",
"packages/libattr",
"packages/libaudit",
Expand Down
2 changes: 2 additions & 0 deletions kits/bottlerocket-core-kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ecr-credential-provider-1_27 = { path = "../../packages/ecr-credential-provider-
ecr-credential-provider-1_29 = { path = "../../packages/ecr-credential-provider-1.29" }
ecr-credential-provider-1_30 = { path = "../../packages/ecr-credential-provider-1.30" }
ecr-credential-provider-1_31 = { path = "../../packages/ecr-credential-provider-1.31" }
ecr-credential-provider-1_32 = { path = "../../packages/ecr-credential-provider-1.32" }
ecr-credential-provider = { path = "../../packages/ecr-credential-provider" }
ecs-agent = { path = "../../packages/ecs-agent" }
ecs-gpu-init = { path = "../../packages/ecs-gpu-init" }
Expand Down Expand Up @@ -66,6 +67,7 @@ kubernetes-1_28 = { path = "../../packages/kubernetes-1.28" }
kubernetes-1_29 = { path = "../../packages/kubernetes-1.29" }
kubernetes-1_30 = { path = "../../packages/kubernetes-1.30" }
kubernetes-1_31 = { path = "../../packages/kubernetes-1.31" }
kubernetes-1_32 = { path = "../../packages/kubernetes-1.32" }
libacl = { path = "../../packages/libacl" }
libattr = { path = "../../packages/libattr" }
libaudit = { path = "../../packages/libaudit" }
Expand Down
24 changes: 24 additions & 0 deletions packages/ecr-credential-provider-1.32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
# "." is not allowed in crate names, but we want a friendlier name for the
# directory and spec file, so we override it below.
name = "ecr-credential-provider-1_32"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
package-name = "ecr-credential-provider-1.32"
releases-url = "https://github.com/kubernetes/cloud-provider-aws/releases"

[[package.metadata.build-package.external-files]]
url = "https://codeload.github.com/kubernetes/cloud-provider-aws/tar.gz/v1.31.0"
path = "cloud-provider-aws-1.31.0.tar.gz"
sha512 = "962973013984a802853311182e1cfd1eabb1bcdf164000f607aeb2631ac98a0b4fd5ba1f7aff08491040979bd2321bcd5debd567c9aa74889b09d7599bc4dcfd"
bundle-modules = [ "go" ]

[build-dependencies]
glibc = { path = "../glibc" }
8 changes: 8 additions & 0 deletions packages/ecr-credential-provider-1.32/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x617d80bc },
{ path = "goyaml.v2/LICENSE", hash = 0xe569d630 },
{ path = "goyaml.v2/LICENSE.libyaml", hash = 0xa2e4ce3 },
{ path = "goyaml.v2/NOTICE", hash = 0x49bceeb9 },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
%global goproject github.com/kubernetes
%global gorepo cloud-provider-aws
%global goimport %{goproject}/%{gorepo}

%global gover 1.31.0
%global rpmver %{gover}

%global _dwz_low_mem_die_limit 0

Name: %{_cross_os}ecr-credential-provider-1.32
Version: %{rpmver}
Release: 1%{?dist}
Epoch: 1
Summary: Amazon ECR credential provider
License: Apache-2.0
URL: https://github.com/kubernetes/cloud-provider-aws

Source: cloud-provider-aws-%{gover}.tar.gz
Source1: bundled-cloud-provider-aws-%{gover}.tar.gz
Source1000: clarify.toml

BuildRequires: %{_cross_os}glibc-devel
Requires: %{name}(binaries)

%description
%{summary}.

%package bin
Summary: Amazon ECR credential provider binaries
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(no-fips) and %{name})
Conflicts: (%{_cross_os}image-feature(fips) or %{name}-fips-bin)

%description bin
%{summary}.

%package fips-bin
Summary: Amazon ECR credential provider binaries, FIPS edition
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(fips) and %{name})
Conflicts: (%{_cross_os}image-feature(no-fips) or %{name}-bin)

%description fips-bin
%{summary}.

%prep
%setup -n %{gorepo}-%{gover} -q
%setup -T -D -n %{gorepo}-%{gover} -b 1 -q

%build
%set_cross_go_flags

export GO_VERSION="1.23.3"

go build -ldflags="${GOLDFLAGS}" -o=ecr-credential-provider cmd/ecr-credential-provider/*.go
gofips build -ldflags="${GOLDFLAGS}" -o=fips/ecr-credential-provider cmd/ecr-credential-provider/*.go

%install
install -d %{buildroot}%{_cross_libexecdir}/kubernetes/kubelet/plugins
install -p -m 0755 ecr-credential-provider %{buildroot}%{_cross_libexecdir}/kubernetes/kubelet/plugins

install -d %{buildroot}%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins
install -p -m 0755 fips/ecr-credential-provider %{buildroot}%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins

%cross_scan_attribution --clarify %{S:1000} go-vendor vendor

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_attribution_vendor_dir}

%files bin
%{_cross_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider

%files fips-bin
%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider
1 change: 1 addition & 0 deletions packages/kubernetes-1.32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*-EKS-PATCH-*.patch
21 changes: 21 additions & 0 deletions packages/kubernetes-1.32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
# "." is not allowed in crate names, but we want a friendlier name for the
# directory and spec file, so we override it below.
name = "kubernetes-1_32"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
package-name = "kubernetes-1.32"

[[package.metadata.build-package.external-files]]
url = "https://distro.eks.amazonaws.com/kubernetes-1-31/releases/6/artifacts/kubernetes/v1.31.1/kubernetes-src.tar.gz"
sha512 = "d776cf029babde78af7f88aad7b337f2b73a18617a098d61666f462f6af7f9628e1d99a2abb6d840a8fead38ef2561ec5a41f8087d7c6c4d714f23b78e8b8ca7"

[build-dependencies]
glibc = { path = "../glibc" }
67 changes: 67 additions & 0 deletions packages/kubernetes-1.32/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[clarify."github.com/JeffAshton/win_pdh"]
expression = "BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xb221dcc9 },
]

[clarify."github.com/daviddengcn/go-colortext"]
expression = "BSD-3-Clause AND MIT"
license-files = [
{ path = "LICENSE", hash = 0x9769fae1 },
]

[clarify."github.com/ghodss/yaml"]
expression = "MIT AND BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xcdf3ae00 },
]

[clarify."github.com/heketi/heketi"]
# kubernetes only uses code that is under LGPLv3+/Apache 2.0, not the code that is GPLv2+/LGPLv3+
expression = "LGPL-3.0-or-later OR Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x3c4b96d1 },
{ path = "LICENSE-APACHE2", hash = 0x438c8616 },
{ path = "COPYING-LGPLV3", hash = 0xf0bccb3a },
]
skip-files = [ "COPYING-GPLV2" ]

[clarify."github.com/go-bindata/go-bindata"]
expression = "CC0-1.0"
license-files = [
{ path = "LICENSE", hash = 0x393fafd6 },
]

[clarify."github.com/miekg/dns"]
expression = "BSD-3-Clause"
license-files = [
{ path = "COPYRIGHT", hash = 0xe41dd36c },
{ path = "LICENSE", hash = 0xfc8f12ff },
]

[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x617d80bc },
{ path = "goyaml.v2/LICENSE", hash = 0xe569d630 },
{ path = "goyaml.v2/LICENSE.libyaml", hash = 0xa2e4ce3 },
{ path = "goyaml.v2/NOTICE", hash = 0x49bceeb9 },
{ path = "goyaml.v3/LICENSE", hash = 0x176b1f44 },
{ path = "goyaml.v3/NOTICE", hash = 0x49bceeb9 },
]

[clarify."honnef.co/go/tools"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0xad378ed2 },
{ path = "LICENSE-THIRD-PARTY", hash = 0x546425eb },
{ path = "lint/LICENSE", hash = 0xc6b58232 },
{ path = "ssa/LICENSE", hash = 0xe656fb62 },
]

[clarify."github.com/storageos/go-api"]
expression = "MIT AND BSD-2-Clause"
license-files = [
{ path = "LICENCE", hash = 0x67a6861e },
]
skip-files = ["licence.go", "types/licence.go"]
42 changes: 42 additions & 0 deletions packages/kubernetes-1.32/credential-provider-config-yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[required-extensions]
aws = { version = "v1", optional = true }
kubernetes = "v1"
std = { version = "v1", helpers = ["default"] }
+++
apiVersion: kubelet.config.k8s.io/v1
kind: CredentialProviderConfig
providers:
{{#if settings.kubernetes.credential-providers}}
{{#each settings.kubernetes.credential-providers}}
{{#if this.enabled}}
- name: {{@key}}
matchImages:
{{#each this.image-patterns}}
- "{{this}}"
{{/each}}
defaultCacheDuration: "{{default "12h" this.cache-duration}}"
apiVersion: credentialprovider.kubelet.k8s.io/v1
{{#if (eq @key "ecr-credential-provider")}}
env:
{{else}}
{{#if this.environment}}
env:
{{/if}}
{{/if}}
{{#if this.environment}}
{{#each this.environment}}
- name: {{@key}}
value: '{{this}}'
{{/each}}
{{/if}}
{{#if (eq @key "ecr-credential-provider")}}
- name: HOME
value: '/root'
{{#if @root.settings.aws.profile}}
- name: AWS_PROFILE
value: '{{@root.settings.aws.profile}}'
{{/if}}
{{/if}}
{{/if}}
{{/each}}
{{/if}}
2 changes: 2 additions & 0 deletions packages/kubernetes-1.32/dockershim-symlink.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
ExecStartPre=/bin/ln -sf ./containerd/containerd.sock /run/dockershim.sock
16 changes: 16 additions & 0 deletions packages/kubernetes-1.32/etc-kubernetes-pki-private.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Kubernetes PKI private directory (/etc/kubernetes/pki/private)
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=selinux-policy-files.service
Wants=selinux-policy-files.service

[Mount]
What=tmpfs
Where=/etc/kubernetes/pki/private
Type=tmpfs
Options=nosuid,nodev,noexec,noatime,context=system_u:object_r:secret_t:s0,mode=0700

[Install]
WantedBy=preconfigured.target
25 changes: 25 additions & 0 deletions packages/kubernetes-1.32/kubelet-bootstrap-kubeconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[required-extensions]
kubernetes = "v1"
+++
---
apiVersion: v1
kind: Config
clusters:
- cluster:
{{#if settings.kubernetes.api-server}}
certificate-authority: "/etc/kubernetes/pki/ca.crt"
server: "{{settings.kubernetes.api-server}}"
{{/if}}
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubelet
name: kubelet
current-context: kubelet
users:
- name: kubelet
{{#if settings.kubernetes.bootstrap-token}}
user:
token: "{{settings.kubernetes.bootstrap-token}}"
{{/if}}
Loading

0 comments on commit e8fd3bf

Please sign in to comment.