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

Configure dns replicas #30

Merged
merged 11 commits into from
Mar 6, 2018
Merged

Configure dns replicas #30

merged 11 commits into from
Mar 6, 2018

Conversation

SpComb
Copy link
Contributor

@SpComb SpComb commented Mar 6, 2018

Fixes #2

Refactors Kupo::Kube to get update_resource vs apply_resource

Testing

==> Reading instructions ...
==> Sharpening tools ...
==> Starting to craft cluster ...
==> master: 147.75.83.87
    Connecting to host via SSH ...
    Validating distro and version ...
==> worker: 147.75.83.149
    Connecting to host via SSH ...
    Validating distro and version ...
==> master: 147.75.83.87
    Configuring essential packages ...
    Configuring netfilter ...
    Configuring container runtime packages ...
    Configuring Kubernetes packages ...
    Configuring kubelet ...
    Checking if Kubernetes control plane is already initialized ...
    Kubernetes control plane is up-to-date.
    Fetching kubectl config ...
    Configuration saved to /home/kontena/.kupo/147.75.83.87
    Patching kube-dns addon...
    Configuring overlay network ...
    Configuring metrics-server ...
    Configuring heapster ...
==> worker: 147.75.83.149
    Configuring essential packages ...
    Configuring netfilter ...
    Configuring container runtime packages ...
    Configuring Kubernetes packages ...
    Configuring kubelet ...
==> addons: 147.75.83.87
    Applying addon host-upgrades ...
    Applying addon kured ...
==> Cluster has been crafted, kupo! (took 1 minutes 38 seconds)
$ kubectl --kubeconfig /home/kontena/.kupo/147.75.83.87 -n kube-system get pods -l k8s-app=kube-dns -o wide
NAME                        READY     STATUS        RESTARTS   AGE       IP          NODE
kube-dns-6f4fd4bdf-grk4l    0/3       Terminating   0          35m       10.32.0.2   terom-kube-master
kube-dns-77c656b779-mc4w9   0/3       Pending       0          15m       <none>      <none>
kube-dns-77c656b779-vqd44   3/3       Running       0          18m       10.44.0.5   terom-kube-node1
$ kubectl --kubeconfig /home/kontena/.kupo/147.75.83.87 -n kube-system get pods -l k8s-app=kube-dns -o wide
NAME                        READY     STATUS    RESTARTS   AGE       IP          NODE
kube-dns-77c656b779-mc4w9   2/3       Running   0          16m       10.32.0.2   terom-kube-master
kube-dns-77c656b779-vqd44   3/3       Running   0          19m       10.44.0.5   terom-kube-node1

With deployment strategy defaults

The deployment rollout gets stuck with two replicas on two nodes: it is unable to provision the new rs to two replicas while the old rs still has a pod occupying the other node.

$ kubectl --kubeconfig /home/kontena/.kupo/147.75.83.87 -n kube-system get pods -l k8s-app=kube-dns -o wide
NAME                        READY     STATUS    RESTARTS   AGE       IP          NODE
kube-dns-6f4fd4bdf-grk4l    3/3       Running   0          23m       10.32.0.2   terom-kube-master
kube-dns-77c656b779-mc4w9   0/3       Pending   0          3m        <none>      <none>
kube-dns-77c656b779-vqd44   3/3       Running   0          7m        10.44.0.5   terom-kube-node1

@SpComb SpComb added the enhancement New feature or request label Mar 6, 2018
Copy link
Contributor

@jakolehm jakolehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some specs would be nice.

@jakolehm jakolehm added this to the 0.3 milestone Mar 6, 2018
@SpComb
Copy link
Contributor Author

SpComb commented Mar 6, 2018

Some specs would be nice.

I wasn't aware we had specs yet


module Kupo::Phases
class ConfigureDNS < Base
# @param config [Kupo::Config]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing yardoc for master.

if hosts.length == 1
return 1
else
return 1 + (hosts.length / HOSTS_PER_DNS_REPLICA.to_f).ceil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this logic :)

Copy link
Contributor

@jakolehm jakolehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakolehm jakolehm merged commit 372e71a into master Mar 6, 2018
@jakolehm jakolehm deleted the feature/configure-dns-replicas branch March 6, 2018 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants