zalando-stups / sevenseconds

THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
https://pypi.python.org/pypi/stups-sevenseconds
Other
66 stars 17 forks source link

Support completely custom subnet setups #86

Closed aermakov-zalando closed 5 years ago

aermakov-zalando commented 5 years ago

If the vpc configuration contains a subnets key, don't configure the default subnets at all. Instead, read the list of subnets to be configured from that value. The value must be a dict where the keys are AZ names and the values are lists of subnet objects:

vpc_net:
  eu-central-1:
    cidr: "10.1.0.0/16"
    subnets:
      eu-central-1a:
        - type: dmz
          cidr: 10.1.0.0/24
        - type: internal
          cidr: 10.1.24.0/21
          tags:
            'kubernetes.io/role/elb': ''
            'kubernetes.io/role/internal-elb': ''
      eu-central-1b:
        …

To stop older versions of sevenseconds from completely destroying the account, VPC configuration is slightly changed (network is renamed to cidr). This will cause an exception in the old version, but I'm open to other suggestions. There's also an explicit check for the configuration version so this won't be needed in the future.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.02%) to 23.73% when pulling 5b76b267111fd965429e9402efc91c7b998cb7dc on custom-subnets into e8d3a0307fd017cc6afcbce356db72037b1eaef2 on master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.2%) to 23.937% when pulling 2da327df7bb346e9a6973c216f0bc12a7734d01d on custom-subnets into e8d3a0307fd017cc6afcbce356db72037b1eaef2 on master.

codecov-io commented 5 years ago

Codecov Report

Merging #86 into master will increase coverage by 0.23%. The diff coverage is 26.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
+ Coverage   23.66%   23.89%   +0.23%     
==========================================
  Files          22       22              
  Lines        1952     1975      +23     
==========================================
+ Hits          462      472      +10     
- Misses       1490     1503      +13
Impacted Files Coverage Δ
sevenseconds/config/vpc.py 7.37% <14.28%> (+0.64%) :arrow_up:
sevenseconds/cli.py 62.4% <70%> (+0.8%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e8d3a03...2da327d. Read the comment docs.

aryszka commented 5 years ago

:+1:

aermakov-zalando commented 5 years ago

👍

aryszka commented 5 years ago

:+1: