Skip to content
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

Add kubernetes-1.28 package and variants #3329

Merged
merged 6 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ The following variants support EKS, as described above:
* `aws-k8s-1.25`
* `aws-k8s-1.26`
* `aws-k8s-1.27`
* `aws-k8s-1.28`
* `aws-k8s-1.23-nvidia`
* `aws-k8s-1.24-nvidia`
* `aws-k8s-1.25-nvidia`
* `aws-k8s-1.26-nvidia`
* `aws-k8s-1.27-nvidia`
* `aws-k8s-1.28-nvidia`

The following variants support ECS:

Expand All @@ -84,6 +86,7 @@ We also have variants that are designed to be Kubernetes worker nodes in VMware:
* `vmware-k8s-1.25`
* `vmware-k8s-1.26`
* `vmware-k8s-1.27`
* `vmware-k8s-1.28`

The following variants are designed to be Kubernetes worker nodes on bare metal:

Expand All @@ -92,6 +95,7 @@ The following variants are designed to be Kubernetes worker nodes on bare metal:
* `metal-k8s-1.25`
* `metal-k8s-1.26`
* `metal-k8s-1.27`
* `metal-k8s-1.28`

The following variants are no longer supported:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
From cce3f6ffa796ea416021b0d62567a3f52b979567 Mon Sep 17 00:00:00 2001
From: Jordan Liggitt <[email protected]>
Date: Wed, 16 Aug 2023 09:33:02 -0400
Subject: [PATCH] Make gomaxprocs install optional, limit to tests

---
hack/lib/golang.sh | 25 +++++++++++++++----------
hack/make-rules/test-e2e-node.sh | 1 +
hack/make-rules/test.sh | 1 +
3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh
index 66772f08a81..983ff368e25 100755
--- a/hack/lib/golang.sh
+++ b/hack/lib/golang.sh
@@ -556,20 +556,25 @@ kube::golang::setup_env() {

# This seems to matter to some tools
export GO15VENDOREXPERIMENT=1
+}

+kube::golang::setup_gomaxprocs() {
# GOMAXPROCS by default does not reflect the number of cpu(s) available
# when running in a container, please see https://github.com/golang/go/issues/33803
- if ! command -v ncpu >/dev/null 2>&1; then
- # shellcheck disable=SC2164
- pushd "${KUBE_ROOT}/hack/tools" >/dev/null
- GO111MODULE=on go install ./ncpu
- # shellcheck disable=SC2164
- popd >/dev/null
+ if [[ -z "${GOMAXPROCS:-}" ]]; then
+ if ! command -v ncpu >/dev/null 2>&1; then
+ # shellcheck disable=SC2164
+ pushd "${KUBE_ROOT}/hack/tools" >/dev/null
+ GO111MODULE=on go install ./ncpu || echo "Will not automatically set GOMAXPROCS"
+ # shellcheck disable=SC2164
+ popd >/dev/null
+ fi
+ if command -v ncpu >/dev/null 2>&1; then
+ GOMAXPROCS=$(ncpu)
+ export GOMAXPROCS
+ kube::log::status "Set GOMAXPROCS automatically to ${GOMAXPROCS}"
+ fi
fi
-
- GOMAXPROCS=${GOMAXPROCS:-$(ncpu)}
- export GOMAXPROCS
- kube::log::status "Setting GOMAXPROCS: ${GOMAXPROCS}"
}

# This will take binaries from $GOPATH/bin and copy them to the appropriate
diff --git a/hack/make-rules/test-e2e-node.sh b/hack/make-rules/test-e2e-node.sh
index 43dde0c740f..49e3e04ac71 100755
--- a/hack/make-rules/test-e2e-node.sh
+++ b/hack/make-rules/test-e2e-node.sh
@@ -18,6 +18,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
+kube::golang::setup_gomaxprocs

# start the cache mutation detector by default so that cache mutators will be found
KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-true}"
diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh
index e9074678a8f..4aa72730d83 100755
--- a/hack/make-rules/test.sh
+++ b/hack/make-rules/test.sh
@@ -22,6 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
+kube::golang::setup_gomaxprocs

# start the cache mutation detector by default so that cache mutators will be found
KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-true}"
--
2.25.1

32 changes: 32 additions & 0 deletions packages/kubernetes-1.28/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[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_28"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

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

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

[[package.metadata.build-package.external-files]]
url = "https://distro.eks.amazonaws.com/kubernetes-1-28/releases/2/artifacts/kubernetes/v1.28.0/kubernetes-src.tar.gz"
sha512 = "2ac33a02a614c59f8c347a82daad9cfe4332599c25e3e220fb66055ff156cfdcbf1079489a272c685893ffbe25bcc6cbbcde9327357604924c575fd83fabe1b6"

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

# RPM Requires
[dependencies]
aws-signing-helper = { path = "../aws-signing-helper" }
ecr-credential-provider-1_27 = { path = "../ecr-credential-provider-1.27" }
stmcginnis marked this conversation as resolved.
Show resolved Hide resolved
# `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.28/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"]
33 changes: 33 additions & 0 deletions packages/kubernetes-1.28/credential-provider-config-yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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.28/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
stmcginnis marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 16 additions & 0 deletions packages/kubernetes-1.28/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
22 changes: 22 additions & 0 deletions packages/kubernetes-1.28/kubelet-bootstrap-kubeconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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
Loading