@@ -121,7 +121,7 @@ data:
121121Apply the updated ConfigMap to your cluster :
122122
123123` ` ` bash
124- kubectl apply -f tekton-hub-api-configmap.yaml
124+ $ kubectl apply -f tekton-hub-api-configmap.yaml
125125` ` `
126126
127127# ## Step 4: Apply Changes
@@ -130,7 +130,7 @@ After updating the ConfigMap, apply the changes:
130130
131131**Option 1: Restart the API Pod**
132132` ` ` bash
133- kubectl rollout restart deployment/ tekton-hub-api -n <tekton-pipelines>
133+ $ kubectl delete pod app= tekton-hub-api -n <tekton-pipelines>
134134` ` `
135135
136136**Option 2: Wait for Automatic Refresh**
@@ -195,7 +195,7 @@ For accessing private Git repositories or repositories from private Git instance
195195Create a Kubernetes secret named `tekton-hub-api-ssh-crds` with your SSH credentials :
196196
197197` ` ` bash
198- kubectl create secret generic tekton-hub-api-ssh-crds \
198+ $ kubectl create secret generic tekton-hub-api-ssh-crds \
199199 --from-file=id_rsa="/path/to/id_rsa" \
200200 --from-file=id_rsa.pub="/path/to/id_rsa.pub" \
201201 --from-file=known_hosts="/path/to/known_hosts" \
@@ -207,9 +207,38 @@ kubectl create secret generic tekton-hub-api-ssh-crds \
207207- The secret must be created in the same namespace as your Tekton Hub installation
208208- Include all three files : private key, public key, and known_hosts
209209
210- # ### Example known_hosts Entry
210+ # ### Generating known_hosts Entries
211211
212- For GitHub repositories, add this line to your `known_hosts` file :
212+ **Important**: You must generate the `known_hosts` file by actually connecting to the Git server to capture its SSH fingerprint. Simply copying example entries may not work due to server key changes or different Git providers.
213+
214+ **Recommended Approach:**
215+
216+ 1. **Test SSH connection locally** to capture the server's fingerprint :
217+ ` ` ` bash
218+ # This will add the server's fingerprint to your local known_hosts
219+ 220+ 221+ ` ` `
222+
223+ 2. **Alternative : Use ssh-keyscan** to generate known_hosts entries:
224+ ` ` ` bash
225+ # For GitHub
226+ $ ssh-keyscan github.com >> ~/.ssh/known_hosts
227+
228+ # For custom Git servers
229+ $ ssh-keyscan your-git-server.com >> ~/.ssh/known_hosts
230+ ` ` `
231+
232+ 3. **Verify by cloning your repositories locally** using both URLs :
233+ ` ` ` bash
234+ # Test the SSH URL that will be used by Tekton Hub
235+ $ git clone ssh://[email protected] :org/private-repo.git 236+
237+ # Also test the HTTPS URL for verification
238+ $ git clone https://github.com/org/private-repo.git
239+ ` ` `
240+
241+ **Example known_hosts Entry** (generated after successful SSH connection):
213242
214243```
215244github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndN...
@@ -239,17 +268,33 @@ data:
239268
240269After adding a custom catalog, verify it's properly configured:
241270
242- > **Tips**: `your-tekton-hub-api` should be replaced with your actual Tekton Hub API endpoint.
271+ > ** Tips** : The default Tekton Hub API endpoint is ` tekton-hub-api.tekton-pipelines:8000 ` , which is only accessible within the cluster.
272+ >
273+ > For the ` <your-tekton-hub-api> ` placeholder in the commands below:
274+ > - Inside the ` tekton-hub-api ` pod: use ` localhost:8000 `
275+ > - From other pods in the cluster: use ` tekton-hub-api.tekton-pipelines:8000 `
276+ > - From outside the cluster: create a ` NodePort ` service or ` Ingress ` (not covered in this guide)
277+ >
278+ > For testing purposes, you can run these commands inside the ` tekton-hub-api ` pod using ` wget ` .
243279
244280``` bash
281+ # Execute inside the tekton-hub-api pod for testing
282+ $ kubectl exec -it deployment/tekton-hub-api -n < tekton-pipelines> -- /bin/sh
283+
245284# Check if the catalog appears in the API
246- curl https://your-tekton-hub-api/v1/catalogs
285+ $ wget -qO- http://< your-tekton-hub-api> /v1/catalogs
286+
287+ {" data" :[{" id" :1," name" :" catalog" ," type" :" community" ," url" :" file:////mnt/git/catalog.git" ," provider" :" github" },{" id" :2," name" :" <new-catalog>" ," type" :" private" ," url" :" <url>" ," provider" :" <provider>" }]}
247288
248289# Check catalog resources
249- curl https://your-tekton-hub-api/v1/resources?catalog=my-custom-catalog
290+ $ wget -qO- " http://<your-tekton-hub-api>/v1/query?catalogs=<my-custom-catalog>"
291+
292+ {" data" :[{" id" :1," name" :" <name>" ," catalog" :{" id" :1," name" :" <my-custom-catalog>" ," type" :" community" }," categories" :[{" id" :9," name" :" <name>" }]," kind" :" Task" ," hubURLPath" :" " ," hubRawURLPath" :" " }]}
250293
251294# Verify specific resource
252- curl https://your-tekton-hub-api/v1/resource/my-custom-catalog/task/my-task
295+ $ wget -qO- http://< your-tekton-hub-api> /v1/resource/< my-custom-catalog> /task/< my-task>
296+
297+ {" data" :{" id" :4," name" :" <my-task>" ," catalog" :{}}}
253298```
254299
255300### Test Resource Resolution
@@ -285,8 +330,8 @@ spec:
285330
286331**Solutions**:
2873321. Check ConfigMap was applied: ` kubectl get cm tekton-hub-api -o yaml`
288- 2. Restart API pod : ` kubectl rollout restart deployment/ tekton-hub-api`
289- 3. Check API logs : ` kubectl logs deployment/tekton-hub-api`
333+ 2. Restart API pod : ` kubectl delete pod app= tekton-hub-api -n <tekton-pipelines> `
334+ 3. Check API logs : ` kubectl logs deployment/tekton-hub-api -n <tekton-pipelines> `
290335
291336# ## Resources Not Loading
292337
@@ -322,11 +367,42 @@ spec:
322367**Debug Steps**:
323368` ` ` bash
324369# Check available catalogs
325- curl https ://your-tekton-hub-api/v1/catalogs
370+ $ wget -qO- http ://< your-tekton-hub-api> /v1/catalogs
326371
327372# Verify resource exists
328- curl https ://your-tekton-hub-api/v1/resource/catalog-name /task/task-name/0.1
373+ $ wget -qO- http ://< your-tekton-hub-api> /v1/resource/<my-custom-catalog> /task/<my-task>/<version>
329374
330375# Check catalog sync status
331- kubectl logs deployment/tekton-hub-api | grep "catalog-name"
376+ $ kubectl logs deployment/tekton-hub-api -n <tekton-pipelines>
332377` ` `
378+
379+ # # FAQ
380+
381+ # ## Q: I configured according to the documentation, but still can't see the new catalog
382+
383+ **A**: First, check the `tekton-hub-api` logs for authentication-related errors such as "Host key verification failed":
384+
385+ ` ` ` bash
386+ $ kubectl logs deployment/tekton-hub-api -n <tekton-pipelines>
387+ ` ` `
388+
389+ **Common causes**:
390+ - SSH key lacks sufficient permissions for the repository
391+ - ` known_hosts` file missing the Git server's fingerprint
392+ - SSH key not properly added to repository deploy keys
393+
394+ **Solution**:
395+ 1. **Test locally first** : Ensure you can successfully clone the repository locally using the same SSH credentials:
396+ ` ` ` bash
397+ # Test with the exact same SSH key and known_hosts
398+ $ git clone ssh://[email protected] :org/private-repo.git 399+ ` ` `
400+
401+ 2. **Only after local clone succeeds**, update your Kubernetes environment :
402+ - Refer to the [Generating known_hosts Entries](#generating-known_hosts-entries) section to properly generate the `known_hosts` file
403+ - Recreate the `tekton-hub-api-ssh-crds` secret with the working credentials
404+ - Restart the `tekton-hub-api` pod and check the logs :
405+ ` ` ` bash
406+ $ kubectl delete pod -l app=tekton-hub-api -n <tekton-pipelines>
407+ $ kubectl logs deployment/tekton-hub-api -n <tekton-pipelines>
408+ ` ` `
0 commit comments