Skip to content

Commit

Permalink
Update kopeio test to test kopeio networking also
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Aug 15, 2021
1 parent edc0b27 commit fc58f4f
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 18 deletions.
4 changes: 3 additions & 1 deletion cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,13 @@ func TestPrivateCanal(t *testing.T) {
runTestTerraformAWS(t)
}

const kopeioNetworkingAddon = "networking.kope.io-k8s-1.12"

// TestPrivateKopeio runs the test on a configuration with private topology, kopeio networking
func TestPrivateKopeio(t *testing.T) {
newIntegrationTest("privatekopeio.example.com", "privatekopeio").
withPrivate().
withAddons(weaveAddon).
withAddons(kopeioNetworkingAddon).
runTestTerraformAWS(t)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ kubelet:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nonMasqueradeCIDR: 100.64.0.0/10
podManifestPath: /etc/kubernetes/manifests
masterKubelet:
Expand All @@ -232,7 +231,6 @@ masterKubelet:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nonMasqueradeCIDR: 100.64.0.0/10
podManifestPath: /etc/kubernetes/manifests
registerSchedulable: false
Expand All @@ -244,7 +242,7 @@ CloudProvider: aws
ConfigBase: memfs://clusters.example.com/privatekopeio.example.com
InstanceGroupName: master-us-test-1a
InstanceGroupRole: Master
NodeupConfigHash: PKuaXMiLaQvL3+KG2VFOtmeeXcCxyEoG2dRIrN7Et10=
NodeupConfigHash: UIsuZJp+YDaoibHFWxR7EpINJgzHrW+JLLVOWWhYqLM=
__EOF_KUBE_ENV

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ kubelet:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nonMasqueradeCIDR: 100.64.0.0/10
podManifestPath: /etc/kubernetes/manifests
Expand All @@ -162,7 +161,7 @@ CloudProvider: aws
ConfigBase: memfs://clusters.example.com/privatekopeio.example.com
InstanceGroupName: nodes
InstanceGroupRole: Node
NodeupConfigHash: QsL02v5F4dPm/SxOBAeABj9LKtggcSW+f9Ead/+989Q=
NodeupConfigHash: IE6Ri9HJ07gg3tR/oB6HIkQOksfwafZOeyBYO5rFHWY=
__EOF_KUBE_ENV

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ spec:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nonMasqueradeCIDR: 100.64.0.0/10
podManifestPath: /etc/kubernetes/manifests
kubernetesApiAccess:
Expand All @@ -161,14 +160,13 @@ spec:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nonMasqueradeCIDR: 100.64.0.0/10
podManifestPath: /etc/kubernetes/manifests
registerSchedulable: false
masterPublicName: api.privatekopeio.example.com
networkCIDR: 172.20.0.0/16
networking:
weave: {}
kopeio: {}
nonMasqueradeCIDR: 100.64.0.0/10
podCIDR: 100.96.0.0/11
secretStore: memfs://clusters.example.com/privatekopeio.example.com/secrets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ KubeletConfig:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nodeLabels:
kops.k8s.io/kops-controller-pki: ""
kubernetes.io/role: master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ KubeletConfig:
hostnameOverride: '@aws'
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
networkPluginName: cni
nodeLabels:
kubernetes.io/role: node
node-role.kubernetes.io/node: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ spec:
selector:
k8s-addon: storage-aws.addons.k8s.io
- id: k8s-1.12
manifest: networking.weave/k8s-1.12.yaml
manifestHash: 3f14f8869934001778849837c28217709bf4f1c593d3acdbde9cdf1d97ac47f3
name: networking.weave
manifest: networking.kope.io/k8s-1.12.yaml
manifestHash: 294272eb01da2938395ff6425ac74690788b6f7ebe80327a83a77b2951b63968
name: networking.kope.io
selector:
role.kubernetes.io/networking: "1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
creationTimestamp: null
labels:
addon.kops.k8s.io/name: networking.kope.io
app.kubernetes.io/managed-by: kops
k8s-addon: networking.kope.io
role.kubernetes.io/networking: "1"
name: kopeio-networking-agent
namespace: kube-system
spec:
selector:
matchLabels:
name: kopeio-networking-agent
template:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly",
"operator":"Exists"}]'
labels:
name: kopeio-networking-agent
spec:
containers:
- env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: kopeio/networking-agent:1.0.20181028
name: networking-agent
resources:
limits:
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
securityContext:
privileged: true
volumeMounts:
- mountPath: /lib/modules
name: lib-modules
readOnly: true
hostIPC: true
hostNetwork: true
hostPID: true
priorityClassName: system-node-critical
serviceAccountName: kopeio-networking-agent
tolerations:
- effect: NoSchedule
operator: Exists
- effect: NoExecute
operator: Exists
volumes:
- hostPath:
path: /lib/modules
name: lib-modules

---

apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
labels:
addon.kops.k8s.io/name: networking.kope.io
app.kubernetes.io/managed-by: kops
k8s-addon: networking.kope.io
role.kubernetes.io/networking: "1"
name: kopeio-networking-agent
namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
addon.kops.k8s.io/name: networking.kope.io
app.kubernetes.io/managed-by: kops
k8s-addon: networking.kope.io
role.kubernetes.io/networking: "1"
name: kopeio:networking-agent
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- patch
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
creationTimestamp: null
labels:
addon.kops.k8s.io/name: networking.kope.io
app.kubernetes.io/managed-by: kops
k8s-addon: networking.kope.io
role.kubernetes.io/networking: "1"
name: kopeio:networking-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kopeio:networking-agent
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: system:serviceaccount:kube-system:kopeio-networking-agent
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
masterPublicName: api.privatekopeio.example.com
networkCIDR: 172.20.0.0/16
networking:
weave: {}
kopeio: {}
nonMasqueradeCIDR: 100.64.0.0/10
sshAccess:
- 0.0.0.0/0
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/update_cluster/privatekopeio/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,10 @@ resource "aws_s3_bucket_object" "privatekopeio-example-com-addons-limit-range-ad
server_side_encryption = "AES256"
}

resource "aws_s3_bucket_object" "privatekopeio-example-com-addons-networking-weave-k8s-1-12" {
resource "aws_s3_bucket_object" "privatekopeio-example-com-addons-networking-kope-io-k8s-1-12" {
bucket = "testingBucket"
content = file("${path.module}/data/aws_s3_bucket_object_privatekopeio.example.com-addons-networking.weave-k8s-1.12_content")
key = "clusters.example.com/privatekopeio.example.com/addons/networking.weave/k8s-1.12.yaml"
content = file("${path.module}/data/aws_s3_bucket_object_privatekopeio.example.com-addons-networking.kope.io-k8s-1.12_content")
key = "clusters.example.com/privatekopeio.example.com/addons/networking.kope.io/k8s-1.12.yaml"
server_side_encryption = "AES256"
}

Expand Down

0 comments on commit fc58f4f

Please sign in to comment.