mirror of https://github.com/kubernetes/kops.git
Use consistent ServiceAccountJWKSURI default for PublicJWKS
This commit is contained in:
parent
a79da8ee86
commit
d21cb0f306
|
|
@ -17,8 +17,6 @@ limitations under the License.
|
||||||
package components
|
package components
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
"k8s.io/kops/pkg/apis/kops"
|
"k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/pkg/featureflag"
|
"k8s.io/kops/pkg/featureflag"
|
||||||
"k8s.io/kops/pkg/model/iam"
|
"k8s.io/kops/pkg/model/iam"
|
||||||
|
|
@ -64,14 +62,9 @@ func (b *DiscoveryOptionsBuilder) BuildOptions(o interface{}) error {
|
||||||
kubeAPIServer.FeatureGates = make(map[string]string)
|
kubeAPIServer.FeatureGates = make(map[string]string)
|
||||||
}
|
}
|
||||||
kubeAPIServer.FeatureGates["ServiceAccountIssuerDiscovery"] = "true"
|
kubeAPIServer.FeatureGates["ServiceAccountIssuerDiscovery"] = "true"
|
||||||
|
}
|
||||||
|
|
||||||
if kubeAPIServer.ServiceAccountJWKSURI == nil {
|
if kubeAPIServer.ServiceAccountJWKSURI == nil {
|
||||||
jwksURL := *kubeAPIServer.ServiceAccountIssuer
|
|
||||||
jwksURL = strings.TrimSuffix(jwksURL, "/") + "/keys.json"
|
|
||||||
|
|
||||||
kubeAPIServer.ServiceAccountJWKSURI = &jwksURL
|
|
||||||
}
|
|
||||||
} else if kubeAPIServer.ServiceAccountJWKSURI == nil {
|
|
||||||
jwksURI, err := iam.ServiceAccountIssuer(clusterSpec)
|
jwksURI, err := iam.ServiceAccountIssuer(clusterSpec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ kubeAPIServer:
|
||||||
- X-Remote-User
|
- X-Remote-User
|
||||||
securePort: 443
|
securePort: 443
|
||||||
serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc
|
serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc
|
||||||
serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/keys.json
|
serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/openid/v1/jwks
|
||||||
serviceClusterIPRange: 100.64.0.0/13
|
serviceClusterIPRange: 100.64.0.0/13
|
||||||
storageBackend: etcd3
|
storageBackend: etcd3
|
||||||
kubeControllerManager:
|
kubeControllerManager:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue