vania-janet/multiturn-rag-retrieval-data huggingface dataset:
You can change this behavior by updating your application and setting the minimum scale to 1 either in the console or from the CLI.

The default value for the maximum number of instances for your app is 0, which allows your app to scale as needed. For more information, see [Scaling boundaries](https://cloud.ibm.com/docs/codeengine?topic=codeengine-app-scaleapp-scale-boundaries).



 Changing the autoscaling range from the console 

To change the range within which Code Engine autoscales the number of running instances for an app from the console, follow these steps.



1. Navigate to your app.
2. Select Configuration
3. Click Edit and create new revision.
4. Select Runtime.
5. Set the number for minimum and maximum instances for your app.
6. (Optional) Review and set the request concurrency and timing settings for autoscaling your app.
7. Click Save and Create.



When you update your application, your app creates a new revision and routes traffic to that instance.





 Changing the autoscaling range with the CLI 

To change the range within which Code Engine autoscales the number of running instances for an app with the CLI, run the [application update](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-application-update) command with the --min-scale and --max-scale options set to the number of instances that you want for your app. You can optionally set request concurrency and timing settings for your app. These options include --concurrency, --concurrency-target, --request-timeout, and --scale-down-delay. For more information about setting these autoscaling values, see [Scaling boundaries](https://cloud.ibm.com/docs/codeengine?topic=codeengine-app-scaleapp-scale-boundaries), and [Autoscaling settings for concurrency and timing](https://cloud.ibm.com/docs/codeengine?topic=codeengine-app-scaleapp-scale-timeconcurrency).
: Set a timeout in seconds before a deployment is considered failed. For example, without a timeout, if your new app version has a bug and hangs immediately, the rollout can't continue because the pod never reaches a ready state. If you set this timeout to 600 seconds, then if any phase of the rollout fails to progress for 10 minutes, the deployment is marked as failed and the rollout stops.

spec.strategy.type
: Specify the RollingUpdate strategy type.

spec.strategy.rollingUpdate.maxUnavailable
: Set the maximum number of pods that can be unavailable during an update, as a number (2) or percentage (50%). Generally, use a percentage so that if you change the number of replicas later you don't have to remember to update the number here, unless you want to limit the rollout to allow only one pod to be down at a time. If you never want to fall under 100% capacity, set this value to 0% and specify the spec.strategy.type.rollingUpdate.maxSurge parameter.

spec.strategy.rollingUpdate.maxSurge
: Set how many extra resources the deployment can use during the rollout, as a number (2) or percentage (50%). For example, if your deployment specifies 10 replicas and you set the maxSurge to 2, then during the rollout, two new replicas are created. You now have 12 replicas (10 existing, 2 new). After the two new replicas are ready, the deployment scales down the old replicas to 8 to meet the specified 10 replicas. This process continues until the rollout is complete and all 10 replicas run the new version.

If you want to perform a blue-green instantaneous switch style update, set the maxSurge to 100%. The deployment creates all the new required replicas, then scales down the old version replicas to 0.
3. [Roll out](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/updating-a-deployment) a change. For example, you might want to change the image that you used in your initial deployment.



1.
To set the worker pool, format the option as follows: --set workerpools[0].<pool_name>.max=<number_of_workers>,workerpools[0].<pool_name>.min=<number_of_workers>,workerpools[0].<pool_name>.enabled=(true|false) Understanding the --set workerpools options:
: workerpools[0]: The first worker pool to enable or disable for autoscaling. You must include three parameters for each worker pool for the command to succeed: the maximum number of worker nodes (max), the minimum number of worker nodes (min), and whether you want to enable (true) or disable (false) autoscaling for this worker pool. To include multiple worker pools, include a comma-separated list and increase the number in brackets, such as: workerpools[0].default...,workerpools[1].pool1...,workerpools[2].pool2....
: <pool_name>: The name or ID of the worker pool that you want to enable or disable for autoscaling. To list available worker pools, run ibmcloud ks worker-pool ls --cluster <cluster_name_or_ID>.
: max=<number_of_workers>: Specify the maximum number of worker nodes per zone that the cluster autoscaler can scale up to. The value must be equal to or greater than the value that you set for the min=<number_of_workers> size.
: min=<number_of_workers>: Specify the minimum number of worker nodes per zone that the cluster autoscaler can scale down to. The value must be 2 or greater so that your ALB pods can be spread for high availability. If you disabled all public ALBs in each zone of your standard cluster, you can set the value to 1. Keep in mind that setting a min size does not automatically trigger a scale-up. The min size is a threshold so that the cluster autoscaler does not scale to fewer than this minimum number of worker nodes per zone.
spec.progressDeadlineSeconds
: Set a timeout in seconds before a deployment is considered failed. For example, without a timeout, if your new app version has a bug and hangs immediately, the rollout can't continue because the pod never reaches a ready state. If you set this timeout to 600 seconds, then if any phase of the rollout fails to progress for 10 minutes, the deployment is marked as failed and the rollout stops.

spec.strategy.type
: Specify the RollingUpdate strategy type.

spec.strategy.rollingUpdate.maxUnavailable
: Set the maximum number of pods that can be unavailable during an update, as a number (2) or percentage (50%). Generally, use a percentage so that if you change the number of replicas later you don't have to remember to update the number here, unless you want to limit the rollout to allow only one pod to be down at a time. If you never want to fall under 100% capacity, set this value to 0% and specify the spec.strategy.type.rollingUpdate.maxSurge parameter.

spec.strategy.rollingUpdate.maxSurge
: Set how many extra resources the deployment can use during the rollout, as a number (2) or percentage (50%). For example, if your deployment specifies 10 replicas and you set the maxSurge to 2, then during the rollout, two new replicas are created. You now have 12 replicas (10 existing, 2 new). After the two new replicas are ready, the deployment scales down the old replicas to 8 to meet the specified 10 replicas. This process continues until the rollout is complete and all 10 replicas run the new version.

If you want to perform a blue-green instantaneous switch style update, set the maxSurge to 100%. The deployment creates all the new required replicas, then scales down the old version replicas to 0.
3. [Roll out](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/updating-a-deployment) a change.
This method removes the first occurrence of the specified value from the array, and returns the updated array. The specified value can be a string or a number.

${Items}.removeValue('two')

If Items is ['one', 'two', 'three'], this example returns ['one', 'three']. The original Items array is also modified in place.





 Array.set(Integer index, value) 

This method replaces the item in the specified index position with the specified value, and returns the updated array.

${Items}.set(2,'five')

If Items is ['one', 'two', 'three'], this example returns ['one', 'two', 'five']. The original Items array is also modified in place.





 Array.size() 

This method returns the number of items in the array as an integer.

${Items}.size()

If Items is ['one', 'two', 'three'], this example returns 3.
[Shows the user clicking the "Character Type : Number" option as the feature setting for the "3" token.](images/rule-add5.png "Shows the user clicking the "Character Type : Number" option as the feature setting for the "3" token.")

You changed the definition for the number 3 cell.

![Shows the cell that represents the "3" token now has a "Character Type" icon above it to indicate that any numeric value can match that token in the pattern.](images/rule-add6.png "Shows the cell that represents the "3" token now has an "Character Type" icon above it to indicate that any numeric value can match that token in the pattern.")

The Character Type icon indicates that instead of requiring the number to be equal to 3 exactly, it can be any number.
6. Do not change any settings for the comma token.

We want the third token in the pattern to be a comma, so the current feature setting of text : , is appropriate. In addition to a feature setting, each token has a repeat setting. The repeat setting specifies how many times the token can be repeated in the text for it to match the pattern. The current repeat setting of Required (Exactly 1) is appropriate.

![Shows the repeat setting for the comma token which is set to "Exactly 1".](images/rule-add7.png "Shows the repeat setting for the comma token which is set to "Exactly 1".")
7. Assign a class to represent the pattern DictMonth + numeric token + comma + RegExpYear.

Notice the four empty cells that represent the four tokens that you selected from the document. To select all the cells, select the first cell, and then press Shift + click each additional cell. Enter RuleDate as the class name, and then click it to create the new class.

![Shows that all four cells in the top row have been selected and the span is being defined as the "RuleDate" class.]
When you create or update an application with Code Engine from the console, set the max concurrency value in the Autoscaling section of the Runtime tab. With the CLI, specify the --concurrency option on the app create and app update commands.
* Target concurrency - This value acts as a "soft limit" or number of requests per instance that you want in a loaded system. For example, if you specify concurrency as 100, and you specify target concurrency as 70, then Code Engine tries to limit the number of requests per instance to 70. Specifying this option doesn't ensure that requests per instance won't go higher than 70 because it most likely will during an increase in traffic. However, the buffer between 70 and 100 enables the system to create new instances to bring the load per instance back down to 70 (or lower) per instance. If target concurrency is not specified, the default is the value of concurrency. When you create or update an application with Code Engine from the console, set the target concurrency value in the Autoscaling section of the Runtime tab. With the CLI, specify the --concurrency-target option on the app create and app update commands.
* Request timeout - The amount of time, in seconds, that the application must respond to requests, or else they fail. When you create or update an application with Code Engine from the console, set the request timeout value in the Autoscaling section of the Runtime tab. With the CLI, specify the --request-timeout option on the app create and app update commands.
* Scale-down delay - The amount of time, in seconds, that must pass at reduced concurrency before the application scales down. If you know the pattern of incoming requests to your application, you might choose to specify a value greater than the default of 0 to delay the scaling down of your application. If you use a high value for this option the average number of concurrently running application instances might increase, which incurs additional cost. Even with a scale-down delay setting of 0, the system waits for a short amount of time before the application scales down the number of instances to ensure that a drop in request concurrency is stable enough to warrant a scale down.
(https://cloud.ibm.com/docs-content/v1/content/50eddb8fd81f33092880335ff107a78ff5cd0f65/watson-knowledge-studio/images/rule-add4.png)

Currently, the rule is set to match the exact text, 3. Instead, we want it to match any number.
5. Change the feature setting to be numeric by selecting Character Type : Numeric, and then clearing the selection, Text : 3.

![Shows the user clicking the "Character Type : Number" option as the feature setting for the "3" token.](images/rule-add5.png "Shows the user clicking the "Character Type : Number" option as the feature setting for the "3" token.")

You changed the definition for the number 3 cell.

![Shows the cell that represents the "3" token now has a "Character Type" icon above it to indicate that any numeric value can match that token in the pattern.](images/rule-add6.png "Shows the cell that represents the "3" token now has an "Character Type" icon above it to indicate that any numeric value can match that token in the pattern.")

The Character Type icon indicates that instead of requiring the number to be equal to 3 exactly, it can be any number.
6. Do not change any settings for the comma token.

We want the third token in the pattern to be a comma, so the current feature setting of text : , is appropriate. In addition to a feature setting, each token has a repeat setting. The repeat setting specifies how many times the token can be repeated in the text for it to match the pattern. The current repeat setting of Required (Exactly 1) is appropriate.

![Shows the repeat setting for the comma token which is set to "Exactly 1".](images/rule-add7.png "Shows the repeat setting for the comma token which is set to "Exactly 1".")
7.
: Enter a name for your stateful set. The name that you enter is used to create the name for your PVC in the format: <volume_name>-<statefulset_name>-<replica_number>.

serviceName
: Enter the name of the service that you want to use to expose your stateful set.

replicas
: Enter the number of replicas for your stateful set.

podManagementPolicy
: Enter the pod management policy that you want to use for your stateful set.



* OrderedReady: With this option, stateful set replicas are deployed one after another. For example, if you specified three replicas, then Kubernetes creates the PVC for your first replica, waits until the PVC is bound, deploys the stateful set replica, and mounts the PVC to the replica. After the deployment is finished, the second replica is deployed. For more information about this option, see [OrderedReady Pod Management](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/orderedready-pod-management)
* Parallel: With this option, the deployment of all stateful set replicas is started at the same time. If your app supports parallel deployment of replicas, then use this option to save deployment time for your PVCs and stateful set replicas.



matchLabels
: In the spec selector section, enter all labels that you want to include in your stateful set and your PVC. Labels that you include in the volumeClaimTemplates of your stateful set are not recognized by Kubernetes. Sample labels that you might want to include are:



* region and zone: If you want all your stateful set replicas and PVCs to be created in one specific zone, add both labels. You can also specify the zone and region in the storage class that you use. If you don't specify a zone and region and you have a multizone cluster, the zone in which your storage is provisioned is selected on a round-robin basis to balance volume requests evenly across all zones.
* billingType: Enter the billing type that you want to use for your PVCs.
Setting content caching time using "Time To Live" 

After your CDN is running, you can set your content caching time using Time To Live (TTL). The Time To Live for a particular file or directory path indicates how long that content should be cached. When you created the CDN Mapping, a default global TTL of 3600 seconds (1 hour) was created.

To set the content caching time using TTL, follow these steps:



1.  Open the page of a specified CDN mapping, click Settings from the navigation pane.
2.  Click Add path from the TTL settings.
3.  Adjust the time using the arrows, or by entering a new time. The time value is specified in seconds. For example, 3600 seconds is equal to 1 hour. The smallest value for timeToLive that you can choose is 0 seconds, while the largest is 2147483646 seconds (approximately 24855 days). Select the Save button to set the content caching time.
4.  After saving, you can Edit or Delete the TTL setting using the Overflow ![Overflow menu](https://cloud.ibm.com/docs-content/v1/content/006fd22ab2811b7d19804c763a00568b3da4c03a/CDN/images/overflow.png) options. (NOTE: The path for TTL cannot be changed. If the Mapping path is changed, the TTL path is updated automatically.)



*  When the content matches multiple rules, the most recently added configuration takes precedence.
*  TTL values can be set only for a specific file name or directory. Regular expressions are not supported because they might create unpredictable behavior.
options.SetResource(policyResource)
options.SetRule(policyRule)
options.SetPattern(core.StringPtr("time-based-conditions:once"))

policy, response, err := iamPolicyManagementService.V2CreatePolicy(options)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(policy, "", " ")
fmt.Println(string(b))

const policySubject = {
attributes: [
{
key: 'iam_id',
operator: 'stringEquals',
value: exampleUserId,
},
],
};
const policyResourceAccountAttribute = {
key: 'accountId',
value: exampleAccountId,
operator: 'stringEquals',
};
const policyResourceServiceAttribute = {
key: 'serviceName',
operator: 'stringEquals',
value: 'iam-groups',
};
const policyResource = {
attributes: [policyResourceAccountAttribute, policyResourceServiceAttribute]
};
const policyControl = {
grant: {
roles: [{
role_id: 'crn:v1:bluemix:public:iam::::role:Operator',
}],
}
};
const policyRule = {
operator: 'and',
conditions: [
{
key: '{{environment.attributes.current_time}}',
operator: 'dateTimeGreaterThanOrEquals',
value: '2022-12-23T00:00:00+00:00',
},
{
key: '{{environment.attributes.current_time}}',
set security vpn ipsec site-to-site peer <DC VPN Public IP> default-esp-group <esp group name>
set security vpn ipsec site-to-site peer <DC VPN Public IP> tunnel 1
set security vpn ipsec site-to-site peer <DC VPN Public IP> tunnel 1 protocol gre
commit







 Step 3: Configure data center VPN and tunnel 



1. The network team at the client data centre will configure an identical IPSec VPN connection with the <DC VPN Public IP> and <VRA Public IP> swapped, the local and remote tunnel address and also the <DC Subnet/CIDR> and <App Zone subnet/CIDR> parameters swapped. The specific configuration commands at the client data center will depend on the vendor of the VPN.
2. Validate that the public IP address of the DC VPN gateway is accessible over the internet before proceeding:

ping <DC VPN Public IP>
3. When data center VPN configuration is complete, the IPSec link should come up automatically. Verify that the link has been established and the status shows that there is one or more active IPsec tunnels. Verify with the data center that both ends of the VPN show active IPsec tunnels.

show vpn ipsec sa
show vpn ipsec status
4. If the link has not been created, validate that the local and remote addresses have been correctly specified and other parameters are as expected using the debug command:

show vpn debug



The line peer-<DC VPN Public IP>-tunnel-1: ESTABLISHED 5 seconds ago, <VRA Public IP>[500]....... should be found in the output. If this does not exist or shows 'CONNECTING' there is an error in the VPN configuration.





 Step 4: Define GRE tunnel 



1. Create the GRE tunnel in VRA edit mode.

set interfaces tunnel tun0 address <Local tunnel IP/24>
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 mtu 1300
You can customize your settings by using the --set option in the helm install command. Depending on the settings that you want to customize, you might need to prepare multiple --set options before you can install the Helm chart. For example, you might want to autoscale your default worker pool by preparing the following --set option. Note: If your default command line shell is zsh, start a bash session before running the following command.

--set workerpools[0].<pool_name>.max=<number_of_workers>,workerpools[0].<pool_name>.min=<number_of_workers>,workerpools[0].<pool_name>.enabled=(true|false)

workerpools[0]
: The first worker pool to enable or disable for autoscaling. You must include three parameters for each worker pool for the command to succeed: the maximum number of worker nodes (max), the minimum number of worker nodes (min), and whether you want to enable (true) or disable (false) autoscaling for this worker pool. To include multiple worker pools, include a comma-separated list and increase the number in brackets, such as: workerpools[0].default...,workerpools[1].pool1...,workerpools[2].pool2....

<pool_name>
: The name or ID of the worker pool that you want to enable or disable for autoscaling. To list available worker pools, run ibmcloud oc worker-pool ls --cluster <cluster_name_or_ID>.

max=<number_of_workers>
: Specify the maximum number of worker nodes per zone that the cluster autoscaler can scale up to. The value must be equal to or greater than the value that you set for the min=<number_of_workers> size.

min=<number_of_workers>
: Specify the minimum number of worker nodes per zone that the cluster autoscaler can scale down to. The value must be 2 or greater so that your ALB pods can be spread for high availability.
3. Select a Resource group.
4. Select a location for zone two for example: Dallas 2
5. Select the wanted number of IP addresses.
6. Leave the subnet access control list set to the default selection.
7. Leave the public gateway set to Detached.
8. Click Create subnet.
9. Repeat steps 1-8 for availability zone 2:



* Create a subnet that is called vpc-region1-zone2-app
* Create a subnet that is called vpc-region1-zone2-db1





To confirm that the subnets are created, click Subnets on the left pane and wait until the status changes to Available.







 Step 3: Create two security groups to allow only specific inbound traffic to the server and application 

To specify which traffic to allow to the application, you deploy rules, which you add to the virtual server instances in the later steps.



* Enable an inbound rule for SSH traffic to jumphost
* Enable specific ports for the corresponding application of each tier. For example, if the front-end server needs HTTP and HTTPs, then a security group is needed to allow for port 80 and 443.



To create the security groups:



1. Go to Security Groups.
2. Verify that the Regions setting is correct and if not then select the correct region, for example: Dallas
3. Click Create.
4. Create the security group vpc-region1-jumphost-sg:



1. Set the VPC to vpc-region1
2. Select your Resource Group
3. Add one Inbound rule: Set Protocol to TCP, Port Min and Max to 22, and Source Type to Any.
4. Add one Outbound rule: Set Protocol to All and Destination type to Any.



5. Create the security group vpc-region1-ui-sg:



1. Set the VPC to vpc-region1
2. Select your Resource Group
3. Add three Inbound rules: