10.3.2. Create a primary user-defined network by using the CLI


You can create a primary UserDefinedNetwork or ClusterUserDefinedNetwork custom resource definition (CRD) by using the OpenShift CLI (oc). After you define the custom primary overlay network, you can create namespaces that are associated with the cluster-scoped UDN.

10.3.2.1. Creating a namespace for user-defined networks by using the CLI

You can create a namespace to be used with primary user-defined networks (UDNs) by using the OpenShift CLI (oc).

Prerequisites

  • You have access to the cluster as a user with cluster-admin permissions.
  • You have installed the OpenShift CLI (oc).

Procedure

  1. Create a Namespace object as a YAML file similar to the following example:

    apiVersion: v1
    kind: Namespace
    metadata:
      name: my-namespace
      labels:
        k8s.ovn.org/primary-user-defined-network: ""
    # ...

    The k8s.ovn.org/primary-user-defined-network label is required for the namespace to be associated with a UDN. If the namespace is to be used with an existing cluster UDN, you must also add the appropriate labels that are defined in the spec.namespaceSelector field of the ClusterUserDefinedNetwork custom resource.

  2. Apply the Namespace manifest by running the following command:

    $ oc apply -f <filename>.yaml
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

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

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

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

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

Legal Notice

Theme

© 2026 Red Hat
トップに戻る