Practical Operation Guide
This guide provides manual for Kurator pipelines, detailing steps for applying predefined and custom tasks, exposing services, configuring GitHub webhooks, and monitoring pipeline execution, aimed at efficient and effective pipeline management in Kubernetes environments.
Applying Pipeline Examples
This section demonstrate the practical operation of Kurator pipelines, highlighting two key examples: one with a predefined task and another with a custom task. These examples provide insights into the functionality and adaptability of Kurator pipelines in different scenarios.
Creating a Namespace
The first step involves creating a dedicated namespace in Kubernetes.
This namespace will be used for all subsequent resource deployments related to our pipeline examples.
Applying a Pipeline with Predefined Task
In this example, we illustrate how to apply a pipeline that incorporates a predefined task.
This setup includes a git-clone
task, which is a common initial step in many pipelines, followed by a predefined go-test
task.
This combination effectively demonstrates the utility and ease of using predefined tasks in a Kurator pipeline.
Applying a Pipeline with Custom Task
This example shows the config of a pipeline with a custom task.
It begins with the same git-clone
task as in the previous example.
Then, it introduces a custom task designed to display the contents of the README file from the cloned repository.
This example shows the flexibility of Kurator pipelines, allowing users to tailor tasks to their specific needs.
Viewing Event Listener Services
After successfully creating the above resources, users can view the automatically generated services and corresponding pods in Kubernetes.
Exposing Services and Webhook Settings
Within the Kubernetes cluster, both el-test-custom-task-listener
and el-test-predefined-task-listener
are configured as ClusterIP services,
meaning they are only accessible internally.
To enable external systems, like webhooks, to access these services, we need to expose them outside the cluster.
For demonstration and testing convenience, a straightforward method for this is by using the kubectl port-forward
command,
which allows us to forward a port from an internal service to a local server or computer.
Exposing Services
For demonstration and testing convenience, it’s necessary to open separate windows for exposing each service.
To expose the el-test-custom-task-listener
service, execute the following command in a new window:
Similarly, for the el-test-predefined-task-listener
service, use another window to execute this command:
Setting up Webhooks for Pipeline
The pipeline events here are triggered via GitHub webhooks. This means that once the webhooks are configured to trigger on certain events, like code merges, the tasks described in the pipeline will automatically execute in sequence.
To set up webhooks for the pipeline, select the GitHub repository you want to associate with the pipeline.
For guidance on creating the webhook,
refer to the official GitHub documentation at Creating Webhooks.
In our example, the Payload URL
should be set to your cluster’s external address plus port numbers 30000 and 30001,
and the trigger event selected as “Just the push event.”
Once the webhook is set up, you will see the status in GitHub page like the following indicating that the webhook is properly configured.
After setting up webhooks, it’s need to note that users may initially see a red exclamation mark instead of a green check mark. Once a webhook is successfully triggered for the first time, the icon will change to a green check mark, indicating that everything is functioning correctly.
Triggering the Pipeline
Trigger the Github Event
To trigger the pipeline, you might try pushing some content to the repository, such as a modification to the README. Information about the received event can be observed in the window where the forward service is running.
After the pipeline is triggered, the system will create individual pods for each task in the pipeline, executing them in order. You can view the current task execution status with a specific command.
View the Results of the Pipeline Execution
The actual execution details of each task can be viewed in the corresponding pods. Besides the more cumbersome method of checking each one individually, Kurator’s CLI provides a very convenient way to view the execution status of a pipeline, which user can directly list all the pipeline execution and access all task execution logs with a specific command.
You can view the execution instance of the currently triggered pipeline using the following command.
Note: You need to specify the kubeconfig file to use via the --kubeconfig
flag in the command line, even if you are running the Kurator Pipeline in a single cluster environment.
After obtaining the Execution Name
, you can directly retrieve the execution logs for all tasks using the following method:
For more information on how to use Kurator pipeline-related CLI commands, you can refer to the provided command help.
Cleanup
To remove the pipeline examples used for testing, execute:
Please note: When the pipeline of Kurator is deleted, all the resources it created, including the pods of tasks and the services of event listener, will be deleted as well.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.