profile for Gajendra D Ambi on Stack Exchange, a network of free, community-driven Q&A sites

Tuesday, August 6, 2019

Terraform or Cloud Native Templates ?

What is terraform?
tldr. Terraform is a yaml templating engine which does infrastructure as code. You can have an entire or part of your IT infrastructure as some yaml code and deploy it to your private or public cloud.

What is Cloud Native Template?
Azure Resource Manager (ARM), AWS Cloud Formation (CF), Google Cloud Deployment Manager (CDM) are native templating engines just like terraform but mostly in json format.

Psql steps:
  1. provision an sql database
  2. Store secrets generated to some vault (ex:- credentials for the database)
  3. apply a custom configuration
  4. create few users and roles
  5. create few tables
  6. run pre defined psql commands against it
  7. connect it to some application
  1. AWS
  2. Azure
  3. GCP
Now let us say you are asked to develop 1 terraform template for each of the above endpoints (cloud providers) and also the Cloud Native Templates too.

Why Terraform?
86% Common Code and thus
  • 86% Faster design and discovery
  • 86% Faster development cycle
  • 86% Faster testing
  • 86% Faster deployment
  • 86% Faster UAT (User Acceptance Test)
  • 86% greater mobility between cloud vendors
  • Greater community support
  • Greater availability of code
  • Can write custom features, resources or providers if you are know go very well.
Why not terraform?
  • There are some features of cloud vendors which are not yet exposed in terraform by the vendor

Why Cloud native templates?
  • You are not planning to move your work load to another cloud or you don't mind vendor lock in.
  • You are looking for some features of the cloud providers which aren't yet available on terraform.
Why not Cloud Native Templates?
  • 86% slower design and discovery
  • 86% slower development cycle
  • 86% slower testing
  • 86% slower deployment
  • 86% slower  UAT (User Acceptance Test)
  • 86% lower mobility between cloud vendors
  • Lower community support
  • Lower availability of code
  • Can't write custom features, resources or providers if you are know go very well.

Thursday, March 7, 2019

Accessing kubernetes from your windows machine

Recently I had to install, configure and get one ICP [IBM Cloud Platform] with ICAM [IBM Cloud Automation manager] ready for a client.
Many of us who were setting this development environment for the client had windows and as you know windows is the last choice of most if not all developer but most get that as a standard issue.
So ICP is IBMs container platform which is a sophisticated enterprise ready kubernetes platform with all the bells, whistles and with batteries included.
So where when or If I say ICP or kubernetes or k8s then think any one of them since it is the same method for all.

  1. Locate the .kube directory on your k8s machine.
    • On linux/Unix it will be at /root/.kube
    • On windows it will be at C:/User/<username>/.kube  
  2.  copy the config file from the .kube folder of the k8s cluster to .kube folder of your local machine
  3. Copy 
    • client-certificate: /etc/cfc/conf/kubecfg.crt
    • client-key: /etc/cfc/conf/kubecfg.key
      to .kube folder of your local machine.
  4. Edit the config file in the .kube folder of your local machine and update the path of the kubecfg.crt and kubecfg.key on your local machine.
    • /etc/cfc/conf/kubecfg.crt --> C:\Users\<username>\.kube\kubecfg.crt
    • /etc/cfc/conf/kubecfg.key --> C:\Users\<username>\.kube\kubecfg.key
Now you should be able to interact with the cluster. Run 'kubectl get pods' and you will see the pods on the k8s cluster.