Skip to content

Commit

Permalink
Move dqlite in its own systemd process (canonical#2542)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsakalozos authored Aug 27, 2021
1 parent b399de3 commit 9f7f8e5
Show file tree
Hide file tree
Showing 26 changed files with 249 additions and 613,881 deletions.
7 changes: 1 addition & 6 deletions build-scripts/build-k8s-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ git clone --depth 1 https://github.com/kubernetes/kubernetes $GOPATH/src/github.
make clean
for app in ${path_apps}
do
if [ "$app" = "cmd/kubelite" ]
then
make WHAT="${app}" GOFLAGS=-tags=libsqlite3,dqlite CGO_CFLAGS="-I${SNAPCRAFT_STAGE}/usr/include/" CGO_LDFLAGS="-L${SNAPCRAFT_STAGE}/lib" KUBE_CGO_OVERRIDES=kubelite
else
make WHAT="${app}"
fi
make WHAT="${app}"
done
)
for app in $apps; do
Expand Down
306,580 changes: 0 additions & 306,580 deletions build-scripts/patches/0000-Dqlite-integration.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 77bc6a29c8efcbafc57003e8e89208317b2bec78 Mon Sep 17 00:00:00 2001
From 6583648f325f98bf5aed35b3a90ef9132bead309 Mon Sep 17 00:00:00 2001
From: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
Date: Wed, 3 Mar 2021 18:19:37 +0200
Subject: [PATCH] Kubelite integration
Expand All @@ -19,10 +19,10 @@ Subject: [PATCH] Kubelite integration
create mode 100644 cmd/kubelite/kubelite.go

diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go
index 776389f93e4..ca39da8a4c0 100644
index 8c2d2a94d99..2351c86fa78 100644
--- a/cmd/kube-apiserver/app/server.go
+++ b/cmd/kube-apiserver/app/server.go
@@ -102,7 +102,7 @@ func checkNonZeroInsecurePort(fs *pflag.FlagSet) error {
@@ -91,7 +91,7 @@ func checkNonZeroInsecurePort(fs *pflag.FlagSet) error {
}

// NewAPIServerCommand creates a *cobra.Command object with default parameters
Expand All @@ -31,7 +31,7 @@ index 776389f93e4..ca39da8a4c0 100644
s := options.NewServerRunOptions()
cmd := &cobra.Command{
Use: "kube-apiserver",
@@ -138,8 +138,11 @@ cluster's shared state through which all other components interact.`,
@@ -127,8 +127,11 @@ cluster's shared state through which all other components interact.`,
if errs := completedOptions.Validate(); len(errs) != 0 {
return utilerrors.NewAggregate(errs)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From dd1db952eab13912a55207c81a2ac267909677ac Mon Sep 17 00:00:00 2001
From: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
Date: Tue, 24 Aug 2021 11:17:19 +0300
Subject: [PATCH] Unix socket skip validation in component status

---
pkg/registry/core/rest/storage_core.go | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/pkg/registry/core/rest/storage_core.go b/pkg/registry/core/rest/storage_core.go
index 1f915c32d4b..0bb7f1a9bf9 100644
--- a/pkg/registry/core/rest/storage_core.go
+++ b/pkg/registry/core/rest/storage_core.go
@@ -350,6 +350,12 @@ func (s componentStatusStorage) serversToValidate() map[string]*componentstatus.
klog.Errorf("Failed to parse etcd url for validation: %v", err)
continue
}
+
+ if etcdUrl.Scheme == "unix" {
+ klog.Infof("Socket etcd endpoint detected. Will not validate")
+ continue
+ }
+
var port int
var addr string
if strings.Contains(etcdUrl.Host, ":") {
--
2.25.1

This file was deleted.

306,580 changes: 0 additions & 306,580 deletions build-scripts/pre-patches/0000-Dqlite-integration.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 77bc6a29c8efcbafc57003e8e89208317b2bec78 Mon Sep 17 00:00:00 2001
From 6583648f325f98bf5aed35b3a90ef9132bead309 Mon Sep 17 00:00:00 2001
From: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
Date: Wed, 3 Mar 2021 18:19:37 +0200
Subject: [PATCH] Kubelite integration
Expand All @@ -19,10 +19,10 @@ Subject: [PATCH] Kubelite integration
create mode 100644 cmd/kubelite/kubelite.go

diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go
index 776389f93e4..ca39da8a4c0 100644
index 8c2d2a94d99..2351c86fa78 100644
--- a/cmd/kube-apiserver/app/server.go
+++ b/cmd/kube-apiserver/app/server.go
@@ -102,7 +102,7 @@ func checkNonZeroInsecurePort(fs *pflag.FlagSet) error {
@@ -91,7 +91,7 @@ func checkNonZeroInsecurePort(fs *pflag.FlagSet) error {
}

// NewAPIServerCommand creates a *cobra.Command object with default parameters
Expand All @@ -31,7 +31,7 @@ index 776389f93e4..ca39da8a4c0 100644
s := options.NewServerRunOptions()
cmd := &cobra.Command{
Use: "kube-apiserver",
@@ -138,8 +138,11 @@ cluster's shared state through which all other components interact.`,
@@ -127,8 +127,11 @@ cluster's shared state through which all other components interact.`,
if errs := completedOptions.Validate(); len(errs) != 0 {
return utilerrors.NewAggregate(errs)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From dd1db952eab13912a55207c81a2ac267909677ac Mon Sep 17 00:00:00 2001
From: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
Date: Tue, 24 Aug 2021 11:17:19 +0300
Subject: [PATCH] Unix socket skip validation in component status

---
pkg/registry/core/rest/storage_core.go | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/pkg/registry/core/rest/storage_core.go b/pkg/registry/core/rest/storage_core.go
index 1f915c32d4b..0bb7f1a9bf9 100644
--- a/pkg/registry/core/rest/storage_core.go
+++ b/pkg/registry/core/rest/storage_core.go
@@ -350,6 +350,12 @@ func (s componentStatusStorage) serversToValidate() map[string]*componentstatus.
klog.Errorf("Failed to parse etcd url for validation: %v", err)
continue
}
+
+ if etcdUrl.Scheme == "unix" {
+ klog.Infof("Socket etcd endpoint detected. Will not validate")
+ continue
+ }
+
var port int
var addr string
if strings.Contains(etcdUrl.Host, ":") {
--
2.25.1

Loading

0 comments on commit 9f7f8e5

Please sign in to comment.