somes fixes

This commit is contained in:
ston1th 2020-11-01 01:17:54 +01:00
commit ebd7d12d17
4 changed files with 21 additions and 12 deletions

View file

@ -76,6 +76,7 @@ func main() {
LeaderElection: leaderElect, LeaderElection: leaderElect,
LeaderElectionID: "pve-csr-approver-manager", LeaderElectionID: "pve-csr-approver-manager",
HealthProbeBindAddress: healthAddr, HealthProbeBindAddress: healthAddr,
MetricsBindAddress: "0",
SyncPeriod: &syncPeriod, SyncPeriod: &syncPeriod,
}) })
if err != nil { if err != nil {
@ -117,7 +118,6 @@ func main() {
Client: mgr.GetClient(), Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("CSR"), Log: ctrl.Log.WithName("controllers").WithName("CSR"),
Scheme: mgr.GetScheme(), Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("pvecluster-controller"),
PVEClient: pveClient, PVEClient: pveClient,
CSRClient: typedcertificatesv1beta1.NewForConfigOrDie(rcfg), CSRClient: typedcertificatesv1beta1.NewForConfigOrDie(rcfg),
}).SetupWithManager(mgr, controller.Options{MaxConcurrentReconciles: csrConcurrency}); err != nil { }).SetupWithManager(mgr, controller.Options{MaxConcurrentReconciles: csrConcurrency}); err != nil {

View file

@ -14,7 +14,6 @@ rules:
verbs: verbs:
- create - create
- patch - patch
- update
- apiGroups: [""] - apiGroups: [""]
resources: ["nodes"] resources: ["nodes"]
verbs: ["*"] verbs: ["*"]
@ -30,17 +29,21 @@ rules:
- watch - watch
- apiGroups: [""] - apiGroups: [""]
resources: ["endpoints"] resources: ["endpoints"]
verbs: ["create"]
- apiGroups: [""]
resources: ["endpoints"]
resourceNames: ["cloud-controller-manager"]
verbs: verbs:
- create
- get - get
- list
- watch
- update - update
- apiGroups: ["coordination.k8s.io"] - apiGroups: ["coordination.k8s.io"]
resources: ["leases"] resources: ["leases"]
verbs: ["create"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
resourceNames: ["cloud-controller-manager"]
verbs: verbs:
- get - get
- create
- update - update
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
@ -92,7 +95,7 @@ spec:
- args: - args:
- --cloud-config=/etc/kubernetes/pve.json - --cloud-config=/etc/kubernetes/pve.json
- --tls-min-version=VersionTLS12 - --tls-min-version=VersionTLS12
- --tls-cipher-suites="TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" #- --tls-cipher-suites="TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
- --cloud-provider=pve - --cloud-provider=pve
- --leader-elect=true - --leader-elect=true
image: reg.k8s.giftfish.de/library/pve-cloud-controller-manager-amd64:dev image: reg.k8s.giftfish.de/library/pve-cloud-controller-manager-amd64:dev

View file

@ -26,12 +26,20 @@ rules:
verbs: verbs:
- create - create
- update - update
- apiGroups: ["coordination.k8s.io"] - apiGroups: [""]
resources: ["leases"] resources: ["events"]
verbs:
- create
- patch
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["pve-csr-approver-manager"]
verbs: verbs:
- get - get
- create
- update - update
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1

View file

@ -15,7 +15,6 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
typedcertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" typedcertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/apis/certificates" "k8s.io/kubernetes/pkg/apis/certificates"
ctrl "sigs.k8s.io/controller-runtime" ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
@ -26,7 +25,6 @@ var ErrNoKubeletServingCSR = errors.New("CSR is no kubelet serving certificate")
type CSRReconciler struct { type CSRReconciler struct {
client.Client client.Client
Recorder record.EventRecorder
Log logr.Logger Log logr.Logger
Scheme *runtime.Scheme Scheme *runtime.Scheme
PVEClient *pve.Client PVEClient *pve.Client