vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Before you can create entities in the namespace, you must set your CLI context to the namespace by targeting it.

ibmcloud fn property set --namespace <namespace_name_or_id>



After you set a property, such as the --namespace property, it is retained until you manually unset it. If you want to switch between IAM namespaces or between Cloud Foundry and IAM namespaces, you must unset the namespace property and then reset it. For more information, see [ibmcloud fn property set](https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-cli-plugin-functions-clicli_prop_set).





 Creating a namespace with the API 

Create your IAM-managed namespace with the API.



1. Create an IAM-enabled namespace.

curl --request POST --url 'https://jp-tok.functions.cloud.ibm.com/api/v1/namespaces' --header 'accept: application/json' --header 'authorization: <IAM_token>' --data '{"description":"string","name":"string","resource_group_id":"string","resource_plan_id":"string"}'

| <IAM_token> | Your IBM Cloud Identity and Access Management (IAM) token. To retrieve your IAM token, run ibmcloud iam oauth-tokens. | | -n <name> | The name of the namespace. | | -n <resource_group_id> | The ID of the resource group that you want to create the namespace in. To see resource group IDs, run ibmcloud resource groups. | | -n <resource_plan_id> | The ID of the resource plan, such as functions-base-plan | | -n <description> | Optional: Add a description to the namespace, such as which kind of actions or packages it will contain. |

The following example shows sample output from the previous command.

{
Namespace namespace Config The namespace where you want to create the deployment. true default 







 1.10.0 parameter reference 



Table 3. 1.10.0 parameter reference

 Display name CLI option Type Description Required? Default value 

 Namespace namespace Config The namespace where you want to create the deployment. true default 







 1.11.1 parameter reference 



Table 4. 1.11.1 parameter reference

 Display name CLI option Type Description Required? Default value 

 Namespace namespace Config The namespace where you want to create the deployment. true default 









 Getting help and support for Block Storage for Classic 



1. Review the FAQs in the [Block Storage for Classic docs](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-faq).
2. Review the [troubleshooting documentation](https://cloud.ibm.com/docs/satellite?topic=satellite-storage-must-gather) to troubleshoot and resolve common issues.
3. Check the status of the IBM Cloud platform and resources by going to the [Status page](https://cloud.ibm.com/status).
4. Review [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-cloud) to see whether other users experienced the same problem. Tag any questions with ibm-cloud.
5. If you run into an issue with Block Storage for Classic submit a support request with [IBM Cloud® Support](https://www.ibm.com/cloud/support).
For more information about resource groups, see [Creating a resource group](https://cloud.ibm.com/docs/account?topic=account-rgscreate_rgs).

If you have a problem when you try to add a namespace, see [Why can't I add a namespace?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-add-namespace) for assistance.



 Prerequisites 

To find out about the required permissions, see [Platform management roles](https://cloud.ibm.com/docs/Registry?topic=Registry-iamplatform_management_roles) and [Access roles for configuring Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-iamaccess_roles_configure).





 Command options 

NAMESPACE
: The namespace that you want to add. The namespace must be unique across all IBM Cloud accounts in the same region. Namespaces must have 4 - 30 characters, and contain lowercase letters, numbers, hyphens (-), and underscores (_) only. Namespaces must start and end with a letter or number.

Do not put personal information in your namespace names.

-g (RESOURCE_GROUP_NAME | RESOURCE_GROUP_ID)
: (Optional) Specify the name or ID of the resource group to which you want to add the namespace. If you don't set this option, the targeted resource group is used. If you don't set this option and a resource group is not targeted, the default resource group for the account is used.





 Example 

Create a namespace with the name birds and add it to the resource group beaks.

ibmcloud cr namespace-add -g beaks birds







 ibmcloud cr namespace-assign 

Namespacescreated in version 0.1.484 of the Container Registry CLI or earlier, or in the IBM Cloud console before 29 July 2020 are not assigned toresource groups. You can assign an unassigned namespace to a resource group for your IBM Cloud account.
* [To work with namespaces, you must have the Manager role at the account level](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes13jul2020_manager)



* [24 June 2020](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notesregistry-24jun2020)



* [Restoring all tags for a digest in a repository is now an option](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes24jun2020_tags)



* [18 May 2020](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notesregistry-18may2020)



* [Retaining untagged images is now an option when you clean up your namespaces](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes18may2020_untagged)



* [30 April 2020](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notesregistry-30apr2020)



* [ibmcloud cr image-prune-untagged command is available](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes30apr2020_prune)



* [16 April 2020](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notesregistry-16apr2020)



* [You can use private network connections to securely route your data in Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes16apr2020_private_network)
* [ibmcloud cr private-only command is available](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_release_notes16apr2020_private)
* NAMESPACE - Name of the project or namespace that is visible on the console Support page.



These instructions are obviously for the Docker registry. If you are using the IBM Container Registry, then you need to set up your own image pull secret in your cluster:

- [Using an image pull secret to access images in other IBM Cloud accounts or external private registries from non-default Kubernetes namespaces](/docs/containers?topic=containers-registryother)
- [Copying an existing image pull secret](/docs/containers?topic=containers-registrycopy_imagePullSecret)
- [Referring to the image pull secret in your pod deployment](/docs/containers?topic=containers-imagespod_imagePullSecret)





 Step four: Create a Kubernetes secret hsmcrypto 

In order for a CA, peer, or ordering node to be able to communicate with the HSM client image you need to create a Kubernetes secret named hsmcrypto that contains the keys and configuration files for the HSM that you are using. When the console deploys a node that is configured with HSM, it uses this secret to access the HSM client image keys and configuration files.

The Kubernetes secret needs to be created in the IBM Blockchain Platform service instance namespace that is visible on the console Support page. If you are using the IBM Cloud HSM, the command would be:

$ kubectl create secret generic hsmcrypto -n <NAMESPACE> --from-file=Chrystoki.conf --from-file=cert.pem --from-file=key.pem --from-file=server.pem

Replace <NAMESPACE> with the name of your service instance namespace or OpenShift project If you are not using IBM Cloud HSM, you need to replace the values of the --from-file parameters with the set of certificates and configuration files that are required for your HSM client image.

When successful, the output looks similar to:

secret/hsmcrypto created

To verify the contents of the secret, run the command:
The namespace must be unique across all IBM Cloud accounts in the same region. Namespaces must have 4 - 30 characters, and contain lowercase letters, numbers, hyphens (-), and underscores (_) only. Namespaces must start and end with a letter or number.

ibmcloud cr namespace-add <my_namespace>

You can put the namespace in a resource group of your choice by using one of the following options.



* Before you create the namespace, run the [ibmcloud target -g <resource_group>](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cliibmcloud_target) command, where <resource_group> is the resource group.
* Specify the resource group by using the -g option on the [ibmcloud cr namespace-add](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregclibx_cr_namespace_add) command.



If you have a problem when you try to create a namespace, see [Why can't I add a namespace?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-add-namespace) for assistance.
3. To ensure that your namespace is created, run the ibmcloud cr namespace-list command.

ibmcloud cr namespace-list -v







 Step 3: Pull images from a registry to your local computer 



1. Install Docker or a tool of your choice, such as Podman.



* Install the [Docker Engine CLI](https://www.docker.com/products/container-runtime//download). For Windows® 8, or OS X Yosemite 10.10.x or earlier, install [Docker Desktop](https://docs.docker.com/desktop/) instead. For more information about the version of Docker that is supported by IBM Cloud Container Registry, see [Support for Docker](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_overviewdocker).
if [ -z "${namespace}" ];
then
echo "Please provide a valid namespace with -n option"
exit
fi

 NOTE: SET THE kb ALIAS TO THE CORRECT ONE FOR THE CLUSTER TYPE

 For Kubernetes
kb='kubectl --namespace $namespace'
 For OpenShift
kb='kubectl --namespace '$namespace

 Retrieving container details


echo $kb

BM_container="$($kb get pods -o=jsonpath='{range .items[?(@.metadata.labels.app=="dsb-manager")]}{.metadata.name}' )"
Mongo_container="$($kb get pods -o=jsonpath='{range .items[?(@.metadata.labels.app=="dsb-mongodb")]}{.metadata.name}')"
echo "BM_container ==>" $BM_container
echo "Mongo_container ==>" $Mongo_container

version="$($kb exec -it $BM_container -- bash -c 'cat /opt/baffle/BAFFLEVERSIONS | grep BMVERSION' | awk -F "=" '{print $2}' )"
version="${version//$'r'/}"
echo "version ==>" $version

BM_BACKUP_DIR=$backup

MONGO_USER="$($kb exec -it $Mongo_container -- bash -c 'cat /run/secrets/mongodb_user' )"
MONGO_PASS="$($kb exec -it $Mongo_container -- bash -c 'cat /run/secrets/mongodb_pass' )"
echo $MONGO_USER
echo $MONGO_PASS

backup_directory=$BM_BACKUP_DIR/$version
mkdir -p $backup_directory
echo "backup_directory ==> "$backup_directory
resource = ibm_cr_namespace.cr_namespace.id
resource_type = "namespace"
region = var.region
}
}
Show more

Updating a namespace by using Terraform is not supported. You can use Terraform to create and remove namespaces only.
3. Initialize the Terraform CLI.

terraform init
4. Create a Terraform execution plan. The Terraform execution plan summarizes all the actions that need to be run to create the Container Registry namespace and IAM access policy in your account.

terraform plan
5. Create the Container Registry namespace and IAM access policy in IBM Cloud.

terraform apply
6. From the [Container Registry namespace overview page](https://cloud.ibm.com/registry/namespaces), verify that your namespace is created successfully.
7. Verify that the IAM access policy is successfully assigned. For more information, see [Reviewing assigned access in the console](https://cloud.ibm.com/docs/account?topic=account-assign-access-resourcesreview-your-access-console).







 Next steps 

Now that you successfully created your first Container Registry namespace with Terraform on IBM Cloud, you can choose between the following tasks:



* Learn how to [add images to your namespace](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_images_).
* Explore other supported arguments and attributes for the [Container Registry Terraform resources and data sources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cr_namespace) that were used in this example.
<-- </section "id="section-get-http-resource-template-invoke" "> --><-- </section "id="section-get-http-resource-template" "> --><-- <section "id="section-hello-world-template" "> --> Deploying the Hello World template You can deploy this basic Hello World action to get started with Cloud Functions or to test other entities you create, such as triggers and rules.When you deploy this template, you create a single action called helloworld. This action accepts a single parameter in JSON format, { "name": "xxxx" }.<-- <section "id="section-hello-world-template-ui" "> --> Deploying the Hello World template from the console You can deploy the Hello World template from the console.Before you beginSelect a namespace to contain your Cloud Functions entities from the console]]. For more information about namespaces, see Managing namespaces]] ! .<-- <ol> -->1. Go to the Create page]] ! ! ! ! in the Cloud Functions console.2. Click Quickstart templates.3. Click Hello World.4. Enter a name for your package or use the default name hello-world.5. Choose the runtime for your actions.6. Click Deploy.<-- </ol> -->After the template deploys, you can make further edits to the code to customize it as needed, or go back and check out the catalog of available templates.<-- </section "id="section-hello-world-template-ui" "> --><-- <section "id="section-hello-world-template-cli" "> --> Deploying the Hello World template from the CLI Use the CLI to deploy the Hello World template.Before you begin<-- <ul> --> * Install the Cloud Functions]] CLI. * Specify a namespace to contain your Cloud Functions entities. For more information about namespaces, see Managing namespaces]] ! ! ! !
resource groupof your choice by using one of the following options.



* Before you create the namespace, run the [ibmcloud target -g <resource_group>](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cliibmcloud_target) command, where <resource_group> is the resource group.
* Specify the required resource group by using the -g option on the ibmcloud cr namespace-add command.



If you create a namespace in a resource group, you can configure access to resources within the namespace at the [resource group](https://cloud.ibm.com/docs/account?topic=account-rgs) level. However, you can still set permissions for the namespace at the account level or in the namespace itself. If you don't specify a resource group, and a resource group isn't targeted, the default resource group is used.

If you have an older namespace that is not in a resource group, you can assign it to a resource group, see [ibmcloud cr namespace-assign](https://cloud.ibm.com/docs/cli?topic=cli-containerregcliic_cr_namespace_assign).

Namespaces that are assigned to a resource group show in the Resource list page of the IBM Cloud console.

ibmcloud cr namespace-add [-g (RESOURCE_GROUP_NAME | RESOURCE_GROUP_ID)] NAMESPACE

For more information about resource groups, see [Creating a resource group](https://cloud.ibm.com/docs/account?topic=account-rgscreate_rgs).

If you have a problem when you try to add a namespace, see [Why can't I add a namespace?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-add-namespace) for assistance.



 Prerequisites
ibmcloud iam user-policy-delete <user.b@example.com> <Policy_ID>









 Step 2: Authorize a user to access specific namespaces 

Create some

namespaceswith sample images, and grant access to them. You create policies to grant different roles to each namespace, and show what effect that has.



1. Create three new namespaces in User A's account. These namespaces must be unique across the region, so choose your own namespace names, but this tutorial uses namespace_a, namespace_b and namespace_c as examples.



1. Log in as User A, by running the following command.

ibmcloud login
2. Create namespace_a by running the following command.

ibmcloud cr namespace-add namespace_a

The namespace must be unique across all IBM Cloud accounts in the same region. Namespaces must have 4 - 30 characters, and contain lowercase letters, numbers, hyphens (-), and underscores (_) only. Namespaces must start and end with a letter or number.

If you have a problem when you try to add a namespace, see [Why can't I add a namespace?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-add-namespace) for assistance.
3. Create namespace_b by running the following command.

ibmcloud cr namespace-add namespace_b
4. Create namespace_c by running the following command.

ibmcloud cr namespace-add namespace_c



2. Prove that User B can't see anything.



1. Log in as User B, targeting User A's account by running the following command.

ibmcloud login -c <YourAccountID>
2. Try to list the namespaces as User B by running the following command.

ibmcloud cr namespaces

It returns an empty list because User B doesn't have access to any namespaces.



3.
If you want to create a new Kubernetes namespace, follow the steps mentioned under [Copying an existing image pull secret](https://cloud.ibm.com/docs/containers?topic=containers-registrycopy_imagePullSecret) and [Storing the image pull secret in the Kubernetes service account for the selected namespace](https://cloud.ibm.com/docs/containers?topic=containers-registrystore_imagePullSecret) sections of the Kubernetes service documentation. Once completed, run the below command:

export KUBERNETES_NAMESPACE=<KUBERNETES_NAMESPACE_NAME>



6. Change to the chart directory under your sample application directory:

cd chart/kubernetesnodeapp
7. Install the Helm chart:

helm install $MYAPP --namespace $KUBERNETES_NAMESPACE . --set image.repository=icr.io/solution-tutorials/tutorial-scalable-webapp-kubernetes
8. Change back to the sample application directory:

cd ../..







 View the application 



1. List the Kubernetes services in the namespace:

kubectl get services -n $KUBERNETES_NAMESPACE
2. List the Kubernetes pods in the namespace:

kubectl get pods -n $KUBERNETES_NAMESPACE









 Step 4: Use the IBM-provided domain for your cluster 

Paid clusters come with an IBM-provided domain. This gives you a better option to expose applications with a proper URL and on standard HTTP/S ports.

Use Ingress to set up the cluster inbound connection to the service.

Zoom

![Ingress](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution2/Ingress.png)

Ingress



1.
For more information about namespaces, see [Managing namespaces](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-namespaces).



1. Go to the [Create page](https://cloud.ibm.com/functions/create) in the Cloud Functions console.
2. Click Create Sequence.
3. Specify a name, package, and initial action for your sequence. You can choose existing actions that are available in your namespace or else select a public action. Click Create.
4. Add one or more actions to your sequence and Save.
5. You can test your code by clicking Invoke.







 Creating a sequence from the CLI 

Create a sequence from the CLI with the [ibmcloud fn action create](https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-cli-plugin-functions-clicli_action_create) command.

ibmcloud fn action create <sequence_name> --sequence <action_1>,<action_2>
Specify the name for the namespace and click Add to create a new namespace within the selected cluster.
7. You must run the preinstallation script by clicking on the Run Script button after you select the cluster and the namespace. If you do not run the preinstallation script, you cannot proceed with the installation of the Data Security Broker Manager.
8. Configure your workspace by specifying the following details:

a. Specify the Name for the workspace. The workspace name must be unique and using the name of the workspace, you can manage, update or uninstall Data Security Broker Shield from the IBM Schematicss Workspace ([https://cloud.ibm.com/schematics/workspaces](https://cloud.ibm.com/schematics/workspaces)).

Zoom

![Configure Workspace](https://cloud.ibm.com/docs-content/v1/content/57ab3ec034294d8a6de510b97bec3035d4654761/security-broker/images/workspace.svg)

Configure Workspace

If you are installing more than one instance of Data Security Broker Manager in the same namespace, ensure that you provide unique workspace names to each of the Data Security Broker Manager installation. Otherwise, you might get error which describes that the same workspace already exists in the namespace.

b. Select the Resource group, Location, and specify the Tags required for configuring the workspace.
9. Copy the Shield Sync ID from the Data Security Broker Manager application.

Zoom

![Shield Sync ID from Application](https://cloud.ibm.com/docs-content/v1/content/57ab3ec034294d8a6de510b97bec3035d4654761/security-broker/images/shield_syncid.svg)

Shield Sync ID from Application
10. Provide the Shield Sync ID and Shield name under Set the Input Variables section.

Shield Name is mandatory if you are installing multiple Shields.
However, you can still set permissions for the namespace at the account level or in the namespace itself. If you don't specify a resource group, and a resource group isn't targeted, the default resource group is used.

If you have an older namespace that is not in a resource group, you can assign it to a resource group, see [ibmcloud cr namespace-assign](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcliic_cr_namespace_assign).

Namespaces that are assigned to a resource group show in the Resource list page of the IBM Cloud console.

ibmcloud cr namespace-add [-g (RESOURCE_GROUP_NAME | RESOURCE_GROUP_ID)] NAMESPACE

For more information about resource groups, see [Creating a resource group](https://cloud.ibm.com/docs/account?topic=account-rgscreate_rgs).

If you have a problem when you try to add a namespace, see [Why can't I add a namespace?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-add-namespace) for assistance.



 Prerequisites 

To find out about the required permissions, see [Platform management roles](https://cloud.ibm.com/docs/Registry?topic=Registry-iamplatform_management_roles) and [Access roles for configuring Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-iamaccess_roles_configure).





 Command options 

NAMESPACE
: The namespace that you want to add. The namespace must be unique across all IBM Cloud accounts in the same region. Namespaces must have 4 - 30 characters, and contain lowercase letters, numbers, hyphens (-), and underscores (_) only. Namespaces must start and end with a letter or number.

Do not put personal information in your namespace names.

-g (RESOURCE_GROUP_NAME | RESOURCE_GROUP_ID)