diff --git a/tests/templates/terway/terway-eni-only.yml b/tests/templates/terway/terway-eni-only.yml deleted file mode 100644 index c23b6238..00000000 --- a/tests/templates/terway/terway-eni-only.yml +++ /dev/null @@ -1,341 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: terway - namespace: kube-system - ---- - -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: terway-pod-reader - namespace: kube-system -rules: -- apiGroups: [""] - resources: ["pods", "nodes", "namespaces", "configmaps", "serviceaccounts"] - verbs: ["get", "watch", "list", "update"] -- apiGroups: ["networking.k8s.io"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: ["extensions"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: [""] - resources: - - pods/status - verbs: - - update -- apiGroups: ["crd.projectcalico.org"] - resources: ["*"] - verbs: ["*"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: terway-binding - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: terway-pod-reader -subjects: - - kind: ServiceAccount - name: terway - namespace: kube-system - ---- - -kind: ConfigMap -apiVersion: v1 -metadata: - name: eni-config - namespace: kube-system -data: - eni_conf: | - { - "version": "1", - "access_key": "ACCESS_KEY", - "access_secret": "ACCESS_SECRET", - "service_cidr": "SERVICE_CIDR", - "security_group": "SECURITY_GROUP", - "vswitches": { - "cn-hongkong-b": ["VSWITCH"] - }, - "max_pool_size": 5, - "min_pool_size": 0 - } - 10-terway.conf: | - { - "cniVersion": "0.4.0", - "name": "terway", - "type": "terway" - } - ---- - -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: terway - namespace: kube-system -spec: - template: - metadata: - labels: - app: terway - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - hostPID: true - nodeSelector: - beta.kubernetes.io/arch: amd64 - tolerations: - - key: node.cloudprovider.kubernetes.io/uninitialized - value: "true" - effect: NoSchedule - - key: node-role.kubernetes.io/master - effect: NoSchedule - - key: "CriticalAddonsOnly" - operator: "Exists" - terminationGracePeriodSeconds: 0 - serviceAccountName: terway - hostNetwork: true - initContainers: - - name: terway-init - image: TERWAY_IMAGE - imagePullPolicy: Always - securityContext: - privileged: true - command: ['sh', '-c', 'cp /usr/bin/terway /opt/cni/bin/; chmod +x /opt/cni/bin/terway; cp /etc/eni/10-terway.conf /etc/cni/net.d/; modprobe sch_htb || true'] - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - name: cni-bin - mountPath: /opt/cni/bin/ - - name: cni - mountPath: /etc/cni/net.d/ - - mountPath: /lib/modules - name: lib-modules - containers: - - name: terway - image: TERWAY_IMAGE - command: ['/usr/bin/terwayd', '-log-level', 'debug', '-daemon-mode', 'ENIOnly'] - imagePullPolicy: Always - securityContext: - privileged: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - mountPath: /var/run/ - name: eni-run - - mountPath: /opt/cni/bin/ - name: cni-bin - - mountPath: /lib/modules - name: lib-modules - - mountPath: /var/lib/cni/networks - name: cni-networks - - mountPath: /var/lib/kubelet/device-plugins - name: device-plugin-path - - mountPath: /var/lib/cni/terway - name: cni-terway - - name: policy - image: TERWAY_IMAGE - command: ["/bin/policyinit.sh"] - imagePullPolicy: Always - env: - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - securityContext: - privileged: true - resources: - requests: - cpu: 250m - livenessProbe: - httpGet: - path: /liveness - port: 9099 - host: localhost - periodSeconds: 10 - initialDelaySeconds: 10 - failureThreshold: 6 - readinessProbe: - httpGet: - path: /readiness - port: 9099 - host: localhost - periodSeconds: 10 - volumeMounts: - - mountPath: /lib/modules - name: lib-modules - - volumes: - - name: configvolume - configMap: - name: eni-config - items: - - key: eni_conf - path: eni.json - - key: 10-terway.conf - path: 10-terway.conf - - name: cni-bin - hostPath: - path: /opt/cni/bin - type: "Directory" - - name: cni - hostPath: - path: /etc/cni/net.d - - name: eni-run - hostPath: - path: /var/run/ - type: "Directory" - - name: lib-modules - hostPath: - path: /lib/modules - - name: cni-networks - hostPath: - path: /var/lib/cni/networks - - name: device-plugin-path - hostPath: - path: /var/lib/kubelet/device-plugins - type: "Directory" - - name: cni-terway - hostPath: - path: /var/lib/cni/terway - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: felixconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: FelixConfiguration - plural: felixconfigurations - singular: felixconfiguration - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: bgpconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BGPConfiguration - plural: bgpconfigurations - singular: bgpconfiguration - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: ippools.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPPool - plural: ippools - singular: ippool - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: hostendpoints.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: HostEndpoint - plural: hostendpoints - singular: hostendpoint - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: clusterinformations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: ClusterInformation - plural: clusterinformations - singular: clusterinformation - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworkpolicies.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkPolicy - plural: globalnetworkpolicies - singular: globalnetworkpolicy - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworksets.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkSet - plural: globalnetworksets - singular: globalnetworkset - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: networkpolicies.crd.projectcalico.org -spec: - scope: Namespaced - group: crd.projectcalico.org - version: v1 - names: - kind: NetworkPolicy - plural: networkpolicies - singular: networkpolicy \ No newline at end of file diff --git a/tests/templates/terway/terway-multiip.yml b/tests/templates/terway/terway-multiip.yml deleted file mode 100644 index 2546bea9..00000000 --- a/tests/templates/terway/terway-multiip.yml +++ /dev/null @@ -1,333 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: terway - namespace: kube-system - ---- - -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: terway-pod-reader - namespace: kube-system -rules: -- apiGroups: [""] - resources: ["pods", "nodes", "namespaces", "configmaps", "serviceaccounts"] - verbs: ["get", "watch", "list", "update"] -- apiGroups: ["networking.k8s.io"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: ["extensions"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: [""] - resources: - - pods/status - verbs: - - update -- apiGroups: ["crd.projectcalico.org"] - resources: ["*"] - verbs: ["*"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: terway-binding - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: terway-pod-reader -subjects: -- kind: ServiceAccount - name: terway - namespace: kube-system - ---- - -kind: ConfigMap -apiVersion: v1 -metadata: - name: eni-config - namespace: kube-system -data: - eni_conf: | - { - "version": "1", - "access_key": "ACCESS_KEY", - "access_secret": "ACCESS_SECRET", - "security_group": "SECURITY_GROUP", - "vswitches": { - "cn-hongkong-b": ["VSWITCH"] - }, - "max_pool_size": 5, - "min_pool_size": 0 - } - 10-terway.conf: | - { - "cniVersion": "0.4.0", - "name": "terway", - "type": "terway" - } - ---- - -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: terway - namespace: kube-system -spec: - template: - metadata: - labels: - app: terway - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - hostPID: true - nodeSelector: - beta.kubernetes.io/arch: amd64 - tolerations: - - operator: "Exists" - terminationGracePeriodSeconds: 0 - serviceAccountName: terway - hostNetwork: true - initContainers: - - name: terway-init - image: TERWAY_IMAGE - imagePullPolicy: Always - securityContext: - privileged: true - command: - - 'sh' - - '-c' - - 'cp /usr/bin/terway /opt/cni/bin/; - chmod +x /opt/cni/bin/terway; - cp /etc/eni/10-terway.conf /etc/cni/net.d/; - modprobe sch_htb || true; - chroot /host sh -c "systemctl disable eni.service; rm -f /etc/udev/rules.d/75-persistent-net-generator.rules /lib/udev/rules.d/60-net.rules /lib/udev/rules.d/61-eni.rules /lib/udev/write_net_rules && udevadm control --reload-rules && udevadm trigger; true"' - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - name: cni-bin - mountPath: /opt/cni/bin/ - - name: cni - mountPath: /etc/cni/net.d/ - - mountPath: /lib/modules - name: lib-modules - - mountPath: /host - name: host-root - containers: - - name: terway - image: TERWAY_IMAGE - imagePullPolicy: Always - command: ['/usr/bin/terwayd', '-log-level', 'debug', '-daemon-mode', 'ENIMultiIP'] - securityContext: - privileged: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - mountPath: /var/run/ - name: eni-run - - mountPath: /opt/cni/bin/ - name: cni-bin - - mountPath: /lib/modules - name: lib-modules - - mountPath: /var/lib/cni/networks - name: cni-networks - - mountPath: /var/lib/cni/terway - name: cni-terway - - mountPath: /var/lib/kubelet/device-plugins - name: device-plugin-path - - name: policy - image: TERWAY_IMAGE - imagePullPolicy: Always - command: ["/bin/policyinit.sh"] - env: - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - securityContext: - privileged: true - resources: - requests: - cpu: 250m - livenessProbe: - httpGet: - path: /liveness - port: 9099 - host: localhost - periodSeconds: 10 - initialDelaySeconds: 10 - failureThreshold: 6 - readinessProbe: - httpGet: - path: /readiness - port: 9099 - host: localhost - periodSeconds: 10 - volumeMounts: - - mountPath: /lib/modules - name: lib-modules - volumes: - - name: configvolume - configMap: - name: eni-config - items: - - key: eni_conf - path: eni.json - - key: 10-terway.conf - path: 10-terway.conf - - name: cni-bin - hostPath: - path: /opt/cni/bin - type: "Directory" - - name: cni - hostPath: - path: /etc/cni/net.d - - name: eni-run - hostPath: - path: /var/run/ - type: "Directory" - - name: lib-modules - hostPath: - path: /lib/modules - - name: cni-networks - hostPath: - path: /var/lib/cni/networks - - name: cni-terway - hostPath: - path: /var/lib/cni/terway - - name: device-plugin-path - hostPath: - path: /var/lib/kubelet/device-plugins - type: "Directory" - - name: host-root - hostPath: - path: / - type: "Directory" - - - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: bgpconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BGPConfiguration - plural: bgpconfigurations - singular: bgpconfiguration - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: ippools.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPPool - plural: ippools - singular: ippool - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: hostendpoints.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: HostEndpoint - plural: hostendpoints - singular: hostendpoint - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: clusterinformations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: ClusterInformation - plural: clusterinformations - singular: clusterinformation - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworkpolicies.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkPolicy - plural: globalnetworkpolicies - singular: globalnetworkpolicy - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworksets.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkSet - plural: globalnetworksets - singular: globalnetworkset - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: networkpolicies.crd.projectcalico.org -spec: - scope: Namespaced - group: crd.projectcalico.org - version: v1 - names: - kind: NetworkPolicy - plural: networkpolicies - singular: networkpolicy diff --git a/tests/templates/terway/terway-vpc.yml b/tests/templates/terway/terway-vpc.yml deleted file mode 100644 index 92abc045..00000000 --- a/tests/templates/terway/terway-vpc.yml +++ /dev/null @@ -1,342 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: terway - namespace: kube-system - ---- - -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: terway-pod-reader - namespace: kube-system -rules: -- apiGroups: [""] - resources: ["pods", "nodes", "namespaces", "configmaps", "serviceaccounts"] - verbs: ["get", "watch", "list", "update"] -- apiGroups: ["networking.k8s.io"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: ["extensions"] - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: [""] - resources: - - pods/status - verbs: - - update -- apiGroups: ["crd.projectcalico.org"] - resources: ["*"] - verbs: ["*"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: terway-binding - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: terway-pod-reader -subjects: - - kind: ServiceAccount - name: terway - namespace: kube-system - ---- - -kind: ConfigMap -apiVersion: v1 -metadata: - name: eni-config - namespace: kube-system -data: - eni_conf: | - { - "version": "1", - "access_key": "ACCESS_KEY", - "access_secret": "ACCESS_SECRET", - "service_cidr": "SERVICE_CIDR", - "security_group": "SECURITY_GROUP", - "vswitches": { - "cn-hongkong-b": ["VSWITCH"] - }, - "max_pool_size": 5, - "min_pool_size": 0 - } - 10-terway.conf: | - { - "cniVersion": "0.4.0", - "name": "terway", - "type": "terway" - } - ---- - -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: terway - namespace: kube-system -spec: - template: - metadata: - labels: - app: terway - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - hostPID: true - nodeSelector: - beta.kubernetes.io/arch: amd64 - tolerations: - - key: node.cloudprovider.kubernetes.io/uninitialized - value: "true" - effect: NoSchedule - - key: node-role.kubernetes.io/master - effect: NoSchedule - - key: "CriticalAddonsOnly" - operator: "Exists" - terminationGracePeriodSeconds: 0 - serviceAccountName: terway - hostNetwork: true - initContainers: - - name: terway-init - image: TERWAY_IMAGE - imagePullPolicy: Always - securityContext: - privileged: true - command: ['sh', '-c', 'cp /usr/bin/terway /opt/cni/bin/; chmod +x /opt/cni/bin/terway; cp /etc/eni/10-terway.conf /etc/cni/net.d/; modprobe sch_htb || true'] - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - name: cni-bin - mountPath: /opt/cni/bin/ - - name: cni - mountPath: /etc/cni/net.d/ - - mountPath: /lib/modules - name: lib-modules - containers: - - name: terway - image: TERWAY_IMAGE - imagePullPolicy: Always - securityContext: - privileged: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - name: configvolume - mountPath: /etc/eni - - mountPath: /var/run/ - name: eni-run - - mountPath: /opt/cni/bin/ - name: cni-bin - - mountPath: /lib/modules - name: lib-modules - - mountPath: /var/lib/cni/networks - name: cni-networks - - mountPath: /var/lib/kubelet/device-plugins - name: device-plugin-path - - mountPath: /var/lib/cni/terway - name: cni-terway - - name: policy - image: TERWAY_IMAGE - command: ["/bin/policyinit.sh"] - imagePullPolicy: Always - env: - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: Network - value: POD_CIDR - securityContext: - privileged: true - resources: - requests: - cpu: 250m - livenessProbe: - httpGet: - path: /liveness - port: 9099 - host: localhost - periodSeconds: 10 - initialDelaySeconds: 10 - failureThreshold: 6 - readinessProbe: - httpGet: - path: /readiness - port: 9099 - host: localhost - periodSeconds: 10 - volumeMounts: - - mountPath: /lib/modules - name: lib-modules - - volumes: - - name: configvolume - configMap: - name: eni-config - items: - - key: eni_conf - path: eni.json - - key: 10-terway.conf - path: 10-terway.conf - - name: cni-bin - hostPath: - path: /opt/cni/bin - type: "Directory" - - name: cni - hostPath: - path: /etc/cni/net.d - - name: eni-run - hostPath: - path: /var/run/ - type: "Directory" - - name: lib-modules - hostPath: - path: /lib/modules - - name: cni-networks - hostPath: - path: /var/lib/cni/networks - - name: device-plugin-path - hostPath: - path: /var/lib/kubelet/device-plugins - type: "Directory" - - name: cni-terway - hostPath: - path: /var/lib/cni/terway - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: felixconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: FelixConfiguration - plural: felixconfigurations - singular: felixconfiguration - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: bgpconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BGPConfiguration - plural: bgpconfigurations - singular: bgpconfiguration - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: ippools.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPPool - plural: ippools - singular: ippool - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: hostendpoints.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: HostEndpoint - plural: hostendpoints - singular: hostendpoint - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: clusterinformations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: ClusterInformation - plural: clusterinformations - singular: clusterinformation - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworkpolicies.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkPolicy - plural: globalnetworkpolicies - singular: globalnetworkpolicy - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: globalnetworksets.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkSet - plural: globalnetworksets - singular: globalnetworkset - ---- - -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: networkpolicies.crd.projectcalico.org -spec: - scope: Namespaced - group: crd.projectcalico.org - version: v1 - names: - kind: NetworkPolicy - plural: networkpolicies - singular: networkpolicy \ No newline at end of file diff --git a/tests/templates/testcases/network_connection/crosshost.yml b/tests/templates/testcases/network_connection/crosshost.yml deleted file mode 100644 index 1b676106..00000000 --- a/tests/templates/testcases/network_connection/crosshost.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Test tomcat page on every node with command: -# "kubectl get node -o yaml | grep 'address:' | awk '{print $3}' | xargs -n1 -I {} curl -I {}:30080" - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: tomcat-deploy - labels: - app: vpc-crosshost-tomcat -spec: - selector: - matchLabels: - app: vpc-crosshost-tomcat - template: - metadata: - labels: - app: vpc-crosshost-tomcat - spec: - containers: - - image: registry.aliyuncs.com/acs-sample/nginx - name: nginx - ---- - -apiVersion: v1 -kind: Service -metadata: - name: tomcat-service -spec: - selector: - app: vpc-crosshost-tomcat - ports: - - port: 8080 - protocol: TCP - clusterIP: None - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /_healthz { - add_header Content-Type text/plain; - return 200 'ok'; - } - location / { - proxy_pass http://tomcat-service:80; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vpc-crosshost-nginx - labels: - app: vpc-crosshost-nginx -spec: - selector: - matchLabels: - app: vpc-crosshost-nginx - template: - metadata: - labels: - app: vpc-crosshost-nginx - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - vpc-crosshost-tomcat - topologyKey: kubernetes.io/hostname ---- - -apiVersion: v1 -kind: Service -metadata: - name: nginx-service -spec: - type: NodePort - selector: - app: vpc-crosshost-nginx - ports: - - protocol: TCP - nodePort: 30090 - port: 80 - diff --git a/tests/templates/testcases/network_connection/eni.yml b/tests/templates/testcases/network_connection/eni.yml deleted file mode 100644 index 7d29ef9b..00000000 --- a/tests/templates/testcases/network_connection/eni.yml +++ /dev/null @@ -1,110 +0,0 @@ -# Test tomcat page on every node with command: -# "kubectl get node -o yaml | grep 'address:' | awk '{print $3}' | xargs -n1 -I {} curl -I {}:30080" - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: tomcat-deploy - labels: - app: eni-tomcat -spec: - selector: - matchLabels: - app: eni-tomcat - template: - metadata: - labels: - app: eni-tomcat - spec: - containers: - - image: registry.aliyuncs.com/acs-sample/nginx - name: nginx - resources: - limits: - aliyun/eni: 1 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: tomcat-service -spec: - selector: - app: eni-tomcat - ports: - - port: 8080 - protocol: TCP - clusterIP: None - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /_healthz { - add_header Content-Type text/plain; - return 200 'ok'; - } - location / { - proxy_pass http://tomcat-service:80; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: eni-nginx - labels: - app: eni-nginx -spec: - selector: - matchLabels: - app: eni-nginx - template: - metadata: - labels: - app: eni-nginx - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - resources: - limits: - aliyun/eni: 1 ---- - -apiVersion: v1 -kind: Service -metadata: - name: nginx-service -spec: - type: NodePort - selector: - app: eni-nginx - ports: - - protocol: TCP - nodePort: 30100 - port: 80 - diff --git a/tests/templates/testcases/network_connection/samehost.yml b/tests/templates/testcases/network_connection/samehost.yml deleted file mode 100644 index 280fbcd0..00000000 --- a/tests/templates/testcases/network_connection/samehost.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Test tomcat page on every node with command: -# "kubectl get node -o yaml | grep 'address:' | awk '{print $3}' | xargs -n1 -I {} curl -I {}:30080" - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: tomcat-deploy - labels: - app: vpc-samehost-tomcat -spec: - selector: - matchLabels: - app: vpc-samehost-tomcat - template: - metadata: - labels: - app: vpc-samehost-tomcat - spec: - containers: - - image: registry.aliyuncs.com/acs-sample/nginx - name: nginx - ---- - -apiVersion: v1 -kind: Service -metadata: - name: tomcat-service -spec: - selector: - app: vpc-samehost-tomcat - ports: - - port: 8080 - protocol: TCP - clusterIP: None - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /_healthz { - add_header Content-Type text/plain; - return 200 'ok'; - } - location / { - proxy_pass http://tomcat-service:80; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vpc-samehost-nginx - labels: - app: vpc-samehost-nginx -spec: - selector: - matchLabels: - app: vpc-samehost-nginx - template: - metadata: - labels: - app: vpc-samehost-nginx - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - vpc-samehost-tomcat - topologyKey: kubernetes.io/hostname ---- - -apiVersion: v1 -kind: Service -metadata: - name: nginx-service -spec: - type: NodePort - selector: - app: vpc-samehost-nginx - ports: - - protocol: TCP - nodePort: 30080 - port: 80 - diff --git a/tests/templates/testcases/network_connection/vpc-eni.yml b/tests/templates/testcases/network_connection/vpc-eni.yml deleted file mode 100644 index fe6be723..00000000 --- a/tests/templates/testcases/network_connection/vpc-eni.yml +++ /dev/null @@ -1,107 +0,0 @@ -# Test tomcat page on every node with command: -# "kubectl get node -o yaml | grep 'address:' | awk '{print $3}' | xargs -n1 -I {} curl -I {}:30080" - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: tomcat-deploy - labels: - app: vpc-tomcat -spec: - selector: - matchLabels: - app: vpc-tomcat - template: - metadata: - labels: - app: vpc-tomcat - spec: - containers: - - image: registry.aliyuncs.com/acs-sample/nginx - name: nginx - ---- - -apiVersion: v1 -kind: Service -metadata: - name: tomcat-service -spec: - selector: - app: vpc-tomcat - ports: - - port: 8080 - protocol: TCP - clusterIP: None - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /_healthz { - add_header Content-Type text/plain; - return 200 'ok'; - } - location / { - proxy_pass http://tomcat-service:80; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vpc-eni-nginx - labels: - app: vpc-eni-nginx -spec: - selector: - matchLabels: - app: vpc-eni-nginx - template: - metadata: - labels: - app: vpc-eni-nginx - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - resources: - limits: - aliyun/eni: 1 ---- - -apiVersion: v1 -kind: Service -metadata: - name: nginx-service -spec: - type: NodePort - selector: - app: vpc-eni-nginx - ports: - - protocol: TCP - nodePort: 30110 - port: 80 - diff --git a/tests/templates/testcases/network_policy/network-policy.yml b/tests/templates/testcases/network_policy/network-policy.yml deleted file mode 100644 index 5dc09293..00000000 --- a/tests/templates/testcases/network_policy/network-policy.yml +++ /dev/null @@ -1,157 +0,0 @@ -# namespace network-test -apiVersion: v1 -kind: Namespace -metadata: - name: network-test - ---- -# server pod with policy -apiVersion: v1 -kind: Pod -metadata: - name: policy-spod - namespace: network-test - labels: - app: policy-spod -spec: - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: access-policy - namespace: network-test -spec: - podSelector: - matchLabels: - app: policy-spod - ingress: - - from: - - podSelector: - matchLabels: - access: "true" - ---- -apiVersion: v1 -kind: Service -metadata: - name: policy-svc - namespace: network-test -spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: policy-spod - ---- -# server pod without policy -apiVersion: v1 -kind: Pod -metadata: - name: non-policy-spod - namespace: network-test - labels: - app: non-policy-spod -spec: - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchLabels: - app: policy-spod - topologyKey: kubernetes.io/hostname - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - ---- -apiVersion: v1 -kind: Service -metadata: - name: non-policy-svc - namespace: network-test -spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: non-policy-spod - ---- -# client pod without policy label -# at least 2 worker node needed for test network connection across nodes -apiVersion: v1 -kind: Pod -metadata: - name: non-policy-cli - namespace: network-test - labels: - app: non-policy-cli -spec: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: "app" - operator: In - values: - - non-policy-spod - - policy-spod - topologyKey: kubernetes.io/hostname - restartPolicy: Never - initContainers: - - name: waiting - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "for i in `seq 1 120`; do nslookup policy-svc && nslookup non-policy-svc && wget -T 1 non-policy-svc && sleep 30 && exit 0; sleep 1; done"] - containers: - - name: policy - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "wget -T 1 policy-svc"] - - name: non-policy - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "wget -T 1 non-policy-svc"] ---- - -# client pod with policy label -# at least 2 worker node needed for test network connection across nodes -apiVersion: v1 -kind: Pod -metadata: - name: policy-cli - namespace: network-test - labels: - app: policy-cli - access: "true" -spec: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: "app" - operator: In - values: - - non-policy-spod - - policy-spod - topologyKey: kubernetes.io/hostname - restartPolicy: Never - initContainers: - - name: waiting - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "for i in `seq 1 120`; do nslookup policy-svc && nslookup non-policy-svc && wget -T 1 non-policy-svc && sleep 30 && exit 0; sleep 1; done"] - containers: - - name: policy - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "wget -T 1 policy-svc"] - - name: non-policy - image: registry.aliyuncs.com/acs/alpine:3.6 - command: ["sh", "-c", "wget -T 1 non-policy-svc"] \ No newline at end of file diff --git a/tests/templates/testcases/service/loadbalancer.yml b/tests/templates/testcases/service/loadbalancer.yml deleted file mode 100644 index 535fd0e7..00000000 --- a/tests/templates/testcases/service/loadbalancer.yml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: spod - labels: - app: spod -spec: - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - ---- -# Cluster Loadbalancer -apiVersion: v1 -kind: Service -metadata: - name: loadbalancercluster - labels: - test: lbservice -spec: - selector: - app: spod - ports: - - port: 80 - targetPort: 80 - protocol: TCP - type: LoadBalancer - ---- -# Local Traffic Loadbalancer -apiVersion: v1 -kind: Service -metadata: - name: loadbalancerlocal - labels: - test: lbservice -spec: - selector: - app: spod - ports: - - port: 80 - targetPort: 80 - protocol: TCP - type: LoadBalancer - externalTrafficPolicy: Local \ No newline at end of file diff --git a/tests/templates/testcases/stress/nginx-pod-connection.yml b/tests/templates/testcases/stress/nginx-pod-connection.yml deleted file mode 100644 index c2429f96..00000000 --- a/tests/templates/testcases/stress/nginx-pod-connection.yml +++ /dev/null @@ -1,253 +0,0 @@ -# test namespace -apiVersion: v1 -kind: Namespace -metadata: - name: stress-connection - ---- -# nginx deployment -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: nginx - name: nginx - namespace: stress-connection -spec: - replicas: 50 - selector: - matchLabels: - app: nginx - template: - metadata: - labels: - app: nginx - usage: stress-test - spec: - containers: - - image: registry.aliyuncs.com/acs-sample/nginx - imagePullPolicy: IfNotPresent - name: nginx ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: nginx - name: nginx - namespace: stress-connection -spec: - ports: - - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: nginx - type: ClusterIP ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: nginx-headless - name: nginx-headless - namespace: stress-connection -spec: - clusterIP: None - ports: - - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: nginx - type: ClusterIP ---- -# ab deployment -## ab deploy to pod -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: ab-deploy-pod - name: ab-deploy-pod - namespace: stress-connection -spec: - replicas: 20 - selector: - matchLabels: - app: ab-deploy-pod - template: - metadata: - labels: - app: ab-deploy-pod - usage: stress-test - spec: - containers: - - image: registry.aliyuncs.com/wangbs/netperf - imagePullPolicy: IfNotPresent - name: ab-deploy-pod - resources: - limits: - memory: 1Gi - command: - - sh - - -c - - "ab -c 1 -n 100000000000000 -k http://nginx-headless/" ---- -## ab deploy to svc -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: ab-deploy-svc - name: ab-deploy-svc - namespace: stress-connection -spec: - replicas: 20 - selector: - matchLabels: - app: ab-deploy-svc - template: - metadata: - labels: - app: ab-deploy-svc - usage: stress-test - spec: - containers: - - image: registry.aliyuncs.com/wangbs/netperf - imagePullPolicy: IfNotPresent - name: ab-deploy-svc - resources: - limits: - memory: 1Gi - command: - - sh - - -c - - "ab -c 1 -n 100000000000000 -k http://nginx/" ---- -## ab deploy to svc non-keepalive -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: ab-deploy-svc-nk - name: ab-deploy-svc-nk - namespace: stress-connection -spec: - replicas: 10 - selector: - matchLabels: - app: ab-deploy-svc-nk - template: - metadata: - labels: - app: ab-deploy-svc-nk - usage: stress-test - spec: - containers: - - image: registry.aliyuncs.com/wangbs/netperf - imagePullPolicy: IfNotPresent - name: ab-deploy-svc-nk - resources: - limits: - memory: 1Gi - command: - - sh - - -c - - "ab -c 1 -n 100000000000000 http://nginx/" ---- -# blackbox deployment & metric advertise -apiVersion: apps/v1 -kind: Deployment -metadata: - name: blackbox - namespace: stress-connection -spec: - replicas: 10 - selector: - matchLabels: - app: blackbox - template: - metadata: - name: blackbox - labels: - app: blackbox - usage: stress-test - spec: - containers: - - name: blackbox - image: prom/blackbox-exporter:latest - imagePullPolicy: IfNotPresent - ports: - - name: web - containerPort: 9115 - livenessProbe: - httpGet: - path: /metrics - port: 9115 - initialDelaySeconds: 15 - timeoutSeconds: 1 ---- -apiVersion: v1 -kind: Service -metadata: - annotations: - prometheus.io/scrape: 'true' - labels: - app: blackbox - name: blackbox - namespace: stress-connection -spec: - selector: - app: blackbox - ports: - - name: blackbox - protocol: TCP - port: 9115 ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - k8s-app: prometheus-blackbox-exporter - name: prometheus-blackbox-exporter - namespace: stress-connection -spec: - endpoints: - - interval: 5s - port: blackbox - - interval: 5s - params: - module: - - http_2xx - target: - - nginx - path: "/probe" - targetPort: 9115 - relabelings: - - sourceLabels: - - __param_target - targetLabel: target - - sourceLabels: - - __param_module - targetLabel: module - - interval: 5s - params: - module: - - http_2xx - target: - - nginx-headless - path: "/probe" - targetPort: 9115 - relabelings: - - sourceLabels: - - __param_target - targetLabel: target - - sourceLabels: - - __param_module - targetLabel: module - namespaceSelector: - matchNames: - - stress-connection - selector: - app: blackbox \ No newline at end of file diff --git a/tests/templates/testcases/stress/nginx-pod-scale.yml b/tests/templates/testcases/stress/nginx-pod-scale.yml deleted file mode 100644 index 6bd90127..00000000 --- a/tests/templates/testcases/stress/nginx-pod-scale.yml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: stress-scale - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment - namespace: stress-scale -spec: - replicas: 3 - selector: - matchLabels: - app: nginx-test - template: - metadata: - labels: - app: nginx-test - usage: stress-test - spec: - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - diff --git a/tests/templates/testcases/stress/nginx-pod-service.yml b/tests/templates/testcases/stress/nginx-pod-service.yml deleted file mode 100644 index 4a0ba6cb..00000000 --- a/tests/templates/testcases/stress/nginx-pod-service.yml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: stress-service - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap - namespace: stress-service -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /healthz { - return 200 "ok"; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment - namespace: stress-service -spec: - replicas: 50 - selector: - matchLabels: - app: nginx-test - template: - metadata: - labels: - app: nginx-test - usage: stress-test - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - readinessProbe: - httpGet: - path: /healthz - port: 80 - initialDelaySeconds: 0 - periodSeconds: 1 \ No newline at end of file diff --git a/tests/templates/testcases/stress/nginx-pod-startup.yml b/tests/templates/testcases/stress/nginx-pod-startup.yml deleted file mode 100644 index 9903fd9a..00000000 --- a/tests/templates/testcases/stress/nginx-pod-startup.yml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap -data: - nginx.conf: | - worker_processes auto; - events { - } - http { - server { - server_name nginx; - listen 80 default_server; - location /healthz { - proxy_pass https://kubernetes/healthz; - } - } - } - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - replicas: 50 - selector: - matchLabels: - app: nginx-test - template: - metadata: - labels: - app: nginx-test - usage: stress-test - spec: - volumes: - - name: nginx - configMap: - name: nginx-configmap - containers: - - name: nginx - image: registry.aliyuncs.com/acs-sample/nginx - volumeMounts: - - name: nginx - mountPath: /etc/nginx - readOnly: true - readinessProbe: - httpGet: - path: /healthz - port: 80 - initialDelaySeconds: 0 - periodSeconds: 1 - diff --git a/tests/templates/testcases/stress/pod-networking.yml b/tests/templates/testcases/stress/pod-networking.yml deleted file mode 100644 index b587f6f1..00000000 --- a/tests/templates/testcases/stress/pod-networking.yml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: network.alibabacloud.com/v1beta1 -kind: PodNetworking -metadata: - name: stress-connection-stateless -spec: - ipType: - type: Elastic - selector: - podSelector: - matchLabels: - usage: stress-test \ No newline at end of file diff --git a/tests/templates/testcases/stress/service.yml b/tests/templates/testcases/stress/service.yml deleted file mode 100644 index 290a103d..00000000 --- a/tests/templates/testcases/stress/service.yml +++ /dev/null @@ -1,15 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: SERVICENAME - namespace: stress-service - labels: - app: nginx-service -spec: - selector: - app: nginx-test - type: ClusterIP - ports: - - name: http - port: 80 - targetPort: 80 \ No newline at end of file