顯示具有 English 標籤的文章。 顯示所有文章
顯示具有 English 標籤的文章。 顯示所有文章

2019年5月9日 星期四

DevOps Tip - Got error - not found aws-iam-authenticator for kubectl using?


Problem

I've got error to run kubectl command with aws-iam-authenticator not found

(venv) ➜  k8s git:(develop) ✗ kubectl get pod
Unable to connect to the server: getting credentials: exec: exec: "aws-iam-authenticator": executable file not found in $PATH


Solutions

Installation tool on OSX Mojave

brew install aws-iam-authenticator

Example of installation

 (venv) ➜  k8s git:(develop) ✗ brew install aws-iam-authenticator
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and caskroom/cask).
==> New Formulae
..
==> Downloading https://homebrew.bintray.com/bottles/
aws-iam-authenticator-0.4.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/52...
######################################################################## 100.0%
==> Pouring aws-iam-authenticator-0.4.0.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/aws-iam-authenticator/0.4.0: 5 files, 31.1MB

References


2019年1月30日 星期三

DevOps Tip - How to use terraform apply without prompt and input yes for CI/CD?

Problem

Took a memo about integration of CI/CD applied by terraform without prompt to input 'yes'
It is annoying to input yes every time if you already make sure already by `terraform plan`.
On the other hand, I need to integrate with different system for CI/CD. I need a way to approve it automatically.
By tests with commands official documents, I found the correct command and arguments.

Tested Solutions


    terraform apply -input=false -auto-approve

or as my test, you can shorten to the following command

    terraform apply -auto-approve

Test Environments

  • Ubuntu 16.04.04 LTS
  • OSX 10.14

Reference:




Extended Reading



2019年1月29日 星期二

DevOps Tip - How to use shared terraform plugins by -plugin-dir argument?


Problem


If you executed `terraform init`, you may already have the .terraform in your folder.


Because you may have many terraform repo similar to another, you can use the -plugin-dir to reduce the usage of disk space.

As a shared plugins so that we don’t need many copies of plugins into different locations.

Example

  • Here I used my OSX Macbook as a Demo Environment.
  ====================
  cd /build/setupdev/
    sudo mkdir -p  /opt/terraform/terraform.d
mv .terraform/plugins to /opt/terraform/terraform.d/plugins


  • Please run the following command to apply it.
  ====================
terraform init -input=false \
-plugin-dir=/opt/terraform/terraform.d/plugins/darwin_amd64





Tree of .terraform

Tree of terraform plugins

Reference