• How to trigger a Kubernetes cronjob manually

    If you deploy a cronjob it can be useful to test it out by manually triggering a run rather than to wait until it is run according by it's schedule.

    Let's assume we have the following cronjob that we want to run:

    $ kubectl get cronjob
    NAME                    SCHEDULE    SUSPEND   ACTIVE   LAST SCHEDULE   AGE
    pet2cattle-sitemapgen   0 5 * * *   False     0        <none>          13m
    

    21/01/2021

    Read more...
  • kubectl: create a cronjob

    Even though the job object is GA, at least as for kubernetes v1.20.0, the cronjob object is not GA yet, let's take a look how the beta version works bearing in mind that this can change in the future

    $ kubectl create job demo --image nginx --dry-run=client -o yaml  | head -n1
    apiVersion: batch/v1
    $ kubectl create cronjob demo --image nginx --schedule="*/1 * * * *" -o yaml --dry-run=client | head -n1
    apiVersion: batch/v1beta1
    

    20/01/2021

    Read more...
  • Multinode kubernetes cluster using minkube

    Minikube is very useful for creating mockup environments for testing purposes, but it can be also use for studying yout CKA certification. Some topics, like node affinity or node failure will require you to have a multinode cluster but you can still use minikube

    19/01/2021

    Read more...
  • helm: Rollback an upgrade

    When we upgrade an application using helm it can always go something wrong so instead of upgrading to another version or uninstall / install the application, we can rollback to a previous version that we know it is working

    Previously we already talked about the helm history command

    $ helm history pet2cattle
    REVISION  UPDATED                   STATUS      CHART           APP VERSION DESCRIPTION     
    60        Wed Dec 30 16:17:58 2020  superseded  pet2cattle-1.7  2.8         Upgrade complete
    61        Fri Jan  1 21:45:07 2021  superseded  pet2cattle-2    3           Upgrade complete
    62        Sat Jan  2 11:57:26 2021  superseded  pet2cattle-2    3.1         Upgrade complete
    63        Sat Jan  2 22:09:24 2021  superseded  pet2cattle-2    3.2         Upgrade complete
    64        Mon Jan  4 09:33:53 2021  superseded  pet2cattle-2    3.3         Upgrade complete
    65        Tue Jan  5 07:57:53 2021  superseded  pet2cattle-2    3.4         Upgrade complete
    66        Wed Jan  6 15:25:30 2021  superseded  pet2cattle-2    3.5         Upgrade complete
    67        Thu Jan  7 09:10:07 2021  superseded  pet2cattle-2    3.6         Upgrade complete
    68        Fri Jan  8 08:17:56 2021  superseded  pet2cattle-2    3.7         Upgrade complete
    69        Sat Jan  9 19:23:25 2021  deployed    pet2cattle-2    3.8         Upgrade complete
    

    Let's assume that the latest deployed versions is not working.

    18/01/2021

    Read more...
  • Helm diff using a plugin

    Just as with kubectl diff, there's a helm plugin that helm us to the the actual differences that it will apply to the kubernetes cluster without much of the clutter that we will find by combining kubectl diff with the yaml output of a helm dry-run

    15/01/2021

    Read more...

Older content...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets