github.com/docker/compose-on-kubernetes@v0.5.0/install/types.go (about) 1 package install 2 3 import ( 4 "errors" 5 "time" 6 7 corev1types "k8s.io/api/core/v1" 8 ) 9 10 // OptionsCommon holds install options for the api extension 11 type OptionsCommon struct { 12 Namespace string 13 Tag string 14 PullSecret string 15 ReconciliationInterval time.Duration 16 DefaultServiceType string 17 APIServerAffinity *corev1types.Affinity 18 ControllerAffinity *corev1types.Affinity 19 HealthzCheckPort int 20 PullPolicy corev1types.PullPolicy 21 APIServerReplicas *int32 22 } 23 24 // UnsafeOptions holds install options for the api extension 25 type UnsafeOptions struct { 26 OptionsCommon 27 Coverage bool 28 Debug bool 29 } 30 31 // EtcdOptions holds install options related to ETCD 32 type EtcdOptions struct { 33 Servers string 34 ClientTLSBundle *TLSBundle 35 } 36 37 // NetworkOptions holds install options related to networking 38 type NetworkOptions struct { 39 ShouldUseHost bool 40 CustomTLSBundle *TLSBundle 41 Port int32 42 } 43 44 // SafeOptions holds install options for the api extension 45 type SafeOptions struct { 46 OptionsCommon 47 Etcd EtcdOptions 48 Network NetworkOptions 49 } 50 51 // TLSBundle is a bundle containing a CA, a public cert and private key, PEM encoded 52 type TLSBundle struct { 53 ca []byte 54 cert []byte 55 key []byte 56 } 57 58 // NewTLSBundle creates a TLS bundle 59 func NewTLSBundle(ca, cert, key []byte) (*TLSBundle, error) { 60 if ca == nil || cert == nil || key == nil { 61 return nil, errors.New("ca, cert or key is missing") 62 } 63 return &TLSBundle{ 64 ca: ca, 65 cert: cert, 66 key: key, 67 }, nil 68 }