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

certificatesigningrequests/v1beta1 to v1 #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 4 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ module github.com/aws/amazon-eks-pod-identity-webhook
go 1.13

require (
github.com/evanphx/json-patch v4.4.0+incompatible // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v0.9.3
github.com/spf13/pflag v1.0.5
gopkg.in/square/go-jose.v2 v2.5.1
k8s.io/api v0.18.8
k8s.io/apimachinery v0.18.9-rc.0
k8s.io/client-go v0.18.8
k8s.io/api v0.21.0
k8s.io/apimachinery v0.21.0
k8s.io/client-go v0.21.0
k8s.io/klog v1.0.0
sigs.k8s.io/yaml v1.2.0
)
413 changes: 314 additions & 99 deletions go.sum

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions pkg/cert/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ import (
"fmt"

"github.com/prometheus/client_golang/prometheus"
certificates "k8s.io/api/certificates/v1beta1"
certificates "k8s.io/api/certificates/v1"
clientset "k8s.io/client-go/kubernetes"
certificatesclient "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
"k8s.io/client-go/util/certificate"
)

// NewServerCertificateManager returns a certificate manager that stores TLS keys in Kubernetes Secrets
func NewServerCertificateManager(kubeClient clientset.Interface, namespace, secretName string, csr *x509.CertificateRequest) (certificate.Manager, error) {
clientFn := func(_ *tls.Certificate) (certificatesclient.CertificateSigningRequestInterface, error) {
return kubeClient.CertificatesV1beta1().CertificateSigningRequests(), nil
clientsetFn := func(_ *tls.Certificate) (clientset.Interface, error) {
return kubeClient, nil
}

certificateStore := NewSecretCertStore(
Expand All @@ -49,8 +48,8 @@ func NewServerCertificateManager(kubeClient clientset.Interface, namespace, secr
prometheus.MustRegister(certificateRotation)

m, err := certificate.NewManager(&certificate.Config{
ClientFn: clientFn,
Template: csr,
ClientsetFn: clientsetFn,
Template: csr,
Usages: []certificates.KeyUsage{
// https://tools.ietf.org/html/rfc5280#section-4.2.1.3
//
Expand All @@ -65,7 +64,7 @@ func NewServerCertificateManager(kubeClient clientset.Interface, namespace, secr
// authenticate itself to a TLS client.
certificates.UsageServerAuth,
},
SignerName: certificates.LegacyUnknownSignerName,
SignerName: "kubernetes.io/kubelet-serving",
CertificateStore: certificateStore,
CertificateRotation: certificateRotation,
})
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading