ansible module for EKS cluster

12/4/2019

i'm trying to automate deployment in eks cluster using k8s ansible module. It's seem that k8s module doesn't support EKS.

does anyone have an example of managing objects in eks using k8s ansible module.

Thanks in advance.

-- Chawki
ansible
eks
kubectl
kubernetes

1 Answer

12/6/2019

Thanks everyone, for your comments, it finally works.

I just reconfigure the file ~/.kube/kubeconfig and set the good config in ~/.aws/.

Snippet of the Ansible task:

- name: "deploy app"
  k8s:
    kubeconfig: "{{ kube_config }}"
    namespace: "default"
    state: "present"
    src: "{{ item }}"
  with_items:
    - "{{ data_dir }}/{{ instance_name }}/deployment/deployment_file_1.yml"
    - "{{ data_dir }}/{{ instance_name }}/deployment/deployment_file_2.yml"
    - "{{ data_dir }}/{{ instance_name }}/deployment/deployment_file_3.yml"
-- Chawki
Source: StackOverflow