4.12. 사전 빌드된 이미지에서 kmods 서명
하드웨어 벤더에 의해 배포되거나 다른 위치에서 빌드된 이미지와 같이 사전 빌드된 이미지가 있는 경우 이 절차를 사용하십시오.
다음 YAML 파일은 공개/개인 키 쌍에 필요한 키 이름(개인 키의 key
, 공개 키의 cert
)이 있는 시크릿으로 공개/개인 키 쌍을 추가합니다. 그러면 클러스터에서 unsignedImage
이미지를 가져와서 열고, filesToSign
에 나열된 커널 모듈에 서명하고, 다시 추가하고, 결과 이미지를 containerImage
로 푸시합니다.
그런 다음 KMM은 서명된 kmods를 선택기와 일치하는 모든 노드에 로드합니다. MOK 데이터베이스에 공개 키가 있는 모든 노드에서 kmods가 성공적으로 로드되고 안전하지 않은 노드는 서명을 무시합니다.
사전 요구 사항
-
keySecret
및certSecret
시크릿은 나머지 리소스와 동일한 네임스페이스에 생성되었습니다.
프로세스
YAML 파일을 적용합니다.
--- apiVersion: kmm.sigs.x-k8s.io/v1beta1 kind: Module metadata: name: example-module spec: moduleLoader: serviceAccountName: default container: modprobe: moduleName: '<module_name>' kernelMappings: # the kmods will be deployed on all nodes in the cluster with a kernel that matches the regexp - regexp: '^.*\.x86_64$' # the container to produce containing the signed kmods containerImage: <image_name> sign: # the image containing the unsigned kmods (we need this because we are not building the kmods within the cluster) unsignedImage: <image_name> keySecret: # a secret holding the private secureboot key with the key 'key' name: <private_key_secret_name> certSecret: # a secret holding the public secureboot key with the key 'cert' name: <certificate_secret_name> filesToSign: # full path within the unsignedImage container to the kmod(s) to sign - /opt/lib/modules/4.18.0-348.2.1.el8_5.x86_64/kmm_ci_a.ko imageRepoSecret: # the name of a secret containing credentials to pull unsignedImage and push containerImage to the registry name: repo-pull-secret selector: kubernetes.io/arch: amd64
--- apiVersion: kmm.sigs.x-k8s.io/v1beta1 kind: Module metadata: name: example-module spec: moduleLoader: serviceAccountName: default container: modprobe:
1 moduleName: '<module_name>' kernelMappings: # the kmods will be deployed on all nodes in the cluster with a kernel that matches the regexp - regexp: '^.*\.x86_64$' # the container to produce containing the signed kmods containerImage: <image_name>
2 sign: # the image containing the unsigned kmods (we need this because we are not building the kmods within the cluster) unsignedImage: <image_name>
3 keySecret: # a secret holding the private secureboot key with the key 'key' name: <private_key_secret_name> certSecret: # a secret holding the public secureboot key with the key 'cert' name: <certificate_secret_name> filesToSign: # full path within the unsignedImage container to the kmod(s) to sign - /opt/lib/modules/4.18.0-348.2.1.el8_5.x86_64/kmm_ci_a.ko imageRepoSecret: # the name of a secret containing credentials to pull unsignedImage and push containerImage to the registry name: repo-pull-secret selector: kubernetes.io/arch: amd64
Copy to Clipboard Copied!