Skip to content

Commit

Permalink
Merge pull request #3859 from ginglis13/k8s-1.30
Browse files Browse the repository at this point in the history
add k8s-1.30 package and variants boilerplate
  • Loading branch information
ginglis13 authored Mar 29, 2024
2 parents 49b1981 + c55b10c commit 4527bb6
Show file tree
Hide file tree
Showing 98 changed files with 1,075 additions and 36 deletions.
25 changes: 25 additions & 0 deletions packages/ecr-credential-provider-1.30/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[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_30"
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.30"
releases-url = "https://github.com/kubernetes/cloud-provider-aws/releases"

[[package.metadata.build-package.external-files]]
# TODO: update to 1.30 release once available
url = "https://codeload.github.com/kubernetes/cloud-provider-aws/tar.gz/v1.29.0"
path = "cloud-provider-aws-1.29.0.tar.gz"
sha512 = "30b08ca55d182de4b2289f58acf0af4476cbeff74ea2668d7e9d4c53e2fdbb38016d7cf434a55bba895230255a699233d4484333b5b516c16acb0515df514876"
bundle-modules = [ "go" ]

[build-dependencies]
glibc = { path = "../glibc" }
5 changes: 5 additions & 0 deletions packages/ecr-credential-provider-1.30/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xcdf3ae00 },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%global goproject github.com/kubernetes
%global gorepo cloud-provider-aws
%global goimport %{goproject}/%{gorepo}

%global gover 1.29.0
# %%global gover 1.30.0
%global rpmver %{gover}

%global _dwz_low_mem_die_limit 0

Name: %{_cross_os}ecr-credential-provider-1.30
Version: %{rpmver}
Release: 1%{?dist}
Summary: Container image registry credential provider for AWS ECR
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

%description
%{summary}.

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

%build
%set_cross_go_flags

go build -buildmode=pie -ldflags="${GOLDFLAGS}" -o=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/ecr-credential-provider

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

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_attribution_vendor_dir}
%{_cross_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider
33 changes: 33 additions & 0 deletions packages/kubernetes-1.30/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[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_30"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

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

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

[[package.metadata.build-package.external-files]]
# TODO: update this URL to 1.30 release once available.
url = "https://distro.eks.amazonaws.com/kubernetes-1-29/releases/7/artifacts/kubernetes/v1.29.1/kubernetes-src.tar.gz"
sha512 = "9940027197f83702516775047664d3c30a83e69202dcca5aa89f320e78c27a930eb1373777277f240b3c5a63c351ccab3199c577424e760fe122692065895e2f"

# RPM BuildRequires
[build-dependencies]
glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
aws-signing-helper = { path = "../aws-signing-helper" }
ecr-credential-provider-1_29 = { path = "../ecr-credential-provider-1.29" }
# `conntrack-tools`, `containerd` and `findutils` are only needed at runtime,
# and are pulled in by `release`.
# conntrack-tools = { path = "../conntrack-tools" }
# containerd = { path = "../containerd" }
# findutils = { path = "../findutils" }
62 changes: 62 additions & 0 deletions packages/kubernetes-1.30/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[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"
license-files = [
{ path = "LICENSE", hash = 0xcdf3ae00 },
]

[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"]
38 changes: 38 additions & 0 deletions packages/kubernetes-1.30/credential-provider-config-yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[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 (or (eq @key "ecr-credential-provider") this.environment)}}
env:
{{#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}}
{{/if}}
{{/each}}
{{/if}}
2 changes: 2 additions & 0 deletions packages/kubernetes-1.30/dockershim-symlink.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
ExecStartPre=/bin/ln -sf /run/containerd/containerd.sock /run/dockershim.sock
16 changes: 16 additions & 0 deletions packages/kubernetes-1.30/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.30/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 4527bb6

Please sign in to comment.