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

104 commits

Author SHA1 Message Date
Markus Lehtonen
63c1256d08 Drop deployment templates
Resort to kustomize, instead. Update docs and scripts, accordingly.

Bump cert-manager version in the deployment instructions to v1.5.1.
2021-08-18 15:10:25 +03: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
0f2554abf1 helm: move files under deployment/helm 2021-08-16 14:44:26 +03:00
Kubernetes Prow Robot
47b1bd8e11
Merge pull request #549 from marquiz/devel/lint
Makefile: add lint target
2021-08-04 10:01:24 -07:00
Markus Lehtonen
d12e62b1fe Makefile: add apigen target
For auto-generating api(s).

Also, re-generate/refresh the gRPC with `make apigen` (with protoc
v3.17.3 and protoc-gen-go from github.com/golang/protobuf v1.5.2) to
sync up things.
2021-07-07 16:01:10 +03:00
Markus Lehtonen
feecee2c3d Makefile: add lint target
Shortcut for running golint.
2021-07-07 10:10:47 +03:00
Markus Lehtonen
34050596d7 test/e2e: adapt e2e tests to kubernetes v1.21.2
Mimic SIGDescribe() from upstream k8s e2e tests.
2021-07-06 14:40:29 +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
Mikko Ylinen
ee261b8288 Document cert-manager usage
cert-manager can be used to automate TLS certificate management for
nfd-master and the nfd-worker pod(s).

Add a template to deploy cert-manager CA Issuer and Certificates and
document steps how to use them.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-03-12 09:39:30 +02:00
Markus Lehtonen
1f8d7be6f0 Makefile: run e2e-tests for both variants of the image
Test both the full and minimal image. This might be paranoid but better
be sure(r) than sorry. The end-to-end tests are not that expensive.
2021-03-10 11:10:08 +02:00
Markus Lehtonen
c5dca79a07 Makefile: change poll-image target to poll-images
Poll all images that are supposed to be tagged. Both the "full" and
"minimal" variant, including tags created from IMAGE_EXTRA_TAG_NAMES.
2021-03-10 11:10:08 +02: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
Markus Lehtonen
9457cfba42 Makefile: increase golangci-lint timeout to 7min
Formerly used 5 minutes caused timeout in Prow.
2021-03-02 20:08:58 +02:00
Markus Lehtonen
34cc407dd9 scripts/test-infra: enable helm linting 2021-02-26 07:24:59 +02:00
Markus Lehtonen
7e6f740c9f test/e2e: make openshift bits optional
Only enabled if OPENSHIFT is specified in the environment when running
make e2e-test, for example:

  $ OPENSHIFT=y make e2e-test
2021-02-25 17:54:07 +02:00
Markus Lehtonen
bc289d0783 docs: enable markdown linting 2021-02-25 15:13:40 +02:00
Adrian Chiris
e80900b8ee Add helm chart for NFD
This commit adds Helm chart for node-feature-discovery

Signed-off-by: Adrian Chiris <adrianc@nvidia.com>
Signed-off-by: Ivan Kolodiazhnyi <ikolodiazhny@nvidia.com>
2021-02-18 17:19:09 +02:00
Markus Lehtonen
569e0f2017 Change the worker conf update mechanism of templates
Rely on markers instead which makes the update work also in the middle
of a template file. Previously it relied on the configuration data to be
at the very end of the file to be updated.
2021-02-04 18:56:55 +02:00
Carlos Eduardo Arango Gutierrez
30e64468de
Makefile: require KUBECONFIG to be specified for e2e-test target
This Patch adds a check on make target e2e-test, to check if the
KUBECONFIG env var is set before running the test suite.

if not pressent return a valid error message.

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-11-24 16:50:55 -05:00
Markus Lehtonen
979d3b88fe Add nfd-worker-conf ConfigMap to deployment templates
Add a virtually empty ConfigMap that is mounted inside the workers.
Makes it easier to start customizing the worker deployment e.g. with just:

  $ kubectl -n ${NFD_NS} edit configmap nfd-worker-conf

Create a new 'templates' make target for inserting the content of
nfd-worker.conf.example into the configmap spec of the templates. Thus,
'make templates' should be run whenever the example config is update.
Update the verify.sh prow script to check that the templates are up to
date.

This patch also streamlines the documentation about configuration
management, reflecting the changes.
2020-11-23 18:49:52 +02:00
Artyom Lukianov
a8c0b4a0d0 Focus only on NFD tests during the e2e tests run
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2020-11-18 13:09:13 +02:00
Markus Lehtonen
7b8e85c4ea docs: fixup site baseurl setting
Change build configuration related to site baseurl and Jekyll output
directory a bit. Making it more coherent e.g. by removing the need to
override baseurl for 'site-serve' makefile target.
2020-11-02 13:51:09 +02:00
Markus Lehtonen
5295feb1ee docs: polish the version menu
Only show the dynamic version menu in production environment where it's
available. Local (development) builds only show a stub version menu with
one item.

Also, fix the theme customization. Append version list items to the
correct element in html so that they are displayed correctly. Drop
unnecessary <div/>.
2020-10-30 08:41:33 +02:00
Markus Lehtonen
5ec91935df Makefile: add rules for building html docs
Add rules for building and serving the html documentation inside a
container.
- 'make site-build' will build the html content unders docs/_site.
- 'make site-serve' builds the site content and serves it at
  http://localhost:4000/
2020-10-08 10:51:13 +03:00
Markus Lehtonen
5d4484a1d9 Makefile: set default deployment ns to node-feature-discovery
Change the default namespace used in deployment yamls from 'kube-system'
to 'node-feature-discovery'. Sync with what the templates have. Also,
this should be a safer and more desirable default for people just trying
out node-feature-discovery.
2020-10-01 13:52:10 +03:00
Markus Lehtonen
890380892d Fix up Makefile variable initialization and documentation
An attempt to organize the Makefile variables a bit further. The idea is
to only document variables that are really intended for build
customization and initialize all these variables in the Makefile with
'=?' so that they can be specified in the environment (and not just with
variable overrides). Thus, this patch drops some variables from the
README and change the initialization of some variables in the Makefile
so that the two files would be in sync.
2020-09-08 16:24:39 +03:00
Carlos Eduardo Arango Gutierrez
4bcb0cf851
Fix Makefile to take vaules from ENV VAR values
make image and make push fails when trying to use an ENV VAR value, as
it is now they can only be overrided.

the Var modified are
GO_CMD
GO_FMT
IMAGE_BUILD_EXTRA_OPTS
IMAGE_BUILD_CMD
IMAGE_PUSH_CMD
IMAGE_TAG_NAME
IMAGE_REGISTRY
IMAGE_NAME
IMAGE_EXTRA_TAG_NAMES
K8S_NAMESPACE
HOSTMOUNT_PREFIX

This new behaviour has also been updated on the README.

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-09-08 07:49:43 -05:00
Markus Lehtonen
4e5df73747 Makefile: add IMAGE_EXTRA_TAG_NAMES variable
Make it possible to create and push multiple container image tags with
single invocation of make.
2020-09-03 16:01:36 +03:00
Markus Lehtonen
05f5d2a88a scripts/test-infra: add script for end-to-end testing
Add a new script for running end-to-end tests. Implement a Makefile rule
for polling the container image. We need this for prow as there is no
other way for syncing the jobs (e2e postsubmit job must wait until the
image-pushing job has built and published the image). This is
implemented in the Makefile as all the image-related variables are also
defined/available there.

Also, adapt the TravisCI config to use the new script.
2020-08-27 14:48:37 +03: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
Markus Lehtonen
2b5488299e Makefile: add install target 2020-08-21 14:27:39 +03:00
Markus Lehtonen
02dc1ae1e9 Makefile: add build target 2020-08-21 14:27:39 +03:00
Markus Lehtonen
844c73799e Makefile: change image registry to k8s.gcr.io/nfd 2020-08-07 10:25:19 +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
4e04d1d61c Makefile: add ci-lint target
Use golangci-lint to make use of a number of different linters.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
447eee261d Makefile: add gofmt and gofmt-verify targets
For re-formatting the code and checking that we comply.

Inspired by what we have in node-feature-discovery-operator.
2020-05-19 14:24:44 +03:00
Markus Lehtonen
3d5866a06d test/e2e: more comprehensive per-node testing
Implement an end-to-end test with all feature sources enabled. The new
test runs nfd-worker as a daemonset on all (schedulable) nodes of the
test cluster which makes it possible to cover a wide range features,
assuming the test cluster is heterogenous containing nodes with varying
system configurations.

The features available depends on the node(s) the e2e testa are run on.
Thus, some runtime parameterization of the tests is needed. The patch
adds a new command line test flag 'nfd.e2e-config' that is used to
specify the per-node feature labels and annotations that is expected to
be present in the cluster. An example configuration file is provided
with the patch. The pod spec of nfd-worker deployment is changed to
better correspond the default deployment and thus enable wider feature
discovery. This means using hostnetwork and adding mounts for /sys /boot
and /etc/os-release.

The patch changes node object management so that all nfd-related labels
are removed after each test (not just the ones the test is expected to
add). Also, all nfd-related annotations are now removed.
2020-02-28 10:37:26 +02:00
Markus Lehtonen
fec55ec335 Makefile: define go binary in a make variable
Makes testing with different go versions easier.
2019-12-17 15:41:42 +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
b5d71f421d Makefile: add 'e2e-test' target
For running end-to-end tests it is required to explicitly specify in the
command line the kubeconfig to be used, e.g.:
$ make e2e-test KUBECONFIG=$HOME/.kube/config
2019-06-27 06:29:45 +03:00
Markus Lehtonen
2cfb3ade5d Makefile: add IMAGE_BUILD_EXTRA_OPTS variable 2019-06-18 16:23:25 +03:00
Markus Lehtonen
a8e7259bf8 Makefile: add 'push' target
Now 'make push' can be used to push the container image to the remote
registry.
2019-06-18 16:23:25 +03:00
Antti Kervinen
9b96407b26 Makefile: create default yamls, configurable namespace
- Create default yamls for deploying master and worker.
- Use kube-system namespace by default.
- Configurable namespace:
  make IMAGE_REGISTRY=myhost:5000 K8S_NAMESPACE=my-nfd-devel
2019-06-05 13:13:53 +03:00
Markus Lehtonen
e7d272ad0f Makefile: reorganise container image variables
Change the structure and naming of the make variables that control the
container image name/tag that gets created. Default values and behavior
stay the same, but, this change tries to make it easier to customize the
build from command line.

Also, document all the relevant make variables in readme.
2019-04-25 15:25:49 +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
12d6c2410e Re-generate mock sources
Add a new Makefile target for regenerating these files.  Also, add a
note that the files are auto-generated, including instructions how to
re-generate them.

Renames the mock files, using the defaults provided by the mockery tool,
in order to make their generation easier.
2019-04-04 22:40:24 +03:00
Markus Lehtonen
607e95f290 Makefile: drop docker build-args for https(s) proxy
Docker v17.07 and later supports configuring proxy servers via the
docker client configuration (https://docs.docker.com/network/proxy/).

This is better than using --build-args for passing the proxy settings to
the build environment. Previously, we could end up with empty variables
values which could cause the build to fail. E.g. if you had
http_proxy=<myproxy> defined but HTTP_PROXY unset in the host
environment, you ended up with http_proxy=<myproxy> and HTTP_PROXY=""
(i.e. empty value) inside the build which caused problems in some cases.
In addition, this makes builds via make and directly with docker more
similar.
2018-11-30 13:21:41 +02:00
Markus Lehtonen
ed5a259eaa Configurable image build tool
Make it possible to specify an image build tool other than docker - a
limitation is that the build tool must be compatible with docker files,
of course. This makes it possible to build an NFD image without the
Docker daemon, for example.

The image build command is specified in a makefile variable and can be
overridden from command line, for example:
$ make IMAGE_BUILD_CMD="buildah bud"

Thanks: Zvonko Kosic for suggesting this
2018-09-20 09:28:28 +03:00
Markus Lehtonen
bb32ef83f7 Export proxy env vars inside docker build
Without correct proxy settings propagated to docker build it is not possible to
build node-feature-discovery from behind a proxy server, e.g. in corporate
networks. This patch fixes the issue by exporting all http(s) proxy related
environment variables as build-time variables.
2018-04-03 12:46:33 +03:00
Balaji Subramaniam
d527d588f3 Fix to report the correct version inside container.
- Used build args to pass the correct version.
2016-12-09 13:36:15 -08:00
Balaji Subramaniam
9e37744d5c Hosted docker image in quay.io.
- Updated makefile, job template and readme.
2016-09-02 16:04:04 -07:00
Connor Doyle
570d1ae5be Replayed commit history. 2016-08-31 11:44:06 -07:00
Connor Doyle
e79ffd2c2a Refactored feature sources.
- Added interface FeatureSource, moved cpuid, rdt and pstate
  discovery logic into implementations.
- Updated logging output to make it more machine-readable
  (one feature, in label-format, per line).
- Normalized label names (derived from the underlying feature source).
- Added makefile.
- Added command-line argument parsing and proper CLI documentation.
- Added ability to filter the enabled feature sources: cpuid,rdt,pstate.
- Added ability to print the software version and exit.
- Added ability to print the CLI help.
- Updated README.
- Updated dep versions.
- Added -s -w to ldflags.
- Output version label along with discovered feature labels.
- Added sources section to README.
- Normalized README link for pstate
2016-08-30 14:41:59 -07:00