Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ansible module for EKS cluster

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.

like image 850
Chawki Avatar asked Dec 18 '25 16:12

Chawki


1 Answers

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"
like image 116
Chawki Avatar answered Dec 20 '25 06:12

Chawki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!