// Module included in the following assemblies:
//
// assembly-configure-address-spaces-addresses-cli-kube.adoc
// assembly-configure-address-spaces-addresses-cli-oc.adoc

[id='create-address-space-plans-cli-{context}']
= Creating address space plans

.Procedure

ifeval::["{cmdcli}" == "oc"]
. Log in as a service admin:
+
[subs="attributes",options="nowrap"]
----
{cmdcli} login -u system:admin
----

. Select the project where {ProductName} is installed:
+
[subs="+quotes,attributes",options="nowrap"]
----
{cmdcli} project _{ProductNamespace}_
----
endif::[]

. Create an address space plan definition:
+
[source,yaml,options="nowrap"]
----
apiVersion: admin.enmasse.io/v1beta2
kind: AddressSpacePlan
metadata:
  name: restrictive-plan
  labels:
    app: enmasse
spec:
  displayName: Restrictive Plan
  displayOrder: 0
  infraConfigRef: default
  shortDescription: A plan with restrictive quotas
  longDescription: A plan with restrictive quotas for the standard address space
  addressSpaceType: standard
  addressPlans:
  - small-queue
  - small-anycast
  resourceLimits:
    router: 2.0
    broker: 2.0
    aggregate: 2.0
----

. Create the address space plan:
+
[options="nowrap",subs="attributes"]
----
{cmdcli} create -f restrictive-plan.yaml
----

. Verify that schema has been updated and contains the plan:
+
[options="nowrap",subs="attributes"]
----
{cmdcli} get addressspaceschema standard -o yaml
----

