Skip to content

Commit

Permalink
alvistack/v1.29.5
Browse files Browse the repository at this point in the history
    git clean -xdf
    go mod download
    go mod vendor
    git checkout HEAD -- vendor
    tar zcvf ../kubernetes_1.29.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp kubernetes.spec ../kubernetes_1.29.5-1.spec
    cp ../kubernetes*1.29.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/kubernetes-kubernetes-1.29.5/
    rm -rf ../kubernetes*1.29.5*.*

See kubernetes#124933
See kubernetes#124908

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Jul 3, 2024
1 parent 59755ff commit b9406b2
Show file tree
Hide file tree
Showing 24 changed files with 360 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.9
1.22.5
8 changes: 8 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.substvars
*debhelper*
.debhelper
files
kubernetes-kubeadm
kubernetes-kubectl
kubernetes-kubelet
tmp
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kubernetes (100:1.29.5-1) UNRELEASED; urgency=medium

* https://github.com/kubernetes/kubernetes/releases/tag/v1.29.5

-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Wed, 15 May 2024 08:56:26 +0800
45 changes: 45 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Source: kubernetes
Section: misc
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Homepage: https://github.com/kubernetes/kubernetes/tags
Vcs-Browser: https://github.com/alvistack/kubernetes-kubernetes
Vcs-Git: https://github.com/alvistack/kubernetes-kubernetes.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
golang-1.22,
rsync,

Package: kubernetes-kubectl
Architecture: amd64
Description: Kubernetes Command Line Tool
The Kubernetes command line tool for interacting with the Kubernetes API.
Depends:
${shlibs:Depends},
${misc:Depends},

Package: kubernetes-kubelet
Architecture: amd64
Description: Kubernetes Node Agent
The node agent of Kubernetes, the container cluster manager.
Depends:
${shlibs:Depends},
${misc:Depends},
conntrack,
containernetworking-plugins,
ebtables,
ethtool,
iproute2,
iptables (>= 1.4.21),
socat,
util-linux (>= 2.23.1),

Package: kubernetes-kubeadm
Architecture: amd64
Description: Kubernetes Cluster Bootstrapping Tool
The Kubernetes command line tool for bootstrapping a Kubernetes cluster.
Depends:
${shlibs:Depends},
${misc:Depends},
21 changes: 21 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Files: debian/*
Copyright: 2024 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
License: Apache-2.0

License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
The complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
1 change: 1 addition & 0 deletions debian/kubernetes-kubeadm.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/systemd/system/kubelet.service.d
3 changes: 3 additions & 0 deletions debian/kubernetes-kubeadm.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib/systemd/system/kubelet.service.d/10-kubeadm.conf
usr/bin/kubeadm
usr/share/bash-completion/completions/kubeadm
5 changes: 5 additions & 0 deletions debian/kubernetes-kubeadm.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kubernetes-kubeadm: copyright-without-copyright-notice
kubernetes-kubeadm: initial-upload-closes-no-bugs
kubernetes-kubeadm: no-manual-page
kubernetes-kubeadm: statically-linked-binary
kubernetes-kubeadm: zero-byte-file-in-doc-directory
2 changes: 2 additions & 0 deletions debian/kubernetes-kubectl.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin/kubectl
usr/share/bash-completion/completions/kubectl
5 changes: 5 additions & 0 deletions debian/kubernetes-kubectl.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kubernetes-kubectl: copyright-without-copyright-notice
kubernetes-kubectl: initial-upload-closes-no-bugs
kubernetes-kubectl: no-manual-page
kubernetes-kubectl: statically-linked-binary
kubernetes-kubectl: zero-byte-file-in-doc-directory
2 changes: 2 additions & 0 deletions debian/kubernetes-kubelet.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
etc/kubernetes
etc/kubernetes/manifests
2 changes: 2 additions & 0 deletions debian/kubernetes-kubelet.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/systemd/system/kubelet.service
usr/bin/kubelet
5 changes: 5 additions & 0 deletions debian/kubernetes-kubelet.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kubernetes-kubelet: copyright-without-copyright-notice
kubernetes-kubelet: hardening-no-pie
kubernetes-kubelet: initial-upload-closes-no-bugs
kubernetes-kubelet: no-manual-page
kubernetes-kubelet: zero-byte-file-in-doc-directory
33 changes: 33 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/make -f

SHELL := /bin/bash

override_dh_auto_build:
set -ex && \
export KUBE_GIT_TREE_STATE="clean" && \
export KUBE_GIT_COMMIT="a2068b2a6eb2ada695a2455bf2f18afead572989" && \
export KUBE_GIT_VERSION="v1.29.5" && \
make WHAT="cmd/kubelet" && \
make WHAT="cmd/kubeadm" && \
make WHAT="cmd/kubectl"

override_dh_auto_install:
install -Dpm755 -d debian/tmp/etc/kubernetes/manifests
install -Dpm755 -d debian/tmp/usr/bin
install -Dpm755 -d debian/tmp/usr/share/bash-completion/completions
install -Dpm755 -d debian/tmp/lib/systemd/system
install -Dpm755 -d debian/tmp/lib/systemd/system/kubelet.service.d
install -Dpm755 -t debian/tmp/usr/bin _output/local/go/bin/kubeadm
install -Dpm755 -t debian/tmp/usr/bin _output/local/go/bin/kubectl
install -Dpm755 -t debian/tmp/usr/bin _output/local/go/bin/kubelet
install -Dpm644 -t debian/tmp/lib/systemd/system lib/systemd/system/kubelet.service
install -Dpm644 -t debian/tmp/lib/systemd/system/kubelet.service.d lib/systemd/system/kubelet.service.d/10-kubeadm.conf
./_output/local/go/bin/kubectl completion bash > debian/tmp/usr/share/bash-completion/completions/kubectl
./_output/local/go/bin/kubeadm completion bash > debian/tmp/usr/share/bash-completion/completions/kubeadm

override_dh_auto_test:

override_dh_auto_clean:

%:
dh $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
2 changes: 2 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kubernetes source: file-without-copyright-information
kubernetes source: no-debian-changes
108 changes: 108 additions & 0 deletions kubernetes.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Copyright 2024 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

%global debug_package %{nil}

%global source_date_epoch_from_changelog 0

Name: kubernetes
Epoch: 100
Version: 1.29.5
Release: 1%{?dist}
Summary: Container Scheduling and Management
License: Apache-2.0
URL: https://github.com/kubernetes/kubernetes/tags
Source0: %{name}_%{version}.orig.tar.gz
BuildRequires: golang-1.22
BuildRequires: glibc-static
BuildRequires: rsync

%description
Kubernetes is a system for automating deployment, scaling, and
management of containerized applications. It groups containers that make
up an application into logical units for management and discovery.

%package kubectl
Summary: Kubernetes Command Line Tool

%description kubectl
The Kubernetes command line tool for interacting with the Kubernetes API.

%package kubelet
Summary: Kubernetes Node Agent
Requires: conntrack-tools
Requires: containernetworking-plugins
Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables >= 1.4.21
Requires: socat
Requires: util-linux >= 2.23.1

%description kubelet
The node agent of Kubernetes, the container cluster manager.

%package kubeadm
Summary: Kubernetes Cluster Bootstrapping Tool

%description kubeadm
The Kubernetes command line tool for bootstrapping a Kubernetes cluster.

%prep
%autosetup -T -c -n %{name}_%{version}-%{release}
tar -zx -f %{S:0} --strip-components=1 -C .

%build
set -ex && \
export KUBE_GIT_TREE_STATE="clean" && \
export KUBE_GIT_COMMIT="a2068b2a6eb2ada695a2455bf2f18afead572989" && \
export KUBE_GIT_VERSION="v1.29.5" && \
make WHAT="cmd/kubelet" && \
make WHAT="cmd/kubeadm" && \
make WHAT="cmd/kubectl"

%install
install -Dpm755 -d %{buildroot}%{_sysconfdir}/kubernetes/manifests
install -Dpm755 -d %{buildroot}%{_bindir}
install -Dpm755 -d %{buildroot}%{_unitdir}
install -Dpm755 -d %{buildroot}%{_unitdir}/kubelet.service.d
install -Dpm755 -d %{buildroot}%{_prefix}/share/bash-completion/completions
install -Dpm755 -t %{buildroot}%{_bindir}/ _output/local/go/bin/kubeadm
install -Dpm755 -t %{buildroot}%{_bindir}/ _output/local/go/bin/kubectl
install -Dpm755 -t %{buildroot}%{_bindir}/ _output/local/go/bin/kubelet
install -Dpm644 -t %{buildroot}%{_unitdir}/ lib/systemd/system/kubelet.service
install -Dpm644 -t %{buildroot}%{_unitdir}/kubelet.service.d/ lib/systemd/system/kubelet.service.d/10-kubeadm.conf
./_output/local/go/bin/kubectl completion bash > %{buildroot}%{_prefix}/share/bash-completion/completions/kubectl
./_output/local/go/bin/kubeadm completion bash > %{buildroot}%{_prefix}/share/bash-completion/completions/kubeadm

%files kubectl
%license LICENSE
%{_bindir}/kubectl
%{_prefix}/share/bash-completion/completions/kubectl

%files kubelet
%license LICENSE
%dir %{_sysconfdir}/kubernetes
%dir %{_sysconfdir}/kubernetes/manifests
%{_bindir}/kubelet
%{_unitdir}/kubelet.service

%files kubeadm
%license LICENSE
%dir %{_unitdir}/kubelet.service.d
%{_bindir}/kubeadm
%{_unitdir}/kubelet.service.d/10-kubeadm.conf
%{_prefix}/share/bash-completion/completions/kubeadm

%changelog
14 changes: 14 additions & 0 deletions lib/systemd/system/kubelet.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=https://kubernetes.io/docs/home/
After=network-online.target local-fs.target remote-fs.target time-sync.target
Wants=network-online.target local-fs.target remote-fs.target time-sync.target

[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions lib/systemd/system/kubelet.service.d/10-kubeadm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
3 changes: 3 additions & 0 deletions pkg/printers/internalversion/printers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,9 @@ func (list SortableResourceNames) Less(i, j int) bool {
}

func isRestartableInitContainer(initContainer *api.Container) bool {
if initContainer == nil {
return false
}
if initContainer.RestartPolicy == nil {
return false
}
Expand Down
28 changes: 28 additions & 0 deletions pkg/printers/internalversion/printers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"

apiv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -49,6 +50,7 @@ import (
"k8s.io/kubernetes/pkg/apis/storage"
"k8s.io/kubernetes/pkg/printers"
utilpointer "k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

var containerRestartPolicyAlways = api.ContainerRestartPolicyAlways
Expand Down Expand Up @@ -1717,6 +1719,32 @@ func TestPrintPodWithRestartableInitContainer(t *testing.T) {
},
},
},
{
// Test pod has container statuses for non-existent initContainers and containers
api.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "test4"},
Spec: api.PodSpec{
InitContainers: []api.Container{
{Name: "init1", Image: "initimage"},
{Name: "sidecar1", Image: "sidecarimage", RestartPolicy: ptr.To(api.ContainerRestartPolicyAlways)},
},
Containers: []api.Container{{Name: "container1", Image: "containerimage"}},
},
Status: api.PodStatus{
Phase: "Running",
InitContainerStatuses: []api.ContainerStatus{
{Name: "initinvalid"},
{Name: "init1"},
{Name: "sidecar1"},
},
ContainerStatuses: []api.ContainerStatus{
{Name: "containerinvalid"},
{Name: "container1"},
},
},
},
[]metav1.TableRow{{Cells: []interface{}{"test4", "0/2", "Init:0/2", "0", "<unknown>"}}},
},
}

for i, test := range tests {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/schedule_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.F
// always try to update the sched.nextStartNodeIndex regardless of whether an error has occurred
// this is helpful to make sure that all the nodes have a chance to be searched
processedNodes := len(feasibleNodes) + len(diagnosis.NodeToStatusMap)
sched.nextStartNodeIndex = (sched.nextStartNodeIndex + processedNodes) % len(nodes)
sched.nextStartNodeIndex = (sched.nextStartNodeIndex + processedNodes) % len(allNodes)
if err != nil {
return nil, diagnosis, err
}
Expand Down
27 changes: 27 additions & 0 deletions pkg/scheduler/schedule_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,33 @@ func TestFindFitPredicateCallCounts(t *testing.T) {
pod: st.MakePod().Name("1").UID("1").Priority(lowPriority).Obj(),
expectedCount: 2,
},
{
name: "test prefilter plugin returned an invalid node",
registerPlugins: []tf.RegisterPluginFunc{
tf.RegisterQueueSortPlugin(queuesort.Name, queuesort.New),
tf.RegisterPreFilterPlugin(
"FakePreFilter",
tf.NewFakePreFilterPlugin("FakePreFilter", &framework.PreFilterResult{
NodeNames: sets.New("invalid-node"),
}, nil),
),
tf.RegisterFilterPlugin("TrueFilter", tf.NewTrueFilterPlugin),
tf.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New),
},
nodes: []string{"1", "2"},
pod: st.MakePod().Name("test-prefilter").UID("test-prefilter").Obj(),
wantNodes: nil,
wErr: &framework.FitError{
Pod: st.MakePod().Name("test-prefilter").UID("test-prefilter").Obj(),
NumAllNodes: 2,
Diagnosis: framework.Diagnosis{
NodeToStatusMap: framework.NodeToStatusMap{
"1": framework.NewStatus(framework.UnschedulableAndUnresolvable, "node is filtered out by the prefilter result"),
"2": framework.NewStatus(framework.UnschedulableAndUnresolvable, "node is filtered out by the prefilter result"),
},
},
},
},
}

for _, test := range tests {
Expand Down
Loading

0 comments on commit b9406b2

Please sign in to comment.