Skip to content

Commit

Permalink
Merge pull request #8633 from rifelpet/automated-cherry-pick-of-#8276…
Browse files Browse the repository at this point in the history
…-origin-release-1.17

Automated cherry pick of #8276 and #8455: Add env API field to amazonvpc
  • Loading branch information
k8s-ci-robot committed Feb 27, 2020
2 parents 64ec86e + d9c7764 commit 98d5e70
Show file tree
Hide file tree
Showing 19 changed files with 293 additions and 7 deletions.
12 changes: 12 additions & 0 deletions docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,18 @@ $ kops create cluster \

In case of any issues the directory `/var/log/aws-routed-eni` contains the log files of the CNI plugin. This directory is located in all the nodes in the cluster.

[Configuration options for the Amazon VPC CNI plugin](https://github.com/aws/amazon-vpc-cni-k8s/tree/master#cni-configuration-variables) can be set through env vars defined in the cluster spec:

```yaml
networking:
amazonvpc:
env:
- name: WARM_IP_TARGET
value: "10"
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: debug
```

### Cilium Example for CNI and Network Policy

Cilium is open source software for transparently securing the network connectivity between application services deployed using Linux container management platforms like Docker and Kubernetes.
Expand Down
25 changes: 25 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,31 @@ spec:
description: AmazonVPCNetworkingSpec declares that we want Amazon
VPC CNI networking
properties:
env:
description: Env is a list of environment variables to set in
the container.
items:
description: EnvVar represents an environment variable present
in a Container.
properties:
name:
description: Name of the environment variable. Must be
a C_IDENTIFIER.
type: string
value:
description: 'Variable references $(VAR_NAME) are expanded
using the previous defined environment variables in
the container and any service environment variables.
If a variable cannot be resolved, the reference in the
input string will be unchanged. The $(VAR_NAME) syntax
can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
references will never be expanded, regardless of whether
the variable exists or not. Defaults to "".'
type: string
required:
- name
type: object
type: array
imageName:
description: The container image name to use
type: string
Expand Down
17 changes: 17 additions & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,23 @@ func (c *Cluster) IsKubernetesGTE(version string) bool {
return clusterVersion.GTE(*parsedVersion)
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ type RomanaNetworkingSpec struct {
type AmazonVPCNetworkingSpec struct {
// The container image name to use
ImageName string `json:"imageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}

// CiliumNetworkingSpec declares that we want Cilium networking
Expand Down
17 changes: 17 additions & 0 deletions pkg/apis/kops/v1alpha1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,23 @@ func (t *TerraformSpec) IsEmpty() bool {
return t.ProviderExtraConfig == nil
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ type RomanaNetworkingSpec struct {
type AmazonVPCNetworkingSpec struct {
// The container image name to use
ImageName string `json:"imageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}

type CiliumNetworkingSpec struct {
Expand Down
54 changes: 54 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,23 @@ func (t *TerraformSpec) IsEmpty() bool {
return t.ProviderExtraConfig == nil
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ type RomanaNetworkingSpec struct {
type AmazonVPCNetworkingSpec struct {
// The container image name to use
ImageName string `json:"imageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}

// CiliumNetworkingSpec declares that we want Cilium networking
Expand Down
54 changes: 54 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 98d5e70

Please sign in to comment.