Skip to content

Commit

Permalink
Merge branch 'master' into leader_election
Browse files Browse the repository at this point in the history
  • Loading branch information
pliurh authored Jun 22, 2021
2 parents fb30f8c + 26f20eb commit 3c93d38
Show file tree
Hide file tree
Showing 112 changed files with 8,592 additions and 1,809 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ deploy-setup-k8s: export CLUSTER_TYPE=kubernetes
deploy-setup-k8s: deploy-setup

test-e2e-conformance:
./hack/run-e2e-conformance.sh
SUITE=./test/conformance ./hack/run-e2e-conformance.sh

test-e2e-validation-only:
SUITE=./test/validation ./hack/run-e2e-conformance.sh

test-e2e: generate vet manifests skopeo
mkdir -p ${ENVTEST_ASSETS_DIR}
Expand All @@ -220,6 +223,9 @@ test-%: generate vet manifests
# deploy-setup-k8s: export CNI_BIN_PATH=/opt/cni/bin
# test-e2e-k8s: test-e2e

deploy-wait:
hack/deploy-wait.sh

undeploy: uninstall
@hack/undeploy.sh $(NAMESPACE)

Expand Down
1 change: 1 addition & 0 deletions api/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var VfIds = []string{}
// NicIdMap contains supported mapping of IDs with each in the format of:
// Vendor ID, Physical Function Device ID, Virtual Function Device ID
var NicIdMap = []string{
"8086 158a 154c", // I40e XXV710
"8086 158b 154c", // I40e 25G SFP28
"8086 1572 154c", // I40e 10G X710 SFP+
"8086 0d58 154c", // I40e XXV710 N3000
Expand Down
7 changes: 7 additions & 0 deletions bindata/manifests/daemon/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
app: sriov-network-config-daemon
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
Expand All @@ -28,6 +30,7 @@ spec:
tolerations:
- operator: Exists
serviceAccountName: sriov-network-config-daemon
priorityClassName: "system-node-critical"
containers:
- name: sriov-network-config-daemon
image: {{.Image}}
Expand All @@ -49,6 +52,10 @@ spec:
fieldPath: metadata.namespace
- name: CLUSTER_TYPE
value: "{{.ClusterType}}"
resources:
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: host
mountPath: /host
Expand Down
15 changes: 14 additions & 1 deletion bindata/manifests/operator-webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,24 @@ spec:
app: operator-webhook
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
app: operator-webhook
spec:
serviceAccountName: operator-webhook-sa
priorityClassName: "system-cluster-critical"
nodeSelector:
beta.kubernetes.io/os: linux
node-role.kubernetes.io/master:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
Expand All @@ -49,6 +58,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
memory: 50Mi
volumeMounts:
- mountPath: /etc/tls
name: tls
Expand Down
11 changes: 11 additions & 0 deletions bindata/manifests/plugins/sriov-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spec:
app: sriov-cni
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
Expand All @@ -28,18 +30,27 @@ spec:
tolerations:
- operator: Exists
serviceAccountName: sriov-cni
priorityClassName: "system-node-critical"
containers:
- name: sriov-cni
image: {{.SRIOVCNIImage}}
securityContext:
privileged: true
resources:
requests:
cpu: 10m
memory: 10Mi
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: sriov-infiniband-cni
image: {{.SRIOVInfiniBandCNIImage}}
securityContext:
privileged: true
resources:
requests:
cpu: 10m
memory: 10Mi
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
Expand Down
7 changes: 7 additions & 0 deletions bindata/manifests/plugins/sriov-device-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spec:
app: sriov-device-plugin
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
Expand All @@ -29,6 +31,7 @@ spec:
tolerations:
- operator: Exists
serviceAccountName: sriov-device-plugin
priorityClassName: "system-node-critical"
containers:
- name: sriov-device-plugin
image: {{.SRIOVDevicePluginImage}}
Expand All @@ -43,6 +46,10 @@ spec:
fieldPath: spec.nodeName
securityContext:
privileged: true
resources:
requests:
cpu: 10m
memory: 50Mi
volumeMounts:
- name: devicesock
mountPath: /var/lib/kubelet/
Expand Down
1 change: 1 addition & 0 deletions bindata/manifests/webhook/003-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ webhooks:
- name: network-resources-injector-config.k8s.io
sideEffects: None
admissionReviewVersions: [v1]
failurePolicy: Ignore
clientConfig:
service:
name: network-resources-injector-service
Expand Down
15 changes: 14 additions & 1 deletion bindata/manifests/webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ spec:
app: network-resources-injector
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
Expand All @@ -25,9 +27,16 @@ spec:
openshift.io/component: network
spec:
serviceAccountName: network-resources-injector-sa
priorityClassName: "system-cluster-critical"
nodeSelector:
beta.kubernetes.io/os: linux
node-role.kubernetes.io/master:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
Expand All @@ -53,6 +62,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
memory: 50Mi
volumeMounts:
- mountPath: /etc/tls
name: tls
Expand Down
18 changes: 16 additions & 2 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,39 @@ spec:
selector:
matchLabels:
name: sriov-network-operator
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
labels:
name: sriov-network-operator
spec:
nodeSelector:
node-role.kubernetes.io/master: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
serviceAccountName: sriov-network-operator
priorityClassName: "system-node-critical"
containers:
- name: sriov-network-operator
# Replace this with the built image name
image: $SRIOV_NETWORK_OPERATOR_IMAGE
command:
- sriov-network-operator
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
61 changes: 43 additions & 18 deletions deployment/sriov-network-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: ClusterRole
metadata:
name: {{ include "sriov-network-operator.fullname" . }}
labels:
{{- include "sriov-network-operator.labels" . | nindent 4 }}
roleRef:
kind: ClusterRole
name: {{ include "sriov-network-operator.fullname" . }}
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "sriov-network-operator.fullname" . }}
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["get"]
- apiGroups: [""]
resources: ["namespaces", "serviceaccounts"]
verbs: ["*"]
- apiGroups: ["k8s.cni.cncf.io"]
resources: ["network-attachment-definitions"]
verbs: ["*"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterroles", "clusterrolebindings"]
verbs: ["*"]
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"]
verbs: ["*"]
- apiGroups: ["sriovnetwork.openshift.io"]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["machineconfiguration.openshift.io"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: ClusterRole
metadata:
name: sriov-network-config-daemon
labels:
{{- include "sriov-network-operator.labels" . | nindent 4 }}
roleRef:
kind: ClusterRole
name: sriov-network-config-daemon
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: sriov-network-config-daemon
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["get"]
- apiGroups: [""]
resources: ["pods/eviction"]
verbs: ["create"]
61 changes: 18 additions & 43 deletions deployment/sriov-network-operator/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,29 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: ClusterRoleBinding
metadata:
name: {{ include "sriov-network-operator.fullname" . }}
labels:
{{- include "sriov-network-operator.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["get"]
- apiGroups: [""]
resources: [namespaces, serviceaccounts]
verbs: ["*"]
- apiGroups: ["k8s.cni.cncf.io"]
resources: ["network-attachment-definitions"]
verbs: ["*"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: [clusterroles, clusterrolebindings]
verbs: ["*"]
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"]
verbs: ["*"]
- apiGroups: ["sriovnetwork.openshift.io"]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["machineconfiguration.openshift.io"]
resources: ["*"]
verbs: ["*"]
roleRef:
kind: ClusterRole
name: {{ include "sriov-network-operator.fullname" . }}
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "sriov-network-operator.fullname" . }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: ClusterRoleBinding
metadata:
name: sriov-network-config-daemon
labels:
{{- include "sriov-network-operator.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["get"]
- apiGroups: [""]
resources: ["pods/eviction"]
verbs: ["create"]
roleRef:
kind: ClusterRole
name: sriov-network-config-daemon
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: sriov-network-config-daemon
Loading

0 comments on commit 3c93d38

Please sign in to comment.