• kubernetes services: externalName

    2 min read

    externalName service kubernetes

    One of kind of Service objects on kubernetes is extenalName. It creates a CNAME DNS entry to point to an external DNS service. For exemple:

    kind: Service
    apiVersion: v1
    metadata:
      name: ensvc
    spec:
      type: ExternalName
      externalName: pet2cattle.com
    

    29/01/2021

    Read more...
  • Getting a terraform plan in json format

    2 min read

    terraform plan json terraform show

    Starting terraform v0.12 we can get the terraform plan in json format. To do so, first we will need to save the plan to a file:

    $ terraform plan -out demo.plan
    

    28/01/2021

    Read more...
  • How to conditionally include a resource in terraform

    1 min read

    terraform conditionally include resource HCL

    On terraform modules sometimes it make sense to completely get rid of some resources using some condition. Since we don't have an if statement, we can use count instead

    27/01/2021

    Read more...
  • Ansible: Test a task by applying it locally

    2 min read

    If you need to test a set of ansible tasks without having to go into much trouble, you can use ansible-playbook to do a quick local test. To do so you just need ansible installed and create a yaml file with the playbook to execute using the following format:

    ---
    - hosts: 127.0.0.1
      tasks:
      - name: mkdir /tmp/test
        command: 
          cmd: mkdir -p /tmp/test
    

    26/01/2021

    Read more...
  • kubectl: set a given namespace as your default

    2 min read

    kubernetes default namespace

    When you need to work on some specific namespace it is quite annoying yo have to specify at each kubectl command the same namespace over and over again. It's much easier to change the current context to use another namespace by default.

    25/01/2021

    Read more...

More recent...

Older content...