@@ -101,8 +101,101 @@ ENTRYPOINT ["/discovery-handler"]
101101
102102## Deploying the Discovery Handler
103103
104- After building the Discovery Handler, we need to push the Docker image into a registry.
105- Then we can create an Akri Configuration that uses this Discovery Handler
106- to discover compatible devices, as shown in the [ instructions ] ( ./../getting-started/installation.md#installation )
104+ After building and pushing the Discovery Handler image to a registry, we are ready
105+ to create an Akri Configuration that uses this Discovery Handler to discover
106+ compatible devices.
107107
108- <!-- TODO: Change link to point to actual instructions! -->
108+ ### Create Akri configuration
109+
110+ The easiest way to achieve this is by using Helm template to create the
111+ a YAML file containing all the required resources based on a minimal YAML definition
112+ file.
113+
114+ In this file, we can specify the name of our Akri Configuration,
115+ which Discovery Handler we will use, the discovery details that
116+ the DH will use the perform the device discovery, as well as
117+ which Broker Pod should be deployed for every discovered device:
118+
119+ ``` yaml
120+ # onboarding-config-template.yaml
121+
122+ controller :
123+ enabled : false
124+ agent :
125+ enabled : false
126+ cleanupHook :
127+ enabled : false
128+ rbac :
129+ enabled : false
130+ webhookConfiguration :
131+ enabled : false
132+ useLatestContainers : false
133+ custom :
134+ configuration :
135+ enabled : true
136+ name : http-range-onboard # The name of akric
137+ capacity : 2
138+ discoveryHandlerName : http-discovery-onboard # name of discovery handler, must be unique and matching discovery.name. will be used for socket creation
139+ discoveryDetails : | # make sure this is valid YAML
140+ ipStart: 192.168.11.20
141+ ipEnd: 192.168.11.100
142+ applicationType: initial
143+ secure: true
144+ brokerPod :
145+ image :
146+ repository : docker.io/gntouts/pause
147+ tag : latest
148+ discovery :
149+ enabled : true
150+ image :
151+ repository : harbor.nbfc.io/nubificus/iot/akri-discovery-handler-go
152+ tag : latest
153+ name : http-discovery-onboard # name of discovery handler, must be unique and matching custom.configuration.discoveryHandlerName
154+ ` ` `
155+
156+ > **Note:** The name of the Akri configuration (` .custom.configuration.name`) must
157+ > be unique.
158+ > Similarly, the Discovery Handler name defined in the configuration section
159+ > (`.custom.configuration.discoveryHandlerName`) and the name defined in the
160+ > discovery section (`.custom.discovery.name`) must both be
161+ > unique **and** identical.
162+ > It is not possible for Discovery Handlers from different Akri Configurations
163+ > to share the same name,
164+ > as the name is used to create the socket that the Discovery service listens on.
165+
166+ Now, let's create the actual YAML file that will be applied to Kubernetes using Helm :
167+
168+ ` ` ` bash
169+ helm template akri akri-helm-charts/akri -f onboarding-config-template.yaml > onboarding-config.yaml
170+ ` ` `
171+
172+ Finally, let's apply it to create the Akri Configuration :
173+
174+ ` ` ` bash
175+ kubectl apply -f ./onboarding-config.yaml
176+ ` ` `
177+
178+ We should now be able to see the deployed Pods of our Discovery Handler :
179+
180+ ` ` ` console
181+ $ kubectl get pods | grep http-onboard
182+ http-discovery-onboard-daemonset-8r9nl 1/1 Running 0 1m
183+ http-discovery-onboard-daemonset-d5frl 1/1 Running 0 1m
184+ http-discovery-onboard-daemonset-htlbd 1/1 Running 0 1m
185+ ` ` `
186+
187+ # ## Delete Akri configuration
188+
189+ If we want to delete the Akri Configuration, we need to either use the
190+ generated YAML file :
191+
192+ ` ` ` bash
193+ kubectl delete -f ./onboarding-config.yaml
194+ ` ` `
195+
196+ Or delete the Akri Configuration and DaemonSet manually :
197+
198+ ` ` ` bash
199+ kubectl delete akric http-range-onboard
200+ kubectl delete daemonset http-discovery-onboard-daemonset
201+ ` ` `
0 commit comments