4.12. ビルド済みイメージ内の kmods への署名


ハードウェアベンダーによって配布されたイメージや別の場所でビルドされたイメージなど、ビルド済みのイメージがある場合は、この手順を使用します。

次の YAML ファイルは、公開鍵と秘密鍵のペアを必要なキー名 (秘密鍵の場合は key、公開鍵の場合は cert) を持つシークレットとして追加します。次に、クラスターは unsignedImage イメージをプルダウンし、これを開いて filesToSign に一覧表示されているカーネルモジュールに署名し、それらを再び追加し、作成されたイメージを containerImage としてプッシュします。

次に、KMM は、セレクターに一致するすべてのノードに署名された kmod をロードします。kmods は、MOK データベースに公開鍵を持つすべてのノード、およびセキュアブートが有効になっていないすべてのノード (署名を無視するノード) に正常にロードされます。

前提条件

  • keySecret および certSecret シークレットが、残りのリソースと同じ namespace に作成されている。

手順

  • YAML ファイルを適用します。

    Copy to Clipboard Toggle word wrap
    ---
    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
1
ロードする kmod の名前。
2
コンテナーイメージの名前。たとえば、quay.io/myuser/my-driver:<kernelversion です。
3
署名のないイメージの名前。たとえば、quay.io/myuser/my-driver:<kernelversion です。
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat, Inc.