caServer

证书签发 CreateCertificate

判断CA类型来进行创建CA

    if err := s.maybeCreateCA(caOpts); err != nil {
        return nil, err
    }

启动CA

s.startCA(caOpts)

根据CA类型来启动CA

func (s *Server) startCA(caOpts *caOptions) {
    if s.CA == nil && s.RA == nil {
        return
    }
    s.addStartFunc(func(stop <-chan struct{}) error {
        grpcServer := s.secureGrpcServer
        if s.secureGrpcServer == nil {
            grpcServer = s.grpcServer
        }
        // 判断CA类型
        if s.RA != nil {
            log.Infof("Starting RA")
            s.RunCA(grpcServer, s.RA, caOpts)
        } else if s.CA != nil {
            log.Infof("Starting IstioD CA")
            s.RunCA(grpcServer, s.CA, caOpts)
        }
        return nil
    })
}

启动

caServer需要实现IstioCertificateServiceServer接口

caServer调用Register

具体的实现

CertificateAuthority

istioca

istio ra(k8s ra)

传入参数构造k8sra

校验C类型

生成istio ra

调用csr进行证书签发

Last updated

Was this helpful?