Skip to content

Commit

Permalink
Support using common name as hostname for TLS server cert verification
Browse files Browse the repository at this point in the history
This change renders the daemonsets for ovnkube-master and ovnkube-node
using the same parameter that is used for the hostname parameter of
the PKI cert generated.
  • Loading branch information
abhat committed May 14, 2020
1 parent de27911 commit db3eee6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindata/network/ovn-kubernetes/006-pki.yaml
Expand Up @@ -7,4 +7,4 @@ metadata:
namespace: openshift-ovn-kubernetes
spec:
targetCert:
commonName: ovn
commonName: {{.OVN_CERT_CN}}
2 changes: 2 additions & 0 deletions bindata/network/ovn-kubernetes/ovnkube-master.yaml
Expand Up @@ -350,10 +350,12 @@ spec:
--sb-client-privkey /ovn-cert/tls.key \
--sb-client-cert /ovn-cert/tls.crt \
--sb-client-cacert /ovn-ca/ca-bundle.crt \
--sb-cert-common-name "{{.OVN_CERT_CN}}" \
--nb-address "{{.OVN_NB_DB_LIST}}" \
--nb-client-privkey /ovn-cert/tls.key \
--nb-client-cert /ovn-cert/tls.crt \
--nb-client-cacert /ovn-ca/ca-bundle.crt \
--nb-cert-common-name "{{.OVN_CERT_CN}}" \
--nbctl-daemon-mode true
lifecycle:
preStop:
Expand Down
2 changes: 2 additions & 0 deletions bindata/network/ovn-kubernetes/ovnkube-node.yaml
Expand Up @@ -126,9 +126,11 @@ spec:
--nb-client-privkey /ovn-cert/tls.key \
--nb-client-cert /ovn-cert/tls.crt \
--nb-client-cacert /ovn-ca/ca-bundle.crt \
--nb-cert-common-name "{{.OVN_CERT_CN}}" \
--sb-client-privkey /ovn-cert/tls.key \
--sb-client-cert /ovn-cert/tls.crt \
--sb-client-cacert /ovn-ca/ca-bundle.crt \
--sb-cert-common-name "{{.OVN_CERT_CN}}" \
--config-file=/run/ovnkube-config/ovnkube.conf \
--loglevel "${OVN_KUBE_LOG_LEVEL}" \
${hybrid_overlay_flags} \
Expand Down
2 changes: 2 additions & 0 deletions pkg/network/ovn_kubernetes.go
Expand Up @@ -30,6 +30,7 @@ const OVN_NB_RAFT_PORT = "9643"
const OVN_SB_RAFT_PORT = "9644"
const CLUSTER_CONFIG_NAME = "cluster-config-v1"
const CLUSTER_CONFIG_NAMESPACE = "kube-system"
const OVN_CERT_CN = "ovnkube-master"

// renderOVNKubernetes returns the manifests for the ovn-kubernetes.
// This creates
Expand Down Expand Up @@ -63,6 +64,7 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
data.Data["OVN_MASTER_IP"] = bootstrapResult.OVN.MasterIPs[0]
data.Data["OVN_MIN_AVAILABLE"] = len(bootstrapResult.OVN.MasterIPs)/2 + 1
data.Data["LISTEN_DUAL_STACK"] = listenDualStack(bootstrapResult.OVN.MasterIPs[0])
data.Data["OVN_CERT_CN"] = OVN_CERT_CN

var ippools string
for _, net := range conf.ClusterNetwork {
Expand Down

0 comments on commit db3eee6

Please sign in to comment.