How to Specify Kubernetes YAML Files for Pod Creation for CI Jobs

Problem to solve

How to Specify Kubernetes YAML Files for Pod Creation for CI Jobs

I have a GitLab setup where we are using Kubernetes for CI/CD pipelines, and we would like to allow users to define Kubernetes pod specifications via YAML files stored in a shared folder. Currently, it is not possible in GitLab CI/CD to directly specify a Kubernetes YAML file for pod creation in the job configuration.
The idea is to allow users to specify a required YAML file name for each job, with the file stored in a central folder within the project repository. These YAML files should be dynamically referenced in the pipeline to create Kubernetes pods for the jobs.
Users should be able to specify the name of the YAML file containing the Kubernetes pod specification for a given job.
These YAML files can be stored in a shared folder within the project repository and users would simply specify the YAML file name as input for a job to create Kubernetes pods for the jobs.
Is there a way to implement this feature in GitLab CI/CD to allow users to reference Kubernetes YAML files for pod creation in their pipelines?

  • Self-managed
  • GitLab.com SaaS
  • Dedicated
  • Self-hosted Runners

Thanks for taking the time to be thorough in your request, it really helps! :blush: