Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the env-overrides debugging hack to openshift-sdn #521

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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