Skip to content

Commit

Permalink
add fixes
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingaikin <[email protected]>
  • Loading branch information
denis-tingaikin committed Nov 20, 2021
1 parent e340e0f commit 745e88f
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .cloudtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ statistics:
enabled: true
interval: 60
import:
- aks/.*
- gke/.*
- aks/.*
- aws/.*
- packet/.*
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/automerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- completed
workflows:
- 'ci'
- "ci"
jobs:
automerge-on-success:
name: Automerge
Expand All @@ -28,11 +28,11 @@ jobs:
ENABLED_FOR_MANUAL_CHANGES: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
automerge-otherwise:
name: Automerge
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' && github.actor == 'nsmbot' }}
steps:
- name: Set status 'failure'
run: |
echo Set status 'failure' for 'automerge' workflow to prevent run "update dependent repositories" or any other dependent workflows'
exit -1
name: Automerge
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' && github.actor == 'nsmbot' }}
steps:
- name: Set status 'failure'
run: |
echo Set status 'failure' for 'automerge' workflow to prevent run "update dependent repositories" or any other dependent workflows'
exit -1
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ linters-settings:
- errors
packages-with-error-message:
# specify an error message to output when a blacklisted package is used
- errors: "Please use \"github.com/pkg/errors\" instead of \"errors\" in go imports"
- errors: 'Please use "github.com/pkg/errors" instead of "errors" in go imports'
misspell:
locale: US
unparam:
Expand Down
4 changes: 2 additions & 2 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
extends: default

yaml-files:
- '*.yaml'
- '*.yml'
- "*.yaml"
- "*.yml"

rules:
truthy: disable
Expand Down
2 changes: 1 addition & 1 deletion packet/packet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ providers:
- name: "packet"
kind: "packet"
instances: 1
retry: 5
retry: 10
node-count: 2
enabled: true
timeout: 2400 # 40 minutes to start cluster
Expand Down
21 changes: 8 additions & 13 deletions scripts/aws/amazon-eks-nodegroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ AWSTemplateFormatVersion: 2010-09-09
Description: Amazon EKS - Node Group

Parameters:

KeyName:
Description: The EC2 Key Pair to allow SSH access to the instances
Type: AWS::EC2::KeyPair::KeyName
Expand Down Expand Up @@ -146,7 +145,6 @@ Parameters:
Type: List<AWS::EC2::Subnet::Id>

Metadata:

AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
Expand All @@ -173,7 +171,6 @@ Metadata:
- Subnets

Resources:

NodeInstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Expand Down Expand Up @@ -310,18 +307,16 @@ Resources:
VolumeType: gp2
DeleteOnTermination: true
UserData:
Fn::Base64:
!Sub |
#!/bin/bash
set -o xtrace
/etc/eks/bootstrap.sh ${ClusterName} ${BootstrapArguments}
/opt/aws/bin/cfn-signal --exit-code $? \
--stack ${AWS::StackName} \
--resource NodeGroup \
--region ${AWS::Region}
Fn::Base64: !Sub |
#!/bin/bash
set -o xtrace
/etc/eks/bootstrap.sh ${ClusterName} ${BootstrapArguments}
/opt/aws/bin/cfn-signal --exit-code $? \
--stack ${AWS::StackName} \
--resource NodeGroup \
--region ${AWS::Region}

Outputs:

NodeInstanceRole:
Description: The node instance role
Value: !GetAtt NodeInstanceRole.Arn
Expand Down
2 changes: 1 addition & 1 deletion scripts/aws/amazon-eks-role-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Action": "sts:AssumeRole"
}
]
}
}
90 changes: 45 additions & 45 deletions scripts/aws/amazon-eks-vpc.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# yamllint disable
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Sample VPC'
AWSTemplateFormatVersion: "2010-09-09"
Description: "Amazon EKS Sample VPC"

Parameters:

VpcBlock:
Type: String
Default: 192.168.0.0/16
Expand All @@ -28,8 +27,7 @@ Parameters:
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
- Label:
default: "Worker Network Configuration"
Parameters:
- VpcBlock
Expand All @@ -41,17 +39,17 @@ Conditions:
Has2Azs:
Fn::Or:
- Fn::Equals:
- {Ref: 'AWS::Region'}
- ap-south-1
- { Ref: "AWS::Region" }
- ap-south-1
- Fn::Equals:
- {Ref: 'AWS::Region'}
- ap-northeast-2
- { Ref: "AWS::Region" }
- ap-northeast-2
- Fn::Equals:
- {Ref: 'AWS::Region'}
- ca-central-1
- { Ref: "AWS::Region" }
- ca-central-1
- Fn::Equals:
- {Ref: 'AWS::Region'}
- cn-north-1
- { Ref: "AWS::Region" }
- cn-north-1

HasMoreThan2Azs:
Fn::Not:
Expand All @@ -61,18 +59,18 @@ Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcBlock
CidrBlock: !Ref VpcBlock
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: Name
Value: !Sub '${AWS::StackName}-VPC'
- Key: Name
Value: !Sub "${AWS::StackName}-VPC"

Ipv6VPCCidrBlock:
Type: AWS::EC2::VPCCidrBlock
Properties:
AmazonProvidedIpv6CidrBlock: true
VpcId: !Ref VPC
AmazonProvidedIpv6CidrBlock: true
VpcId: !Ref VPC

InternetGateway:
Type: "AWS::EC2::InternetGateway"
Expand All @@ -88,10 +86,10 @@ Resources:
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: Public Subnets
- Key: Network
Value: Public
- Key: Name
Value: Public Subnets
- Key: Network
Value: Public

Route:
DependsOn: VPCGatewayAttachment
Expand All @@ -108,18 +106,19 @@ Resources:
Properties:
AvailabilityZone:
Fn::Select:
- '0'
- Fn::GetAZs:
Ref: AWS::Region
- "0"
- Fn::GetAZs:
Ref: AWS::Region
AssignIpv6AddressOnCreation: true
CidrBlock:
Ref: Subnet01Block
Ipv6CidrBlock: !Select [0, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
Ipv6CidrBlock:
!Select [0, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
VpcId:
Ref: VPC
Tags:
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet01"
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet01"
DependsOn: Ipv6VPCCidrBlock

Subnet02:
Expand All @@ -129,17 +128,18 @@ Resources:
Properties:
AvailabilityZone:
Fn::Select:
- '1'
- Fn::GetAZs:
Ref: AWS::Region
- "1"
- Fn::GetAZs:
Ref: AWS::Region
CidrBlock:
Ref: Subnet02Block
Ipv6CidrBlock: !Select [1, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
Ipv6CidrBlock:
!Select [1, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
VpcId:
Ref: VPC
Tags:
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet02"
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet02"
DependsOn: Ipv6VPCCidrBlock

Subnet03:
Expand All @@ -150,17 +150,18 @@ Resources:
Properties:
AvailabilityZone:
Fn::Select:
- '2'
- Fn::GetAZs:
Ref: AWS::Region
- "2"
- Fn::GetAZs:
Ref: AWS::Region
CidrBlock:
Ref: Subnet03Block
Ipv6CidrBlock: !Select [2, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
Ipv6CidrBlock:
!Select [2, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
VpcId:
Ref: VPC
Tags:
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet03"
- Key: Name
Value: !Sub "${AWS::StackName}-Subnet03"
DependsOn: Ipv6VPCCidrBlock

Subnet01RouteTableAssociation:
Expand Down Expand Up @@ -189,18 +190,17 @@ Resources:
VpcId: !Ref VPC

Outputs:

SubnetIds:
Description: All subnets in the VPC
Value:
Fn::If:
- HasMoreThan2Azs
- !Join [ ",", [ !Ref Subnet01, !Ref Subnet02, !Ref Subnet03 ] ]
- !Join [ ",", [ !Ref Subnet01, !Ref Subnet02 ] ]
- HasMoreThan2Azs
- !Join [",", [!Ref Subnet01, !Ref Subnet02, !Ref Subnet03]]
- !Join [",", [!Ref Subnet01, !Ref Subnet02]]

SecurityGroups:
Description: Security group for the cluster control plane communication with worker nodes
Value: !Join [ ",", [ !Ref ControlPlaneSecurityGroup ] ]
Value: !Join [",", [!Ref ControlPlaneSecurityGroup]]

VpcId:
Description: The VPC Id
Expand Down

0 comments on commit 745e88f

Please sign in to comment.