Code Monkey home page Code Monkey logo

Comments (4)

jkinred avatar jkinred commented on June 21, 2024

If you are trying to achieve the same result as me, which is to pin an earlier PATCH version: 1.24.1, then I have succeeded like so:

  roles:
    - name: geerlingguy.kubernetes
      vars:
        kubernetes_version: 1.24
        # NOTE(jkinred): The way that the kubernetes role pins versions is not
        # functional enough to specify a patch version, we must be explicit here
        kubernetes_packages:
          - name: kubelet={{ kubernetes_version }}.1-00
            state: present
          - name: kubectl={{ kubernetes_version }}.1-00
            state: present
          - name: kubeadm={{ kubernetes_version }}.1-00
            state: present
          - name: kubernetes-cni
            state: present

I have found that this role is built to pin MINOR versions by using e.g. kubernetes_version: 1.23 and this works. The underlying cause is the way that the APT pinning is created with .* appended.

Specifying a MAJOR.MINOR.PATCH version in kubernetes_version generates a pinning specification like this:

root@u22:~# cat /etc/apt/preferences.d/kubernetes
Package: kubectl
Pin: version 1.24.1.*
Pin-Priority: 1000
<SNIP>

...noting that the last '.' is a literal dot and a package with version 1.24.1-00 will not match.

from ansible-role-kubernetes.

robin-checkmk avatar robin-checkmk commented on June 21, 2024

We are not using the patch level, we just specify kubernetes_version: 1.23 but still the binaries are installed with version 1.24.
But thanks for the input!

from ansible-role-kubernetes.

jkinred avatar jkinred commented on June 21, 2024

We are not using the patch level, we just specify kubernetes_version: 1.23 but still the binaries are installed with version 1.24. But thanks for the input!

Using the variables as above should still have the same outcome of installing the versions you want.

from ansible-role-kubernetes.

robin-checkmk avatar robin-checkmk commented on June 21, 2024

The reason for this was the following issue in Ansible Core: ansible/ansible#77969.
Closing this issue as it was something upstream and nothing in the role.
Thanks for your help @jkinred!

from ansible-role-kubernetes.

Related Issues (20)

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.