Skip to content

Commit

Permalink
Merge pull request #7695 from olemarkus/automated-cherry-pick-of-#747…
Browse files Browse the repository at this point in the history
…4-origin-release-1.15

Automated cherry pick of #7474: Change Cilium templates to standalone version
  • Loading branch information
k8s-ci-robot authored Oct 1, 2019
2 parents 4b6328b + 2deeca2 commit fcb4e76
Show file tree
Hide file tree
Showing 17 changed files with 1,291 additions and 798 deletions.
2 changes: 1 addition & 1 deletion docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ $ kops create cluster \
--name cilium.example.com
```

The above will deploy a daemonset installation which requires K8s 1.7.x or above.
The above will deploy a Cilium daemonset installation which requires K8s 1.10.x or above.

#### Configuring Cilium

Expand Down
47 changes: 47 additions & 0 deletions k8s/crds/kops_v1alpha2_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,8 @@ spec:
type: object
cilium:
properties:
IPTablesRulesNoinstall:
type: boolean
accessLog:
type: string
agentLabels:
Expand All @@ -2129,16 +2131,28 @@ spec:
type: array
allowLocalhost:
type: string
autoDirectNodeRoutes:
type: boolean
autoIpv6NodeRoutes:
type: boolean
bpfCTGlobalAnyMax:
format: int64
type: integer
bpfCTGlobalTCPMax:
format: int64
type: integer
bpfRoot:
type: string
clusterName:
type: string
containerRuntime:
items:
type: string
type: array
containerRuntimeEndpoint:
type: object
containerRuntimeLabels:
type: string
debug:
type: boolean
debugVerbose:
Expand All @@ -2155,10 +2169,16 @@ spec:
type: boolean
disableMasquerade:
type: boolean
enableNodePort:
type: boolean
enablePolicy:
type: string
enableTracing:
type: boolean
enableipv4:
type: boolean
enableipv6:
type: boolean
envoyLog:
type: string
ipv4ClusterCidrMaskSize:
Expand Down Expand Up @@ -2209,29 +2229,53 @@ spec:
logstashProbeTimer:
format: int32
type: integer
monitorAggregation:
type: string
nat46Range:
type: string
pprof:
type: boolean
preallocateBPFMaps:
type: boolean
prefilterDevice:
type: string
prometheusServeAddr:
type: string
restore:
type: boolean
sidecarIstioProxyImage:
type: string
singleClusterRoute:
type: boolean
socketPath:
type: string
stateDir:
type: string
toFqdnsEnablePoller:
type: boolean
tracePayloadlen:
format: int64
type: integer
tunnel:
type: string
version:
type: string
waitBPFMount:
type: boolean
required:
- enableipv6
- enableipv4
- monitorAggregation
- bpfCTGlobalTCPMax
- bpfCTGlobalAnyMax
- preallocateBPFMaps
- sidecarIstioProxyImage
- clusterName
- toFqdnsEnablePoller
- waitBPFMount
- IPTablesRulesNoinstall
- autoDirectNodeRoutes
- enableNodePort
type: object
classic:
type: object
Expand Down Expand Up @@ -2336,6 +2380,9 @@ spec:
NonMasqueradeCIDR is the CIDR for the internal k8s network (on which
pods & services live) It cannot overlap ServiceClusterIPRange
type: string
podCIDR:
description: PodCIDR is the CIDR from which we allocate IPs for pods
type: string
project:
description: Project is the cloud project we should use, required on
GCE
Expand Down
7 changes: 6 additions & 1 deletion k8s/crds/kops_v1alpha2_instancegroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ spec:
image:
description: Image is the instance (ami etc) we should use
type: string
instanceProtection:
description: InstanceProtection makes new instances in an autoscaling
group protected from scale in
type: boolean
kubelet:
description: Kubelet overrides kubelet config from the ClusterSpec
properties:
Expand Down Expand Up @@ -520,7 +524,8 @@ spec:
type: string
volumePluginDirectory:
description: The full path of the directory in which to search for
additional third party volume plugins
additional third party volume plugins (this path must be writeable,
dependant on your choice of OS)
type: string
volumeStatsAggPeriod:
description: VolumeStatsAggPeriod is the interval for kubelet to
Expand Down
26 changes: 26 additions & 0 deletions nodeup/pkg/model/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,32 @@ func (b *NetworkBuilder) Build(c *fi.ModelBuilderContext) error {
}
}

if networking.Cilium != nil {
var unit *string
unit = s(`
[Unit]
Description=Cilium BPF mounts
Documentation=http://docs.cilium.io/
DefaultDependencies=no
Before=local-fs.target umount.target kubelet.service
[Mount]
What=bpffs
Where=/sys/fs/bpf
Type=bpf
[Install]
WantedBy=multi-user.target
`)

service := &nodetasks.Service{
Name: "sys-fs-bpf.mount",
Definition: unit,
}
service.InitDefaults()
c.AddTask(service)
}

return nil
}

Expand Down
23 changes: 22 additions & 1 deletion pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ type AmazonVPCNetworkingSpec struct {
ImageName string `json:"imageName,omitempty"`
}

const CiliumDefaultVersion = "v1.0-stable"
const CiliumDefaultVersion = "v1.6.1"

// CiliumNetworkingSpec declares that we want Cilium networking
type CiliumNetworkingSpec struct {
Expand Down Expand Up @@ -209,6 +209,27 @@ type CiliumNetworkingSpec struct {
StateDir string `json:"stateDir,omitempty"`
TracePayloadLen int `json:"tracePayloadlen,omitempty"`
Tunnel string `json:"tunnel,omitempty"`

EnableIpv6 bool `json:"enableipv6"`
EnableIpv4 bool `json:"enableipv4"`
MonitorAggregation string `json:"monitorAggregation"`
BPFCTGlobalTCPMax int `json:"bpfCTGlobalTCPMax"`
BPFCTGlobalAnyMax int `json:"bpfCTGlobalAnyMax"`
PreallocateBPFMaps bool `json:"preallocateBPFMaps"`
SidecarIstioProxyImage string `json:"sidecarIstioProxyImage"`
ClusterName string `json:"clusterName"`
ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller"`
ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"`
IPTablesRulesNoinstall bool `json:"IPTablesRulesNoinstall"`
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes"`
EnableNodePort bool `json:"enableNodePort"`

//node init options
RemoveCbrBridge bool `json:"removeCbrBridge"`
RestartPods bool `json:"restartPods"`
ReconfigureKubelet bool `json:"reconfigureKubelet"`
NodeInitBootstrapFile string `json:"nodeInitBootstrapFile"`
CniBinPath string `json:"cniBinPath"`
}

// LyftIpVlanNetworkingSpec declares that we want to use the cni-ipvlan-vpc-k8s CNI networking
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/kops/v1alpha1/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,27 @@ type CiliumNetworkingSpec struct {
StateDir string `json:"stateDir,omitempty"`
TracePayloadLen int `json:"tracePayloadlen,omitempty"`
Tunnel string `json:"tunnel,omitempty"`

EnableIpv6 bool `json:"enableipv6"`
EnableIpv4 bool `json:"enableipv4"`
MonitorAggregation string `json:"monitorAggregation"`
BPFCTGlobalTCPMax int `json:"bpfCTGlobalTCPMax"`
BPFCTGlobalAnyMax int `json:"bpfCTGlobalAnyMax"`
PreallocateBPFMaps bool `json:"preallocateBPFMaps"`
SidecarIstioProxyImage string `json:"sidecarIstioProxyImage"`
ClusterName string `json:"clusterName"`
ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller"`
ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"`
IPTablesRulesNoinstall bool `json:"IPTablesRulesNoinstall"`
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes"`
EnableNodePort bool `json:"enableNodePort"`

//node init options
RemoveCbrBridge bool `json:"removeCbrBridge"`
RestartPods bool `json:"restartPods"`
ReconfigureKubelet bool `json:"reconfigureKubelet"`
NodeInitBootstrapFile string `json:"nodeInitBootstrapFile"`
CniBinPath string `json:"cniBinPath"`
}

// LyftIpVlanNetworkingSpec declares that we want to use the cni-ipvlan-vpc-k8s CNI networking
Expand Down
36 changes: 36 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.

21 changes: 21 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,27 @@ type CiliumNetworkingSpec struct {
StateDir string `json:"stateDir,omitempty"`
TracePayloadLen int `json:"tracePayloadlen,omitempty"`
Tunnel string `json:"tunnel,omitempty"`

EnableIpv6 bool `json:"enableipv6"`
EnableIpv4 bool `json:"enableipv4"`
MonitorAggregation string `json:"monitorAggregation"`
BPFCTGlobalTCPMax int `json:"bpfCTGlobalTCPMax"`
BPFCTGlobalAnyMax int `json:"bpfCTGlobalAnyMax"`
PreallocateBPFMaps bool `json:"preallocateBPFMaps"`
SidecarIstioProxyImage string `json:"sidecarIstioProxyImage"`
ClusterName string `json:"clusterName"`
ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller"`
ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"`
IPTablesRulesNoinstall bool `json:"IPTablesRulesNoinstall"`
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes"`
EnableNodePort bool `json:"enableNodePort"`

//node init options
RemoveCbrBridge bool `json:"removeCbrBridge"`
RestartPods bool `json:"restartPods"`
ReconfigureKubelet bool `json:"reconfigureKubelet"`
NodeInitBootstrapFile string `json:"nodeInitBootstrapFile"`
CniBinPath string `json:"cniBinPath"`
}

// LyftIpVlanNetworkingSpec declares that we want to use the cni-ipvlan-vpc-k8s CNI networking
Expand Down
36 changes: 36 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.

6 changes: 0 additions & 6 deletions pkg/apis/kops/validation/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,6 @@ func validateCilium(c *kops.Cluster) *field.Error {
if kubeVersion.LT(minimalKubeVersion) {
return field.Invalid(specPath.Child("KubernetesVersion"), c.Spec.KubernetesVersion, "Cilium needs at least Kubernetes 1.7")
}

minimalVersion := semver.MustParse("3.1.0")
path := specPath.Child("EtcdClusters").Index(0)
if err := validateEtcdVersion(c.Spec.EtcdClusters[0], path, &minimalVersion); err != nil {
return err
}
}
return nil
}
Expand Down
Loading

0 comments on commit fcb4e76

Please sign in to comment.