Skip to content

Commit

Permalink
[#647] fix kubeapi elb healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-semenets committed Dec 7, 2018
1 parent 5297dd5 commit e92ad8e
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions deploy/ansible/roles/k8s_create_cluster/tasks/create-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,31 @@
# Create Kubernetes cluster using Kops
####################

- name: Create kops configuration
template:
src: kops.yaml.j2
dest: "{{ tmp_dir }}/kops.{{ cluster_name }}.yaml"
mode: 0644
#- name: Create kops configuration
# template:
# src: kops.yaml.j2
# dest: "{{ tmp_dir }}/kops.{{ cluster_name }}.yaml"
# mode: 0644

- name: Configure the cluster
shell: "kops create -f {{ tmp_dir }}/kops.{{ cluster_name }}.yaml --state {{ state_store }}"
#- name: Configure the cluster
# shell: "kops create -f {{ tmp_dir }}/kops.{{ cluster_name }}.yaml --state {{ state_store }}"

- name: Configure ssh key
shell: "kops create secret --name {{ cluster_name }} sshpublickey admin -i {{ ssh_public_key }} --state {{ state_store }}"
#- name: Configure ssh key
# shell: "kops create secret --name {{ cluster_name }} sshpublickey admin -i {{ ssh_public_key }} --state {{ state_store }}"

- name: Create the physical cluster
shell: "kops update cluster {{ cluster_name }} --yes --state {{ state_store }}"
#- name: Create the physical cluster
# shell: "kops update cluster {{ cluster_name }} --yes --state {{ state_store }}"

# HOTFIX fix SSL check failure on ap iELB
- name: Get Kube API ELB name
shell: "aws elb describe-load-balancers --output text --query 'LoadBalancerDescriptions[*].[LoadBalancerName]' |grep {{ env_name }}"
register: kubeapi_elb
until: kubeapi_elb.stdout.find('api-') != -1
retries: 10
delay: 15

- name: Update API ELB healthcheck
shell: "aws elb configure-health-check --load-balancer-name {{ kubeapi_elb.stdout }} --health-check Target=TCP:443,Interval=10,UnhealthyThreshold=2,HealthyThreshold=2,Timeout=5"

- name: Verify that all Kubernetes nodes are ready
shell: kubectl --context {{ cluster_name }} get nodes | grep master | wc -l
Expand Down

0 comments on commit e92ad8e

Please sign in to comment.