intel-device-plugins-for-ku.../cmd/fpga_crihook
Dmitry Rozhkov 70f862f2aa add golangci linter
In this initial commit the following checks are disabled due to
excessive amount of changes required:
- dupl (duplicate code)
- funlen (function length)
- goerr113 (errors handling expressions)
- gomnd (magic numbers)
- gosec (security)
- nakedret (naked returns)
- wsl (forces to use empty lines)
- errcheck (checking for unchecked errors)
- staticcheck (static analysis)
2020-06-08 14:01:13 +03:00
..
testdata fpga_crihook: improve unit tests 2020-03-31 11:57:06 +03:00
main_test.go add golangci linter 2020-06-08 14:01:13 +03:00
main.go add golangci linter 2020-06-08 14:01:13 +03:00
README.md READMEs: use git clone to get the code 2020-02-20 08:04:07 +02:00

Intel FPGA prestart CRI-O webhook for Kubernetes

Table of Contents

Introduction

The FPGA CRI-O webhook is one of the components used to add support for Intel FPGA devices to Kubernetes.

The FPGA prestart CRI-O hook is triggered by container annotations, such as set by the FPGA device plugin. It performs discovery of the requested FPGA function bitstream and then programs FPGA devices based on the environment variables in the workload description.

The CRI-O prestart hook is only required when the FPGA admission webhook is configured for orchestration programmed mode, and is benign (un-used) otherwise.

Note: The fpga CRI-O webhook is usually installed by the same DaemonSet as the FPGA device plugin. If building and installing the CRI-O webhook by hand, it is recommended you reference the fpga plugin DaemonSet YAML for more details.

Dependencies

This component is one of a set of components that work together. You may also want to install the following:

All components have the same basic dependencies as the generic plugin framework dependencies

Building

The following sections detail how to obtain, build and deploy the CRI-O prestart hook.

Getting the source code

$ mkdir -p $(go env GOPATH)/src/github.com/intel
$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes $(go env GOPATH)/src/github.com/intel/intel-device-plugins-for-kubernetes

Building the image

$ cd $(go env GOPATH)/src/github.com/intel/intel-device-plugins-for-kubernetes
$ make intel-fpga-initcontainer
...
Successfully tagged intel/intel-fpga-initcontainer:devel

Configuring CRI-O

Recent versions of CRI-O are shipped with default configuration file that prevents CRI-O to discover and configure hooks automatically. For FPGA orchestration programmed mode, the OCI hooks are the key component. Please ensure that your /etc/crio/crio.conf parameter hooks_dir is either unset (to enable default search paths for OCI hooks configuration) or contains the directory /etc/containers/oci/hooks.d.