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

[aws-eks] BootstrapOptions enable_docker_bridge not working #5786

Closed
RicoToothless opened this issue Jan 14, 2020 · 2 comments · Fixed by #8895
Closed

[aws-eks] BootstrapOptions enable_docker_bridge not working #5786

RicoToothless opened this issue Jan 14, 2020 · 2 comments · Fixed by #8895
Assignees
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. p1

Comments

@RicoToothless
Copy link

Description

This is my Python code

self.cluster.add_capacity(
            'worker-node',
            instance_type=ec2.InstanceType('t3.small'),
            desired_capacity=1,
            bootstrap_options=eks.BootstrapOptions(
                enable_docker_bridge=True
                ),
            key_name='eks-test-env-cluster'
        )

And this is cdk diff output

" --kubelet-extra-args \"--node-labels lifecycle=OnDemand\" --use-max-pods true --enable-docker-bridge\n/opt/aws/bin/cfn-signal --exit-code $? --stack test-eks-cluster --resource ekscontrolplaneworkernodeASG14CBDF68 --region ap-northeast-2"

there is only --enable-docker-bridge

Base on bootstrap.sh. I think --enable-docker-bridge should be --enable-docker-bridge true
https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh#L334

And I found these code. Maybe extraArgs.push --enable-docker-bridge can be --enable-docker-bridge true or kind of --enable-docker-bridge ${boolean}
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-eks/lib/user-data.ts#L22

Reproduction Steps

self.cluster.add_capacity(
            'worker-node',
            instance_type=ec2.InstanceType('t3.small'),
            desired_capacity=1,
            bootstrap_options=eks.BootstrapOptions(
                enable_docker_bridge=True
                ),
            key_name='eks-test-env-cluster'
        )

After cdk deploy then check kubectl get nodes.

But ec2 still alive and kubelet is dead. So I run script manually.

sudo systemctl stop docker
sudo systemctl stop kubelet
systemctl status kubelet    << need stop properly 
systemctl status docker     << need stop properly
sudo /etc/eks/bootstrap.sh ekscontrolplane79F9EC48-dc9daaf8f83546c3908b3eec9917d8a4 --kubelet-extra-args '--node-labels lifecycle=OnDemand' --use-max-pods true --enable-docker-bridge true
sudo systemctl start docker
docker ps
systemctl status kubelet
sudo systemctl start kubelet
cat /etc/docker/daemon.json

And check kubectl get nodes status is Ready

Error Log

less /var/log/cloud-init-output.log would see only --enable-docker-bridge

+ /etc/eks/bootstrap.sh ekscontrolplane79F9EC48-dc9daaf8f83546c3908b3eec9917d8a4 --kubelet-extra-args '--node-labels lifecycle=OnDemand' --use-max-pods true --enable-docker-bridge

Environment

  • **CLI Version : 1.20.0 (build 021c521)
  • **Framework Version: 1.20.0
  • **OS : Mac
  • **Language : Python 3.7.4

Other


This is 🐛 Bug Report

@RicoToothless RicoToothless added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 14, 2020
@SomayaB SomayaB added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Jan 14, 2020
@eladb eladb added the p1 label Jan 15, 2020
@SomayaB
Copy link
Contributor

SomayaB commented Jan 15, 2020

Hi @RicoToothless, thanks for reporting this. We will update this issue when there is movement.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Jan 15, 2020
@RicoToothless
Copy link
Author

RicoToothless commented Mar 24, 2020

But still have other option can enable docker bridge.

            bootstrap_options=eks.BootstrapOptions(
                docker_config_json=read_docker_daemon_resource('kubernetes_resources/docker-daemon.json')
            ),
def read_docker_daemon_resource(filename):
    with open(filename,'r') as stream:
        return json.dumps(json.load(stream))

docker config file kubernetes_resources/docker-daemon.json

{
    "bridge": "docker0",
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10m",
        "max-file": "10"
    },
    "live-restore": false,
    "max-concurrent-downloads": 10
}

@eladb eladb added this to the EKS Developer Preview milestone Jun 24, 2020
@eladb eladb changed the title EKS eks.BootstrapOptions enable_docker_bridge not working [EKS Bug] BootstrapOptions enable_docker_bridge not working Jun 24, 2020
@eladb eladb removed this from the EKS Developer Preview milestone Jun 24, 2020
@mergify mergify bot closed this as completed in #8895 Jul 5, 2020
mergify bot pushed a commit that referenced this issue Jul 5, 2020
When `enableDockerBridge` is enabled in `BootstrapOptions`, pass the value correctly to user-data.

Fixes: #5786 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@iliapolo iliapolo added this to the EKS Dev Preview milestone Aug 10, 2020
@iliapolo iliapolo changed the title [EKS Bug] BootstrapOptions enable_docker_bridge not working [aws-eks] BootstrapOptions enable_docker_bridge not working Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants