Skip to content

Commit

Permalink
Merge pull request #521 from danwinship/sdn-debug-configmap
Browse files Browse the repository at this point in the history
Add the env-overrides debugging hack to openshift-sdn
  • Loading branch information
openshift-merge-robot committed Mar 17, 2020
2 parents db8285e + 9c49811 commit f3fb011
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ spec:
genevePort: 6081
```

Additionally, you can configure per-node verbosity for ovn-kubernetes. This is useful
Additionally, you can configure per-node verbosity for openshift-sdn and ovn-kubernetes. This is useful
if you want to debug an issue, and can reproduce it on a single node. To do this,
create a special ConfigMap with keys based on the Node's name:

Expand All @@ -215,6 +215,8 @@ data:
OVN_LOG_LEVEL=dbg
```

(For openshift-sdn, use `namespace: openshift-sdn` and, eg, `OPENSHIFT_SDN_LOG_LEVEL=5`.)

### Configuring OVNKubernetes On a Hybrid Cluster
OVNKubernetes supports a hybrid cluster of both Linux and Windows nodes on x86_64 hosts. The ovn configuration is done as described above. In addition the `hybridOverlayConfig` can be included as follows:

Expand Down
20 changes: 19 additions & 1 deletion bindata/network/openshift-sdn/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ spec:
containers:
- name: sdn-controller
image: {{.SDNImage}}
command: ["openshift-sdn-controller"]
command:
- /bin/bash
- -c
- |
if [[ -f /env/_master ]]; then
set -o allexport
source /env/_master
set +o allexport
fi
exec openshift-sdn-controller --v=${OPENSHIFT_SDN_LOG_LEVEL:-2}
resources:
requests:
cpu: 10m
Expand All @@ -33,6 +43,9 @@ spec:
- name: KUBERNETES_SERVICE_HOST
value: "{{.KUBERNETES_SERVICE_HOST}}"
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /env
name: env-overrides
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/master: ""
Expand All @@ -49,3 +62,8 @@ spec:
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoSchedule"
volumes:
- name: env-overrides
configMap:
name: env-overrides
optional: true
15 changes: 14 additions & 1 deletion bindata/network/openshift-sdn/sdn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,27 @@ spec:
rmdir /etc/sysconfig/openshift-sdn || true
fi
# configmap-based overrides
if [[ -f /env/${K8S_NODE_NAME} ]]; then
set -o allexport
source /env/${K8S_NODE_NAME}
set +o allexport
fi
# Take over network functions on the node
rm -f /etc/cni/net.d/80-openshift-network.conf
cp -f /opt/cni/bin/openshift-sdn /host/opt/cni/bin/
# Launch the network process
exec /usr/bin/openshift-sdn-node --proxy-config=/config/kube-proxy-config.yaml --v=${DEBUG_LOGLEVEL:-2}
exec /usr/bin/openshift-sdn-node --proxy-config=/config/kube-proxy-config.yaml --v=${OPENSHIFT_SDN_LOG_LEVEL:-2}
securityContext:
privileged: true
volumeMounts:
- mountPath: /config
name: config
readOnly: true
- mountPath: /env
name: env-overrides
# Mount the entire run directory for socket access for Docker or CRI-o
# TODO: remove
- mountPath: /var/run
Expand Down Expand Up @@ -173,6 +182,10 @@ spec:
- name: config
configMap:
name: sdn-config
- name: env-overrides
configMap:
name: env-overrides
optional: true
- name: etc-sysconfig
hostPath:
path: /etc/sysconfig
Expand Down

0 comments on commit f3fb011

Please sign in to comment.