-
Notifications
You must be signed in to change notification settings - Fork 264
Conversation
cc @brancz |
organization = "kube-master" | ||
} | ||
|
||
dns_names = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be used as a serving cert, just a client cert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, remove the dns names and ip addresses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Allowed usages bellow should also drop "server_auth"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
private_key_pem = "${tls_private_key.apiserver_proxy.private_key_pem}" | ||
|
||
subject { | ||
common_name = "kube-apiserver-proxy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common name has to match the value specified by:
--requestheader-allowed-names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I thought that was the CN in the CA. The docs are very unclear, and the metrics server appeared to be working. But I'll change the flag to this one in the operators-PR.
Ah, think I found the change I needed to make for smoke tests. |
zomg ruby linter doesn't like methods with more than 30 lines? |
I think azure flaked. |
In azure it looks like some of the pods never came up, not sure if this is typical:
|
On a high level this looks good to me. I'm wondering how aggregated APIs are going to get their server certs, seems like we want something like the certificates API, but for multi CA (kubernetes components, etcd, aggregated APIs,...). Do we have a solid idea how to solve that? |
Aggregated API servers get to advertise their own CA, which the API server then trusts https://github.com/kubernetes/kubernetes/blob/v1.9.2/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/types.go#L56 So the metrics server can generate a self-signed one and that should be fine. |
lgtm |
@brancz @ericchiang plot twist: apparently we don't want the metrics server to generate self-signed certs? |
retest this please. azure and bare metal. |
All tests passed! |
We probably want to provide the self-signed certs through a secret. Mentioned this on JIRA, but I'm going to follow up on kubernetes/kubernetes#54960 to see if there are any specific concerns around this strategy. I'm not familiar with the subtitles. |
platforms/aws/tectonic.tf
Outdated
aggregator_ca_cert_pem = "${module.kube_certs.aggregator_ca_cert_pem}" | ||
apiserver_cert_pem = "${module.kube_certs.apiserver_cert_pem}" | ||
apiserver_key_pem = "${module.kube_certs.apiserver_key_pem}" | ||
apiserver_proxy_cert_pem = "${module.kube_certs.apiserver_cert_pem}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this need to be module.kube_certs.apiserver_proxy_cert_pem
and module.kube_certs.apiserver_proxy_key_pem
? same question for all platforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thank you! Changed to the correct value.
@@ -0,0 +1,35 @@ | |||
# Kubernetes Aggregated API Server CA (resources/generated/tls/aggregator-ca.crt) | |||
# | |||
# TODO(diegs): this should be a sibling of the `--tls-ca-file` CA. However the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we add same todo in contrib module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
retest this please. govcloud and azure. |
govcloud:
azure: some pods never came up. |
retest this please. |
I give up. |
all green now @diegs |
value = "${tls_locally_signed_cert.aggregator_ca.cert_pem}" | ||
} | ||
|
||
output "aggregator_ca_key_pem" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious: why does this module output an aggregator_ca_key but not the tls/kube/user-provided?
It seems like this output is not consumed anywhere either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's not a required output. Got copy-paste happy. Removed.
"digital_signature", | ||
"client_auth", | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this module also create local files for the aggregated ca key and crt just like modules/tls/kube/self-signed
does? i.e.:
resource "local_file" "aggregator_ca_key" {
...
}
resource "local_file" "aggregator_ca_crt" {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@squat thanks for catching those mistakes, should be fixed now.
value = "${tls_locally_signed_cert.aggregator_ca.cert_pem}" | ||
} | ||
|
||
output "aggregator_ca_key_pem" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's not a required output. Got copy-paste happy. Removed.
"digital_signature", | ||
"client_auth", | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
dang, we have some merge conflicts. Conflicts are only on markdown files. All tests have passed for TF. I'm removing the labels and pushing an extra commit to fix the conflicts with the docs. |
ok |
This commit ports the documentation that was originally part of coreos/tectonic-installer#2850.
This adds a new CA and certificate pair to support running aggregated api-servers in the cluster. This is required for deploying metrics-server (heapster replacement) and other aggregated api-server components that will start to appear in 1.9+. In the self-signed scenario these are derived from the kube_ca, which happens to also be the apiserver serving ca. In practice the kube_ca should be the parent of both this CA and the one that is used by the --tls-ca-file flag in the apiserver. I added a TODO to fix that when we implement the "single CA is the parent of all generated certs" change for track 2.
@diegs: the tls module docs you wrote have been PRd to coreos/tectonic-docs#135 now that they no longer exist in this repo since #2678 |
@squat thanks! |
tls: add aggregated apiserver certs.
This adds a new CA and certificate pair to support running aggregated
api-servers in the cluster. This is required for deploying
metrics-server (heapster replacement) and other aggregated api-server
components that will start to appear in 1.9+.
In the self-signed scenario these are derived from the kube_ca, which
happens to also be the apiserver serving ca. In practice the kube_ca
should be the parent of both this CA and the one that is used by the
--tls-ca-file flag in the apiserver. I added a TODO to fix that when
we implement the "single CA is the parent of all generated certs" change
for track 2.