1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
Commit graph

60 commits

Author SHA1 Message Date
Carlos Eduardo Arango Gutierrez
a64241440e
Dockerfile: fix FromAs Casing
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-07-02 12:41:24 +02:00
Carlos Eduardo Arango Gutierrez
3434557d7c
Move NFD api to a separate go mod
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-04-05 16:35:47 +02:00
Muyassarov, Feruzjon
06036a62ce Replace gRPC health probe utility with k8s built-in health probe
Kubernetes 1.23 has introduced native health probes for gRPC which
can replace grpc_health_probe utility. This commit removes baking
in grpc_health_probe binary into the image and updates related
health checks to use k8s native gRPC.

Signed-off-by: Muyassarov, Feruzjon <feruzjon.muyassarov@intel.com>
2023-09-20 12:25:36 +03:00
Markus Lehtonen
6149000637 Build statically linked binaries
Switch to fully statically linked binaries and use scratch as a base
image.

Switching to the virtually empty scratch base image means that the
default/minimal NFD image only supports running hooks that are truly
statically linked (e.g.  normal go binaries that are "almost" statically
linked stop working).  The documentation has been already stating this
(i.e. that only statically-linked binaries are supported) - i.e. we have
had no promise of supporting other than that. Also, hooks are now
deprecated and even disabled by default so the possibility of real user
impact should be small.
2023-09-19 21:59:18 +03:00
Markus Lehtonen
9ce215a138 Dockerfile: bump grpc-health-probe to v0.4.19 2023-09-05 11:51:47 +03:00
Markus Lehtonen
ecc242d78a Dockerfile: bump grpc-health-probe to v0.4.18
A new version that was just released.
2023-04-17 14:30:08 +03:00
Markus Lehtonen
af37efec65 Dockerfile: bump grpc-health-probe to v0.4.17
Update to the latest release.
2023-04-11 10:12:18 +03:00
Muyassarov, Feruzjon
ae25d5319b test: move out unit testing from Dockerfile
Move out running unit tests as part of container image building and
instead add it into verify.sh script which runs linter, formatter
and other checks.

Signed-off-by: Muyassarov, Feruzjon <feruzjon.muyassarov@intel.com>
2023-02-02 01:00:32 +02:00
Markus Lehtonen
fe0d706c8b dockerfile: update grpc-health-probe to v0.4.14 2022-12-21 20:28:13 +02:00
Markus Lehtonen
8d56634761 dockerfile: update builder image to golang v1.18
Switch over to the "non-point-release" version of the image. Now we
always use the latest patch version of golang with latest security
fixes, for example, without the need to manually bump the version after
every point release.

This patch also makes the builder image configurable through a Makefile
variable.

For reproducible builds we should used fixed point-release versions in
release-brances.
2022-07-08 10:04:04 +03:00
Markus Lehtonen
269724889c Dockerfile: update builder image to Go v1.18.1 2022-04-14 13:03:02 +03:00
Carlos Eduardo Arango Gutierrez
71c0ab1f45
Update Dockerfile
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-04-12 10:59:30 -04:00
Carlos Eduardo Arango Gutierrez
87b29f695d
Bump Go to 1.18
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2022-03-21 10:25:32 -04:00
Eduard Bartosh
c7bd2d9d8d Fix readiness and liveness checks
Rename grpc-health-probe -> grpc_health_probe as
our deployment yamls and its own documentation
refer to it by this name.

This should fix broken NFD deployments.

Signed-off-by: Eduard Bartosh <eduard.bartosh@intel.com>
2021-12-23 13:28:04 +02:00
Carlos Eduardo Arango Gutierrez
bc88c91109
Dockerfile: build grpc_health-probe from source
Current grpc-health-probe functionality is pulling a binary, hard coded
to amd64, both unsecure and only works for 1 arch, preparing to build
NFD for multiple Arch's require we build the health probe from source,
that way we get rid of the unsecure binary pull, and guarantee a proper
arch build for the grpc-health-probe

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-12-22 09:18:13 -05:00
Markus Lehtonen
9d1eea243b Bump to golang v1.17 2021-10-21 14:16:55 +03:00
Carlos Eduardo Arango Gutierrez
dece85b394
Add livenessProbe via grpc to nfd-master
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-08-18 10:23:10 -05:00
Markus Lehtonen
8117c099a3 deployment: add kustomize base
Implement functionality virtually replicating deployment templates for
nfd-master and nfd-worker daemonset (nfd-master.yaml.template and
nfd-worker-daemonset.yaml.template) by adding a kustomize overlay named
"default".

We split the resources into multiple bases (rbac, master and
worker-daemonset) so that relevant parts are re-usable in
other deployment scenarios added later (e.g. "one-shot job", and
"combined daemonset").

This patch adds one component (components/common) doing the required
kustomization for the example deployment.
2021-08-18 14:05:57 +03:00
Markus Lehtonen
035d528a17 Dockerfile: update go to 1.16.7 2021-08-12 10:37:44 +03:00
rmr-silicom
a896ff3011
Add support for configurable runtime full and minimal images. (#513)
* Add support for configurable runtime full and minimal images.

* Fixups and renamings.

* Change variables *_IMG_* to *_IMAGE_*

* Fix args in Dockerfile also.
2021-04-20 00:42:33 -07:00
Carlos Eduardo Arango Gutierrez
11c21a1277
bump to go 1.16
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-03-24 10:00:36 -05:00
Markus Lehtonen
8fb58a178a Dockerfile: add minimal image
Build a "minimal" variant of the nfd image based on
gcr.io/distroless/base. The motivations behind the minimal image are
image hardening (security) and reducing the image footprint (from ca.
108MB down to about 40MB).

The practical effect of deploying the minimal image is that no runtimes
for running worker hooks are present, not even a shell. This means that
only statically linked linked hook binaries are supported. Also, because
of the image hardening live debugging of the minimal image by attaching
to the container is not possible, and, the "full" image needs to be used
for that purpose.
2021-03-10 11:09:13 +02:00
Dave Baker
fc3a96928e Container base image version bump:
- update to golang 1.15.5 (was 1.15.4)
- Be more explicit about using the -buster variant for build image
- Update runtime image from -stretch to -buster to pick up security fixes
2020-11-20 16:39:18 -05:00
Carlos Eduardo Arango Gutierrez
c4515b94ab
Go 1.15
this patch bumps both the Dockerfile and go.mod go version to 1.15

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-11-18 09:38:13 -05:00
Carlos Eduardo Arango Gutierrez
b852e5cce5
Update go to 1.14.7
Bumb golang version to 1.14.7

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-08-28 08:39:23 -05:00
Markus Lehtonen
1f873f0dfc Dockerfile: rename version ARG
Use the same naming across Makefile and Dockerfile.
2020-08-21 14:27:39 +03:00
Markus Lehtonen
342c1dfbc6 Dockerfile: use make for building
Modify Makefile to have separate hostmount prefix settings for local and
container builds in order to preserve the current behavior.
2020-08-21 14:27:39 +03:00
Kubernetes Prow Robot
a68a4ec4fb
Merge pull request #325 from marquiz/devel/hardening
Container image hardening
2020-08-21 02:51:39 -07:00
Alexander Kanevskiy
eb8fe6393a Update builder image to Go 1.13.12
Go versions after 1.13.7 contain fix for CVE-2020-7919
2020-07-10 14:24:01 +03:00
Markus Lehtonen
855bf34190 Dockerfile: run as non-root 2020-05-28 15:10:03 +03:00
Markus Lehtonen
704c81a4d2 Make host mount prefix configurable in Makefile and Dockerfile
Introduce a new makefile variable and dockerfile build arg named
HOSTMOUNT_PREFIX for changing the prefix used for mounting host
directories inside the container. Adds a sed rule in Makefile to
generate deployment yamls accordingly.
2020-05-20 22:15:41 +03:00
Markus Lehtonen
248859c64d source: parametrise host directory paths
Specify and handle system paths we use for discovery in a unified way.
2020-05-20 22:15:41 +03:00
Carlos Eduardo Arango Gutierrez
3e1e1a944b
Update go version to 1.13.5
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-05 16:15:44 -05:00
Markus Lehtonen
f4d55ce040 Dockerfile: store build deps in a separate layer
Speeds up local builds considerably as the deps are cached (instead of
downloading them all on every build) - as long as go.mod and go.sum are
not changed.
2019-11-20 18:38:48 +02:00
Markus Lehtonen
67ddd87c41 Switch to using go modules
Update go version in Docker build image to v1.12.
2019-11-20 18:38:42 +02:00
Markus Lehtonen
6563da29ab Dockerfile: verbose dep ensure
Better see what is happening inside the build.
2019-05-10 15:50:53 +03:00
Markus Lehtonen
0a22564b9f Dockerfile: set verbosity of gRPC
Makes solving issues easier when gRPC prints out information e.g. about
TLS authentication problems on the server (nfd-master) side, too.
2019-04-04 22:40:24 +03:00
Markus Lehtonen
f8bc07952f Fix unit tests after master-worker split
Refactor old tests and add tests for new functions. Add 'test' target in
Makefile.
2019-04-04 22:40:24 +03:00
Markus Lehtonen
39be798472 Split NFD into client and server
Refactor NFD into a simple server-client system. Labeling is now done by
a separate 'nfd-master' server. It is a simple service with small
codebase, designed for easy isolation. The feature discovery part is
implemented in a 'nfd-worker' client which sends labeling requests to
nfd-server, thus, requiring no access/permissions to the Kubernetes API
itself.

Client-server communication is implemented by using gRPC. The protocol
currently consists of only one request, i.e. the labeling request.

The spec templates are converted to the new scheme. The nfd-master
server can be deployed using the nfd-master.yaml.template which now also
contains the necessary RBAC configuration. NFD workers can be deployed
by using the nfd-worker-daemonset.yaml.template or
nfd-worker-job.yaml.template (most easily used with the label-nodes.sh
script).

Only nfd-worker currently support config file or options. The (default)
NFD config file is renamed to nfd-worker.conf.
2019-04-04 22:40:24 +03:00
Markus Lehtonen
c1377589b3 Move version information into a separate module 2019-04-04 22:40:24 +03:00
Markus Lehtonen
2bf4d6f1f4 Migrate from glide to dep
Glide is not actively developed anymore, and, its documentation
recommends migrating to dep. Also, dep is widely used in other k8s
projects.

Migrating to dep dramatically reduces the size of the populated vendor/
directory from 75MB down to about 20MB.
2019-04-04 22:40:24 +03:00
Markus Lehtonen
e866b6ee1c Implement RDT detection in go
Get rid of the dependency on intel-cmt-cat library and rdt helper
binaries written in C. Significantly simplifies the build procedure.

Implements minimal support (in assembler) for getting the raw data from
the CPUID instruction. Also, implement a stub so that the code works on
other architectures than amd64, too.
2019-02-22 22:23:13 +02:00
Markus Lehtonen
47a97db35a Import from sigs.k8s.io/node-feature-discovery 2018-12-04 15:15:46 +02:00
Markus Lehtonen
917151728a Add config file support
Support yaml/json based config file for nfd. This commit does not add
any actual consumers for the config file, yet.

By default, nfd tries to read
/etc/kubernetes/node-feature-discovery/node-feature-discovery.conf.
This can be changed by specifying the --config command line flag.
2018-10-10 10:24:34 +03:00
Markus Lehtonen
f00f231c60 Use Debian strecth-slim as a base for the producion Docker image
To cut the image size further, down to about 75MB. We use Debian
strecth-slim as the base for the production image as golang docker
images use stretch as their base.
2018-09-24 10:15:23 +03:00
Markus Lehtonen
bff94eb107 Utilize multi-stage build to reduce docker image size
This reduces the size of the Docker image from ca. 1.2GB down to about
750MB.

Also, move unit tests from .travis.yml to Dockerfile. Final production
image is not able to run unit tests anymore, as sources are missing from
there.
2018-09-24 10:15:23 +03:00
Olev Kartau
4f4b0867b9 rdt-discovery, Dockerfile: update links to intel-cmt-cat
intel-cmt-cat repo is located in github/intel/ now,
update links accordingly, correcting also some
source file names pointed from files under rdt-discovery/.
Updated also ref. to intel-cmt-cat in Dockerfile.
No functional changes.
2018-07-03 08:19:54 +03:00
Markus Lehtonen
0440c8eabc Use a specific released version of intel-cmt-cat
This makes the build more deterministic. Previously, nfd just blindly
took the tip revision from intel-cmt-cat master branch which could brake
the build without any changes in nfd itself.
2018-04-10 11:04:14 +03:00
Markus Lehtonen
348f3a7f89 Remove hardcoding of nfd source path (#94)
* Make rdt-discovery buildable outside hardcoded path

Do not assume that nfd sources always reside under hardcoded directory
"/go/src/github.com/kubernetes-incubator/node-feature-discovery/". This
makes it possible e.g. to build nfd locally outside the Docker
container.

* Do not hardcode the path for RDT helper binaries

Utilize the standard PATH env variable, instead.
2018-03-16 09:56:35 -07:00
Bin Lu
4fc45c95d1 enable nfd framework on Arm64 platform
currently, nfd framework can't be work on Arm64 platform.
   Fix points:
   1, removed rdt on Arm64 platform
   2, optimized the code related to multi-arch

Change-Id: If605041f6d2243ae2afb3248edbf102083c6dcb4
Signed-off-by: Bin Lu <bin.lu@arm.com>
Jira: ENTOS-432
2018-01-10 00:46:37 -05:00