/
Deploying TL-IDP Rackscale namespace

Deploying TL-IDP Rackscale namespace

This is a manual how to deploy Kubernetes resources for Tatraleasing IDP system.

  1. You have to be connected to Netgrif Rackscale Kubernetes Cluster.

  2. Download all of these files from k3s folder and save them to a standalone folder you like.

  3. Open your terminal and navigate to the folder, where the k8s files are saved.

  4. Check K8S cluster info.

    1. in your terminal type in kubectl cluster-info, you should see the following output

5. In your terminal, use the kubectl apply -k ./ command create secret, database deployment, storage PVC, service and ingress K8S resources.

6. Set up scheduler:

a) In cronJob.k8s.yaml file, there are two CronJob definitions, they have a required spec.schedule attribute. This attribute contains a CRON expression which defines when the CronJob creates a Job. The CRON expression follows the standard CRON syntax and looks like this:

# ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) # │ │ ┌───────────── day of the month (1 - 31) # │ │ │ ┌───────────── month (1 - 12) # │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday; # │ │ │ │ │ 7 is also Sunday on some systems) # │ │ │ │ │ OR sun, mon, tue, wed, thu, fri, sat # │ │ │ │ │ # * * * * *

Example: CronJob should create Job every day at 8:00 AM between dates 10th April - 15th April, then the CRON expression will look like this: 0 8 10-15 4 * .

b) The second required attribute for Job created by CronJob is spec.jobTemplate.spec.activeDeadlineSeconds. This defines, how long the Job will be active in seconds.

Example: if a Job should be active from 8:00 to 16:00, that is 8 hours of active state, in seconds it is (number of seconds in 1 minute) * (number of minutes in 1 hour) * (number of active hours) = activeDeadlineSeconds, that is 60 * 60 * 8 = 28800, so the spec.jobTemplate.spec.activeDeadlineSeconds should be set to 28800

7. In your terminal, use the kubectl apply -f cronJob.k8s.yaml to create CronJobs.