// Copyright 2017-2020 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//+build ipam_provider_aws
package main
import (
operatorOption "github.com/cilium/cilium/operator/option"
"github.com/cilium/cilium/pkg/option"
)
func init() {
flags := rootCmd.Flags()
flags.Var(option.NewNamedMapOptions(operatorOption.AWSInstanceLimitMapping, &operatorOption.Config.AWSInstanceLimitMapping, nil),
operatorOption.AWSInstanceLimitMapping,
`Add or overwrite mappings of AWS instance limit in the form of `+
`{"AWS instance type": "Maximum Network Interfaces","IPv4 Addresses `+
`per Interface","IPv6 Addresses per Interface"}. cli example: `+
`--aws-instance-limit-mapping=a1.medium=2,4,4 `+
`--aws-instance-limit-mapping=a2.somecustomflavor=4,5,6 `+
`configmap example: {"a1.medium": "2,4,4", "a2.somecustomflavor": "4,5,6"}`)
option.BindEnv(operatorOption.AWSInstanceLimitMapping)
flags.Bool(operatorOption.AWSReleaseExcessIPs, false, "Enable releasing excess free IP addresses from AWS ENI.")
option.BindEnv(operatorOption.AWSReleaseExcessIPs)
flags.Var(option.NewNamedMapOptions(operatorOption.ENITags, &operatorOption.Config.ENITags, nil),
operatorOption.ENITags, "ENI tags in the form of k1=v1 (multiple k/v pairs can be passed by repeating the CLI flag)")
option.BindEnv(operatorOption.ENITags)
flags.Bool(operatorOption.UpdateEC2AdapterLimitViaAPI, false, "Use the EC2 API to update the instance type to adapter limits")
option.BindEnv(operatorOption.UpdateEC2AdapterLimitViaAPI)
}