You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: environment-vars.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ subcollection: codeengine
15
15
# Working with environment variables
16
16
{: #envvar}
17
17
18
-
Learn how to work with environment variables (`env variables`) in {{site.data.keyword.codeengineshort}}. You can set environment variables as key-value pairs that can be used by your application, job, or function.
18
+
Learn how to work with environment variables (`env variables`) in {{site.data.keyword.codeengineshort}}. You can set environment variables as key-value pairs that can be used by your application, job, or function.
19
19
{: shortdesc}
20
20
21
21
## Creating and updating environment variables
@@ -74,7 +74,7 @@ The following table describes information about your environment variables.
74
74
75
75
For example, let's create an app and set environment variables for the app.
76
76
77
-
1.[Create an app](/docs/codeengine?topic=codeengine-deploy-app#deploy-app-console) that is named `myapp`, which uses the `icr.io/codeengine/codeengine` image. This `hello-world` app includes the `TARGET` environment variable, and the app prints `Hello ${TARGET} from {{site.data.keyword.codeengineshort}}` and prints a listing of environment variables. If the `TARGET`environment variable is empty, `Hello World from {{site.data.keyword.codeengineshort}}` is returned.
77
+
1.[Create an app](/docs/codeengine?topic=codeengine-deploy-app&interface=ui#deploy-app-console) that is named `myapp`, which uses the `icr.io/codeengine/codeengine` image. This `hello-world` app includes the `TARGET` environment variable, and the app prints `Hello ${TARGET} from {{site.data.keyword.codeengineshort}}` and prints a listing of environment variables. If the `TARGET`environment variable is empty, `Hello World from {{site.data.keyword.codeengineshort}}` is returned.
78
78
2. Go to this app in the console.
79
79
3. When the app is in `Ready` state, you can test your app. Click **Test application** and then click **Send request** in the Test application pane. To open the application in a web page, click **Application URL**. The `myapp` app returns a `Hello World from {{site.data.keyword.codeengineshort}}` response and prints the environment variables that are included in this app.
Copy file name to clipboardExpand all lines: subscription-kafka.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,7 @@ Create a {{site.data.keyword.codeengineshort}} app for connecting to your {{site
181
181
182
182
To create the `kafka-sender-app` application from the console, complete the following steps.
183
183
184
-
1. [Create a {{site.data.keyword.codeengineshort}} application](/docs/codeengine?topic=codeengine-deploy-app#deploy-app-console) that is called `kafka-sender-app` with the following information.
184
+
1. [Create a {{site.data.keyword.codeengineshort}} application](/docs/codeengine?topic=codeengine-deploy-app&interface=ui#deploy-app-console) that is called `kafka-sender-app` with the following information.
185
185
1. Reference the `icr.io/codeengine/kafka-sender` container image for this app. This image is built from `sender.go`, which is available from the [Samples for {{site.data.keyword.codeenginefull_notm}} GitHub repo](https://github.com/IBM/CodeEngine/tree/main/kafka){: external}. This sample sender app requires values for `password` and `BROKERS`.
186
186
2. In the **Environment variables (optional)** section, add the following environment variables.
187
187
1. Add a literal environment variable, `BROKERS`. For the value of this key, specify one or more of the broker hosts that are listed in the details of the service credentials in the {{site.data.keyword.messagehub}} service instance.
@@ -259,7 +259,7 @@ Complete the following steps to create a Kafka event subscription for an applica
259
259
3. Specify the name of existing topics for the message queues. For example, `kafka-topic1`. To obtain information about existing topics for your service instance, go to your service instance in the {{site.data.keyword.messagehub}} console and view **Topics**.
260
260
4. (Optional) Specify a consumer group. Consumers of Kafka messages can be grouped into [consumer groups](/docs/EventStreams?topic=EventStreams-consuming_messages#consumer_groups). If you are using consumer groups, the topic configuration controls the message flow to consumers in the consumer group. Whenever a consumer is added to or removed from a consumer group, the message flow from that topic might change. This action can cause existing consumers to no longer receive messages from that topic.
261
261
5. Click **Next** to proceed.
262
-
7. For **Event consumer**, specify the {{site.data.keyword.codeengineshort}} application to receive events. Notice that you can choose from a list of defined applications and jobs, or you can provide a name for an app (or job) that is not yet created. It is not necessary that the app or job exist when you create the event subscription with the console. However, when the subscription is created, the status of the subscription reflects that the consumer does not exist. You must create the app or job before the subscription is in a ready state and can receive events through this subscription. For this example, use the `kafka-receiver-app` application that references the `icr.io/codeengine/kafka-receiver` image. If your app does not exist, provide the name of your application and [create your application](/docs/codeengine?topic=codeengine-deploy-app#deploy-app-console) after you create the Kafka subscription. For applications only, you can optionally specify a path. By default, events are routed to the root URL of the destination application. You can send events to a different destination within the app by specifying a path. For example, if your subscription path specifies `/events`, the events are sent to `https://<base application URL>/events`. Click **Next** to proceed.
262
+
7. For **Event consumer**, specify the {{site.data.keyword.codeengineshort}} application to receive events. Notice that you can choose from a list of defined applications and jobs, or you can provide a name for an app (or job) that is not yet created. It is not necessary that the app or job exist when you create the event subscription with the console. However, when the subscription is created, the status of the subscription reflects that the consumer does not exist. You must create the app or job before the subscription is in a ready state and can receive events through this subscription. For this example, use the `kafka-receiver-app` application that references the `icr.io/codeengine/kafka-receiver` image. If your app does not exist, provide the name of your application and [create your application](/docs/codeengine?topic=codeengine-deploy-app&interface=ui#deploy-app-console) after you create the Kafka subscription. For applications only, you can optionally specify a path. By default, events are routed to the root URL of the destination application. You can send events to a different destination within the app by specifying a path. For example, if your subscription path specifies `/events`, the events are sent to `https://<base application URL>/events`. Click **Next** to proceed.
263
263
8. For **Summary**, review the settings for your Kafka event subscription and make changes, if needed. When ready, click **Create** to create the Kafka subscription.
264
264
265
265
#### Sending events to the receiving app from the console
@@ -303,7 +303,7 @@ Before you begin
303
303
304
304
* [Create and work with a project](/docs/codeengine?topic=codeengine-manage-project).
305
305
306
-
1. [Create an {{site.data.keyword.codeengineshort}} application](/docs/codeengine?topic=codeengine-deploy-app#deploy-app-cli) to act as an event consumer of Kafka messages and receive the Kafka events. For example, create an application that is called `kafka-receiver-app2` that uses the `icr.io/codeengine/kafka-receiver` image. This image is built from `receiver.go`, which is available from the [Samples for {{site.data.keyword.codeenginefull_notm}} GitHub repo](https://github.com/IBM/CodeEngine/tree/main/kafka){: external}. This sample does not require any environment variables. You can optionally specify the `--min-scale=1` option, such that the app always has an instance that is running and does not scale to zero. Configuring the app to always have a running instance is useful when you view logs. If you are running in a production environment, consider the cost of keeping a running instance of your app or whether you want {{site.data.keyword.codeengineshort}} to autoscale to zero. By default, the app scales to zero when not in use.
306
+
1. [Create an {{site.data.keyword.codeengineshort}} application](/docs/codeengine?topic=codeengine-deploy-app&interface=cli#deploy-app-cli) to act as an event consumer of Kafka messages and receive the Kafka events. For example, create an application that is called `kafka-receiver-app2` that uses the `icr.io/codeengine/kafka-receiver` image. This image is built from `receiver.go`, which is available from the [Samples for {{site.data.keyword.codeenginefull_notm}} GitHub repo](https://github.com/IBM/CodeEngine/tree/main/kafka){: external}. This sample does not require any environment variables. You can optionally specify the `--min-scale=1` option, such that the app always has an instance that is running and does not scale to zero. Configuring the app to always have a running instance is useful when you view logs. If you are running in a production environment, consider the cost of keeping a running instance of your app or whether you want {{site.data.keyword.codeengineshort}} to autoscale to zero. By default, the app scales to zero when not in use.
307
307
308
308
```txt
309
309
ibmcloud ce app create -n kafka-receiver-app2 --image icr.io/codeengine/kafka-receiver --min-scale 1
0 commit comments