Code Monkey home page Code Monkey logo

ansible-collection-k8s's Issues

Packaged collection has git related files

roles/k8s_manifests/.git

Files like above should not be packaged in the collection, having that file breaks git status and other commands, and prevents ansible-test from working when that collection is installed.

Where to give details of k8s master and worker node

Hi All,

I am new to ansible and trying to set up k8s cluster using this collection.
I have installed ansible and define master node and worker node details in /etc/ansible/hosts file.
I am not sure where to mention these node details if I use geerlingguy/ansible-collection-k8s collection.

I have gone through all yml files but no luck.

Please help me.

Build k8s_template module

See: ansible/ansible#60134

Basically build a module that makes it simpler to pass in a template (e.g. my-manifest.yml) which can have one or more YAML documents. Parse each document separately, template it via Jinja2, and then pass it to the K8s API as the normal k8s module does...

Add molecule test scenario for kubernetes role

I added a simple test scenario that verifies the k8s_manifests role in #1, now I'd like to add a scenario that verifies the kubernetes role.

I could use the ubuntu1804 or debian10 ansible base image and then run the role inside with defaults.

Add molecule tests for Travis CI

The basic idea:

  1. Have a playbook that runs the kubernetes role to set up kubernetes on a single node instance.
  2. Same playbook then runs k8s_manifests with a test deployment of something (e.g. prometheus or maybe even something simpler).

Never fail, and after it only do if failed is conflicting!

Can you please help! I can't setup dashboard

- name: Check if Kubernetes Dashboard UI service already exists.
  shell: kubectl get services --namespace kube-system | grep -q kubernetes-dashboard
  changed_when: false
  **failed_when: false**
  register: kubernetes_dashboard_service
  when: kubernetes_enable_web_ui | bool

- name: Enable the Kubernetes Web Dashboard UI (if configured).
  command: "kubectl create -f {{ kubernetes_web_ui_manifest_file }}"
  when:
    - kubernetes_enable_web_ui | bool
    - **kubernetes_dashboard_service is failed**

The output if I run is the following

TASK [geerlingguy.kubernetes : Check if Kubernetes Dashboard UI service already exists.] **************************************************************************************************************************************************************************************
ok: [193.224.23.11]

TASK [geerlingguy.kubernetes : Enable the Kubernetes Web Dashboard UI (if configured).] ***************************************************************************************************************************************************************************************
skipping: [193.224.23.11]

If I run the command it fails, only the failed_when: false override it

$ ansible -i hosts -b -u debian k8s-1 -m shell -a "kubectl get services --namespace kube-system | grep -q kubernetes-dashboard"

193.224.23.11 | FAILED | rc=1 >>
non-zero return code

$ 

Any hint would be appreciated!
Thanks!

Add `k8s_wait` module

Just wanted to throw this out here, since it's something that would be convenient in a number of circumstances.

A common pattern for K8s deployments is:

  1. Apply a manifest to create a new Deployment.
  2. Wait for all the Pods in this Deployment to be Ready.
  3. Do other stuff.

Currently, for number 2, you can futz around with the returned data from k8s or k8s_info and use until/retries to get something working, or you can do a more simple method (if you have kubectl available) using kubectl wait:

kubectl wait --for=condition=Ready pods --selector app=my-app-name --timeout=60s

At a basic level, I'd want something like:

- name: Wait for my-app-name pods to be ready.
  k8s_wait:
    for: condition=Ready
    type: pods
    selector:
      - app=my-app-name
    timeout: 60s

Something along those lines... not sure. But it would be nice to be able to specify this in a more structured way, and not have to rely on kubectl being present for a task like:

- name: Wait for my-app-name pods to be ready.
  command: >
    kubectl wait --for=condition=Ready
    pods --selector app=my-app-name --timeout=60s
  changed_when: false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.