Skip to content

Commit

Permalink
Duros API endpoint is required (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Jun 6, 2024
1 parent a62e4bb commit 7c2f6f0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 42 deletions.
8 changes: 6 additions & 2 deletions charts/internal/control-plane/templates/duros-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ type: Opaque
data:
admin-key: {{ required ".Values.duros.controller.adminKey is required" (b64enc .Values.duros.controller.adminKey) }}
admin-token: {{ required ".Values.duros.controller.adminToken is required" (b64enc .Values.duros.controller.adminToken) }}
{{- if .Values.duros.controller.apiEndpoint }}
{{- if .Values.duros.controller.apiCA }}
api-ca: {{ required ".Values.duros.controller.apiCA is required" (b64enc .Values.duros.controller.apiCA) }}
{{- end }}
{{- if and (.Values.duros.controller.apiCert) (.Values.duros.controller.apiKey) }}
api-cert: {{ required ".Values.duros.controller.apiCert is required" (b64enc .Values.duros.controller.apiCert) }}
api-key: {{ required ".Values.duros.controller.apiKey is required" (b64enc .Values.duros.controller.apiKey) }}
{{- end }}
Expand Down Expand Up @@ -107,9 +109,11 @@ spec:
- -admin-key=/duros/admin-key
- -shoot-kubeconfig=/var/run/secrets/gardener.cloud/shoot/generic-kubeconfig/kubeconfig
- -psp-disabled={{ .Values.pspDisabled }}
{{- if .Values.duros.controller.apiEndpoint }}
- -api-endpoint={{ .Values.duros.controller.apiEndpoint }}
{{- if .Values.duros.controller.apiCA }}
- -api-ca=/duros/api-ca
{{- end }}
{{- if and (.Values.duros.controller.apiCert) (.Values.duros.controller.apiKey) }}
- -api-cert=/duros/api-cert
- -api-key=/duros/api-key
{{- end }}
Expand Down
16 changes: 5 additions & 11 deletions pkg/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,13 @@ type DurosPartitionConfiguration struct {
// StorageClasses contain information on the storage classes that the duros-controller creates in the shoot cluster
StorageClasses []DurosSeedStorageClass

// APIEndpoint is an optional endpoint used for control plane network communication.
//
// In certain scenarios the data plane network cannot be reached from the duros-controller in the seed
// (i.e. only the shoot is able to reach the storage network).
//
// In these cases, APIEndpoint can be utilized to point to a gRPC proxy such that the storage
// integration can be deployed anyway.
APIEndpoint *string
// APICA is the ca of the client cert to access the grpc-proxy
// APIEndpoint is the endpoint used for control plane network communication.
APIEndpoint string
// APICA is the ca of the client cert to access the api endpoint
APICA string
// APICert is the cert of the client cert to access the grpc-proxy
// APICert is the cert of the client cert to access the api endpoint
APICert string
// APIKey is the key of the client cert to access the grpc-proxy
// APIKey is the key of the client cert to access the api endpoint
APIKey string
}

Expand Down
16 changes: 5 additions & 11 deletions pkg/apis/config/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,13 @@ type DurosPartitionConfiguration struct {
// StorageClasses contain information on the storage classes that the duros-controller creates in the shoot cluster
StorageClasses []DurosSeedStorageClass `json:"storageClasses"`

// APIEndpoint is an optional endpoint used for control plane network communication.
//
// In certain scenarios the data plane network cannot be reached from the duros-controller in the seed
// (i.e. only the shoot is able to reach the storage network).
//
// In these cases, APIEndpoint can be utilized to point to a gRPC proxy such that the storage
// integration can be deployed anyway.
APIEndpoint *string `json:"apiEndpoint,omitempty"`
// APICA is the ca of the client cert to access the grpc-proxy
// APIEndpoint is the endpoint used for control plane network communication.
APIEndpoint string `json:"apiEndpoint"`
// APICA is the ca of the client cert to access the api endpoint
APICA string `json:"apiCA,omitempty"`
// APICert is the cert of the client cert to access the grpc-proxy
// APICert is the cert of the client cert to access the api endpoint
APICert string `json:"apiCert,omitempty"`
// APIKey is the key of the client cert to access the grpc-proxy
// APIKey is the key of the client cert to access the api endpoint
APIKey string `json:"apiKey,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/config/v1alpha1/zz_generated.conversion.go

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

5 changes: 0 additions & 5 deletions pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

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

5 changes: 0 additions & 5 deletions pkg/apis/config/zz_generated.deepcopy.go

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

14 changes: 8 additions & 6 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,16 +869,18 @@ func getStorageControlPlaneChartValues(ctx context.Context, client client.Client
}

controllerValues := map[string]any{
"endpoints": partitionConfig.Endpoints,
"adminKey": partitionConfig.AdminKey,
"adminToken": partitionConfig.AdminToken,
"endpoints": partitionConfig.Endpoints,
"adminKey": partitionConfig.AdminKey,
"adminToken": partitionConfig.AdminToken,
"apiEndpoint": partitionConfig.APIEndpoint,
}

if partitionConfig.APIEndpoint != nil {
controllerValues["apiEndpoint"] = *partitionConfig.APIEndpoint
if partitionConfig.APICA != "" {
controllerValues["apiCA"] = partitionConfig.APICA
controllerValues["apiKey"] = partitionConfig.APIKey
}
if partitionConfig.APICert != "" && partitionConfig.APIKey != "" {
controllerValues["apiCert"] = partitionConfig.APICert
controllerValues["apiKey"] = partitionConfig.APIKey
}

values := map[string]any{
Expand Down

0 comments on commit 7c2f6f0

Please sign in to comment.