Skip to content

Commit

Permalink
use init container
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Jul 22, 2022
1 parent 168ba31 commit e2d33c7
Show file tree
Hide file tree
Showing 20 changed files with 986 additions and 98 deletions.
19 changes: 19 additions & 0 deletions api/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type PulsarMessaging struct {

// To replace the TLSSecret
TLSConfig *PulsarTLSConfig `json:"tlsConfig,omitempty"`

Oauth2Config *Oauth2Config `json:"oauth2Config,omitempty"`
}

type TLSConfig struct {
Expand Down Expand Up @@ -102,6 +104,23 @@ func (c *PulsarTLSConfig) GetMountPath() string {
return "/etc/tls/pulsar-functions"
}

type Oauth2Config struct {
Audience string `json:"audience"`
ClientId string `json:"clientId"`
IssuerUrl string `json:"issuerUrl"`
// the secret name of the Oauth2 key file
KeySecretName string `json:"keySecretName"`
KeySecretKey string `json:"keySecretKey"`
}

func (o *Oauth2Config) GetMountPath() string {
return "/etc/oauth2"
}

func (o *Oauth2Config) GetMountFile() string {
return fmt.Sprintf("%s/%s", o.GetMountPath(), o.KeySecretKey)
}

type PulsarStateStore struct {
// The service url points to the state store service
// By default, the state store service is bookkeeper table service
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/function_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type FunctionSpec struct {
ClusterName string `json:"clusterName,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas"`
Replicas *int32 `json:"replicas"`
DownloaderImage string `json:"downloaderImage,omitempty"`

// MaxReplicas indicates the maximum number of replicas and enables the HorizontalPodAutoscaler
// If provided, a default HPA with CPU at average of 80% will be used.
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/sink_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ type SinkSpec struct {
SinkType string `json:"sinkType,omitempty"` // refer to `--sink-type` as builtin connector
// +kubebuilder:validation:Required
// +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas"`
Replicas *int32 `json:"replicas"`
DownloaderImage string `json:"downloaderImage,omitempty"`

// MaxReplicas indicates the maximum number of replicas and enables the HorizontalPodAutoscaler
// If provided, a default HPA with CPU at average of 80% will be used.
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type SourceSpec struct {
ClusterName string `json:"clusterName,omitempty"`
SourceType string `json:"sourceType,omitempty"` // refer to `--source-type` as builtin connector
// +kubebuilder:validation:Required
Replicas *int32 `json:"replicas"`
Replicas *int32 `json:"replicas"`
DownloaderImage string `json:"downloaderImage,omitempty"`

// MaxReplicas indicates the maximum number of replicas and enables the HorizontalPodAutoscaler
// If provided, a default HPA with CPU at average of 80% will be used.
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
type: string
deadLetterTopic:
type: string
downloaderImage:
type: string
forwardSourceMessageProperty:
type: boolean
funcConfig:
Expand Down Expand Up @@ -2592,6 +2594,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down Expand Up @@ -2725,6 +2746,8 @@ spec:
type: string
deadLetterTopic:
type: string
downloaderImage:
type: string
golang:
properties:
go:
Expand Down Expand Up @@ -5212,6 +5235,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down Expand Up @@ -5323,6 +5365,8 @@ spec:
type: string
clusterName:
type: string
downloaderImage:
type: string
forwardSourceMessageProperty:
type: boolean
golang:
Expand Down Expand Up @@ -7793,6 +7837,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
type: string
deadLetterTopic:
type: string
downloaderImage:
type: string
forwardSourceMessageProperty:
type: boolean
funcConfig:
Expand Down Expand Up @@ -2611,6 +2613,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
type: string
deadLetterTopic:
type: string
downloaderImage:
type: string
golang:
properties:
go:
Expand Down Expand Up @@ -2545,6 +2547,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ spec:
type: string
clusterName:
type: string
downloaderImage:
type: string
forwardSourceMessageProperty:
type: boolean
golang:
Expand Down Expand Up @@ -2522,6 +2524,25 @@ spec:
properties:
authSecret:
type: string
oauth2Config:
properties:
audience:
type: string
clientId:
type: string
issuerUrl:
type: string
keySecretKey:
type: string
keySecretName:
type: string
required:
- audience
- clientId
- issuerUrl
- keySecretKey
- keySecretName
type: object
pulsarConfig:
type: string
tlsConfig:
Expand Down
Loading

0 comments on commit e2d33c7

Please sign in to comment.