Created
June 3, 2020 21:58
-
-
Save kvaps/9bf90c62be46c847d4f68b22b747c477 to your computer and use it in GitHub Desktop.
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
spec: | |
hostNetwork: true | |
initContainers: | |
- name: eip | |
image: docker.io/amazon/aws-cli:2.0.18 | |
command: | |
- /bin/bash | |
- -xec | |
- | | |
INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
aws ec2 disassociate-address --public-ip "$PUBLIC_IP" || true | |
aws ec2 associate-address --public-ip "$PUBLIC_IP" --instance-id "$INSTANCE_ID" | |
env: | |
- name: PUBLIC_IP | |
value: | |
- name: AWS_REGION | |
value: eu-central-1 | |
- name: AWS_ACCESS_KEY_ID | |
valueFrom: | |
secretKeyRef: | |
key: awsKeyId | |
name: restund | |
- name: AWS_SECRET_ACCESS_KEY | |
valueFrom: | |
secretKeyRef: | |
key: awsSecretKey | |
name: restund |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment