Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived track_script not work #3

Closed
fanux opened this issue Aug 24, 2018 · 1 comment
Closed

keepalived track_script not work #3

fanux opened this issue Aug 24, 2018 · 1 comment
Projects

Comments

@fanux
Copy link
Member

fanux commented Aug 24, 2018

global_defs {
   router_id k8s
}

vrrp_script Checkhaproxy {
    script "/etc/keepalived/check_haproxy.sh"
    interval 3
    weight -25 # priority MASTER(100) - 25 < BACKUP(80)
}

vrrp_instance VI_1 {
    state BACKUP

    interface eth0
    virtual_router_id  100
    priority 80
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass kuburnetes
    }
    virtual_ipaddress {
         10.1.86.209
    }
    track_script {
        Checkhaproxy
    }
}
if [ `curl https://10.1.86.202:6444 --insecure |grep kind |wc -l` -eq 0 ] ; then
   exit 1 # just exit, MASTER will reduce weight(-25), so vip will move on BACKUP node
fi

when script exit1, but MASTER not realse the vip

@fanux fanux created this issue from a note in todolist (To do) Aug 24, 2018
fanux pushed a commit that referenced this issue Sep 19, 2018
@fanux
Copy link
Member Author

fanux commented Oct 26, 2018

Keepalived in docker using --dont-fork caused this issue. But if using fork container will exit immediately. So maybe using supervisor in the feature, now just sleep infinity to solve this.

FROM centos:7.4.1708
RUN yum install -y  wget  && yum install -y gcc-c++ openssl-devel openssl && yum install -y net-tools
RUN wget http://www.keepalived.org/software/keepalived-2.0.8.tar.gz && tar zxvf keepalived-2.0.8.tar.gz && cd keepalived-2.0.8 && ./configure && make && make install  
CMD keepalived --all -d -D  -f /etc/keepalived/keepalived.conf --log-console && sleep infinity

@fanux fanux closed this as completed Oct 26, 2018
fanux pushed a commit that referenced this issue Apr 12, 2019
@fanux fanux moved this from To do to Done in todolist Sep 6, 2019
fanux pushed a commit that referenced this issue Mar 30, 2020
fanux pushed a commit that referenced this issue Apr 3, 2020
cuisongliu pushed a commit that referenced this issue Dec 8, 2020
luanshaotong added a commit that referenced this issue May 11, 2024
Support multiple containers service nodeport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
todolist
  
Done
Development

No branches or pull requests

1 participant