Skip to content

Commit 8eb1b8f

Browse files
authored
Add k8s support feature set and Add platform label for scheduler usage (#12997) (#13351)
1 parent b443cc8 commit 8eb1b8f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Makefile.work

-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ SONIC_BUILD_INSTRUCTION := make \
344344
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
345345
INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \
346346
KUBERNETES_VERSION=$(KUBERNETES_VERSION) \
347-
KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \
348347
K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \
349348
INCLUDE_KUBERNETES_MASTER=$(INCLUDE_KUBERNETES_MASTER) \
350349
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \

build_debian.sh

-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ then
270270
## Install Kubernetes
271271
echo '[INFO] Install kubernetes'
272272
install_kubernetes ${KUBERNETES_VERSION}
273-
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubernetes-cni=${KUBERNETES_CNI_VERSION}
274273
else
275274
echo '[INFO] Skipping Install kubernetes'
276275
fi

rules/config

+1-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ INCLUDE_MACSEC = y
165165

166166
# INCLUDE_KUBERNETES - if set to y kubernetes packages are installed to be able to
167167
# run as worker node in kubernetes cluster.
168-
INCLUDE_KUBERNETES = n
168+
INCLUDE_KUBERNETES ?= n
169169

170170
KUBE_DOCKER_PROXY = http://172.16.1.1:3128/
171171

@@ -175,7 +175,6 @@ KUBE_DOCKER_PROXY = http://172.16.1.1:3128/
175175
# NOTE: As a worker node it has to run version compatible to kubernetes master.
176176
#
177177
KUBERNETES_VERSION = 1.22.2-00
178-
KUBERNETES_CNI_VERSION = 0.8.7-00
179178
K8s_GCR_IO_PAUSE_VERSION = 3.5
180179

181180
# INCLUDE_KUBERNETES_MASTER - if set to y kubernetes packages are installed o be able

src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
USE_K8S_PROXY: ""
100100
}
101101

102+
ENABLED_FEATURE_SET = {"telemetry", "snmp"}
103+
102104
def log_debug(m):
103105
msg = "{}: {}".format(inspect.stack()[1][3], m)
104106
syslog.syslog(syslog.LOG_DEBUG, msg)
@@ -260,6 +262,8 @@ def run(self):
260262
key, op, fvs = subscriber.pop()
261263
if not key:
262264
continue
265+
if subscriber.getTableName() == FEATURE_TABLE and key not in ENABLED_FEATURE_SET:
266+
continue
263267
log_debug("Received message : '%s'" % str((key, op, fvs)))
264268
for callback in (self.callbacks
265269
[subscriber.getDbConnector().getDbName()]
@@ -280,6 +284,8 @@ def set_node_labels(server):
280284
labels["sonic_version"] = version_info['build_version']
281285
labels["hwsku"] = device_info.get_hwsku() if not UNIT_TESTING else "mock"
282286
labels["deployment_type"] = dep_type
287+
platform = device_info.get_platform()
288+
labels["worker.sonic/platform"] = platform if platform is not None else ""
283289
server.mod_db_entry(STATE_DB_NAME,
284290
KUBE_LABEL_TABLE, KUBE_LABEL_SET_KEY, labels)
285291

0 commit comments

Comments
 (0)