Created
May 29, 2019 22:43
-
-
Save ldx/adc11cbcd2481904ca5efe5218cd9a36 to your computer and use it in GitHub Desktop.
milpa-ng.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: eksctl.io/v1alpha4 | |
kind: ClusterConfig | |
metadata: | |
name: elotltest | |
region: us-east-1 | |
nodeGroups: | |
- name: milpa | |
amiFamily: AmazonLinux2 | |
ssh: | |
allow: true | |
instanceType: m5.large | |
desiredCapacity: 1 | |
labels: | |
nodegroup-type: milpa | |
privateNetworking: false | |
preBootstrapCommand: | |
- mkdir -p /etc/cni/net.d | |
- mkdir -p /etc/kubernetes/pki && cat /etc/eksctl/ca.crt > /etc/kubernetes/pki/ca.crt | |
- curl -L -O https://download.elotl.co/milpa-installer-latest && chmod 755 milpa-installer-latest | |
- ./milpa-installer-latest | |
- yum -y install python python-pip jq | |
- pip install yq | |
- yq -y ".clusterName=\"elotltest\" | .cloud.aws.accessKeyID=\"FILL_IN\" | .cloud.aws.secretAccessKey=\"FILL_IN\" | .cloud.aws.vpcID=\"\" | .nodes.defaultInstanceType=\"t3.large\" | .nodes.defaultVolumeSize=\"10Gi\" | .license.key=\"FILL_IN\" | .license.id=\"FILL_IN\" | .license.username=\"FILL_IN\" | .license.password=\"FILL_IN\"" /opt/milpa/etc/server.yml > /opt/milpa/etc/server.yml.new && mv /opt/milpa/etc/server.yml.new /opt/milpa/etc/server.yml | |
- sed -i 's#--milpa-endpoint 127.0.0.1:54555$#--milpa-endpoint 127.0.0.1:54555 --non-masquerade-cidr 10.100.0.0/16 --kubeconfig /etc/eksctl/kubeconfig.yaml#' /etc/systemd/system/kiyot.service | |
- sed -i 's#--config /opt/milpa/etc/server.yml$#--config /opt/milpa/etc/server.yml --delete-cluster-lock-file#' /etc/systemd/system/milpa.service | |
- sed -i 's/^After=.*$/After=kiyot.service/g' /etc/systemd/system/kubelet.service | |
- sed -i 's/^Requires=.*$/Requires=kiyot.service/g' /etc/systemd/system/kubelet.service | |
- mkdir -p /etc/systemd/system/kubelet.service.d/ | |
- echo -e '[Service]\nStartLimitInterval=0\nStartLimitIntervalSec=0\nRestart=always\nRestartSec=5\nExecStart=\nExecStart=/usr/bin/kubelet --node-ip=${NODE_IP} --node-labels=${NODE_LABELS},alpha.eksctl.io/instance-id=${INSTANCE_ID} --register-node=true --register-with-taints=${NODE_TAINTS} --allow-privileged=true --cloud-provider=aws --pod-infra-container-image=602401143452.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/eks/pause-amd64:3.1 --kubeconfig=/etc/eksctl/kubeconfig.yaml --config=/etc/eksctl/kubelet.yaml --container-runtime=remote --container-runtime-endpoint=/opt/milpa/run/kiyot.sock --max-pods=1000' > /etc/systemd/system/kubelet.service.d/99override.conf | |
- systemctl disable docker && systemctl stop docker | |
- rm -f /var/run/docker.sock && touch /var/run/docker.sock | |
- echo "NODE_IP=$(curl --silent http://169.254.169.254/latest/meta-data/local-ipv4)" > /etc/eksctl/kubelet.local.env | |
- echo "INSTANCE_ID=$(curl --silent http://169.254.169.254/latest/meta-data/instance-id)" >> /etc/eksctl/kubelet.local.env | |
overrideBootstrapCommand: systemctl daemon-reload; systemctl enable kubelet; systemctl restart milpa; systemctl restart kiyot; systemctl restart kubelet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment