8000 OpenStack service type loadbalancer (yawol) by malt3 · Pull Request #1705 · edgelesssys/constellation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

OpenStack service type loadbalancer (yawol) #1705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions bootstrapper/internal/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
"strings"
"time"

"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"

"github.com/edgelesssys/constellation/v2/bootstrapper/internal/kubernetes/k8sapi"
"github.com/edgelesssys/constellation/v2/bootstrapper/internal/kubernetes/kubewaiter"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
Expand All @@ -29,10 +34,6 @@ import (
"github.com/edgelesssys/constellation/v2/internal/logger"
"github.com/edgelesssys/constellation/v2/internal/role"
"github.com/edgelesssys/constellation/v2/internal/versions/components"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
)

var validHostnameRegex = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`)
Expand Down Expand Up @@ -481,13 +482,31 @@ func (k *KubeWrapper) setupExtraVals(ctx context.Context, serviceConfig constell
if err != nil {
return nil, err
}
credsIni := creds.CloudINI().String()
credsIni := creds.CloudINI().FullConfiguration()
networkIDsGetter, ok := k.providerMetadata.(openstackMetadata)
if !ok {
return nil, errors.New("generating yawol configuration: cloud provider metadata does not implement OpenStack specific methods")
}
networkIDs, err := networkIDsGetter.GetNetworkIDs(ctx)
if err != nil {
return nil, fmt.Errorf("getting network IDs: %w", err)
}
if len(networkIDs) == 0 {
return nil, errors.New("getting network IDs: no network IDs found")
}
extraVals["ccm"] = map[string]any{
"OpenStack": map[string]any{
"secretData": credsIni,
},
}

yawolIni := creds.CloudINI().YawolConfiguration()
extraVals["yawol-config"] = map[string]any{
"secretData": yawolIni,
}
extraVals["yawol-controller"] = map[string]any{
"yawolNetworkID": networkIDs[0],
"yawolAPIHost": fmt.Sprintf("https://%s:%d", serviceConfig.loadBalancerIP, constants.KubernetesPort),
}
}
return extraVals, nil
}
Expand Down Expand Up @@ -515,3 +534,7 @@ type constellationServicesConfig struct {
cloudServiceAccountURI string
loadBalancerIP string
}

type openstackMetadata interface {
GetNetworkIDs(ctx context.Context) ([]string, error)
}
17 changes: 9 additions & 8 deletions cli/internal/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ import (
"github.com/edgelesssys/constellation/v2/internal/atls"
"github.com/edgelesssys/constellation/v2/internal/compatibility"

"github.com/spf13/afero"
"github.com/spf13/cobra"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/clientcmd"
clientcodec "k8s.io/client-go/tools/clientcmd/api/latest"
"sigs.k8s.io/yaml"

"github.com/edgelesssys/constellation/v2/bootstrapper/initproto"
"github.com/edgelesssys/constellation/v2/cli/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
Expand All @@ -40,14 +49,6 @@ import (
"github.com/edgelesssys/constellation/v2/internal/license"
"github.com/edgelesssys/constellation/v2/internal/retry"
"github.com/edgelesssys/constellation/v2/internal/versions"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/clientcmd"
clientcodec "k8s.io/client-go/tools/clientcmd/api/latest"
"sigs.k8s.io/yaml"
)

// NewInitCmd returns a new cobra.Command for the init command.
Expand Down
20 changes: 20 additions & 0 deletions cli/internal/helm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,26 @@ go_library(
"charts/edgeless/operators/values.yaml",
"charts/edgeless/constellation-services/charts/ccm/templates/openstack-daemonset.yaml",
"charts/edgeless/constellation-services/charts/ccm/templates/openstack-secret.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/Chart.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/README.md",
"charts/edgeless/constellation-services/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancermachines.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancers.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancersets.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/_helpers.tpl",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/rbac-yawol-cloud-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/rbac-yawol-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/sa-yawol-cloud-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/sa-yawol-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/vpa.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/yawol-cloud-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/yawol-controller.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/templates/yawol-gardener-monitoring.yaml",
"charts/edgeless/constellation-services/charts/yawol-controller/values.yaml",
"charts/edgeless/constellation-services/charts/yawol-config/.helmignore",
"charts/edgeless/constellation-services/charts/yawol-config/Chart.yaml",
"charts/edgeless/constellation-services/charts/yawol-config/templates/secret.yaml",
"charts/edgeless/constellation-services/charts/yawol-config/values.schema.json",
"charts/edgeless/constellation-services/charts/yawol-config/values.yaml",
],
importpath = "github.com/edgelesssys/constellation/v2/cli/internal/helm",
visibility = ["//cli:__subpackages__"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ dependencies:
condition: azure.deployCSIDriver
tags:
- Azure
- name: yawol-config
version: 0.0.0
condition: openstack.deployYawolLoadBalancer
tags:
- OpenStack
- name: yawol-controller
version: 0.0.0
condition: openstack.deployYawolLoadBalancer
tags:
- OpenStack
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
args:
- /bin/openstack-cloud-controller-manager
- --cloud-provider=openstack
- --cloud-config=/etc/config/cloud.conf
- --cloud-config=/etc/config/cloudprovider.conf
- --leader-elect=true
- --allocate-node-cidrs=false
- -v=2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
name: openstackkey
namespace: {{ .Release.Namespace }}
data:
cloud.conf: {{ .Values.OpenStack.secretData | b64enc }}
cloudprovider.conf: {{ .Values.OpenStack.secretData | b64enc }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: yawol-config
description: A Helm chart for Kubernetes
type: application
version: 0.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: yawolkey
namespace: {{ .Release.Namespace }}
data:
cloudprovider.conf: {{ .Values.secretData | b64enc }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"properties": {
"secretData": {
"description": "Cloud INI secret used for yawol.",
"type": "string",
"examples": [
"[Global]\nauth-url = ..."
]
}
},
"required": [
"secretData"
],
"title": "Values",
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
description: Helm chart for yawol-controller
name: yawol-controller
sources:
- https://github.com/stackitcloud/yawol
version: 0.14.0
appVersion: v0.14.0
< 96B8 td id="diff-5896e8cc2006bff48d9a5c0cfaca1b83b322bd48cc3498bf1deb00abd5358f78R20" data-line-number="20" class="blob-num blob-num-addition js-linkable-line-number js-blob-rnum">
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# yawol-controller

![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![AppVersion: v0.12.0](https://img.shields.io/badge/AppVersion-v0.12.0-informational?style=flat-square)

Helm chart for yawol-controller

## Source Code

* <https://github.com/stackitcloud/yawol>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| featureGates | object | `{}` | |
| namespace | string | `"kube-system"` | |
| podAnnotations | object | `{}` | |
| podLabels | object | `{}` | |
| proxy | object | `{}` | |
| replicas | int | `1` | |
| resources.yawolCloudController.limits.cpu | string | `"500m"` | |
| resources.yawolCloudController.limits.memory | string | `"512Mi"` | |
| resources.yawolCloudController.requests.cpu | string | `"100m"` | |
| resources.yawolCloudController.requests.memory | string | `"64Mi"` | |
| resources.yawolControllerLoadbalancer.limits.cpu | string | `"500m"` | |
| resources.yawolControllerLoadbalancer.limits.memory | string | `"512Mi"` | |
| resources.yawolControllerLoadbalancer.requests.cpu | string | `"100m"` | |
| resources.yawolControllerLoadbalancer.requests.memory | string | `"64Mi"` | |
| resources.yawolControllerLoadbalancermachine.limits.cpu | string | `"500m"` | |
| resources.yawolControllerLoadbalancermachine.limits.memory | string | `"512Mi"` | |
| resources.yawolControllerLoadbalancermachine.requests.cpu | string | `"100m"` | |
| resources.yawolControllerLoadbalancermachine.requests.memory | string | `"64Mi"` | |
| resources.yawolControllerLoadbalancerset.limits.cpu | string | `"500m"` | |
| resources.yawolControllerLoadbalancerset.limits.memory | string | `"512Mi"` | |
| resources.yawolControllerLoadbalancerset.requests.cpu | string | `"100m"` | |
| resources.yawolControllerLoadbalancerset.requests.memory | string | `"64Mi"` | |
| vpa.enabled | bool | `false` | |
| vpa.yawolCloudController.mode | string | `"Auto"` | |
| vpa.yawolController.mode | string | `"Auto"` | |
| yawolAPIHost | string | `nil` | |
| yawolAvailabilityZone | string | `""` | |
| yawolCloudController.clusterRoleEnabled | bool | `true` | |
| yawolCloudController.enabled | bool | `true` | |
| yawolCloudController.gardenerMonitoringEnabled | bool | `false` | |
| yawolCloudController.image.repository | string | `"ghcr.io/stackitcloud/yawol/yawol-cloud-controller"` | |
| yawolCloudController.image.tag | string | `""` | Allows you to override the yawol version in this chart. Use at your own risk. |
| yawolController.gardenerMonitoringEnabled | bool | `false` | |
| yawolController.image.repository | string | `"ghcr.io/stackitcloud/yawol/yawol-controller"` | |
| yawolController.image.tag | string | `""` | Allows you to override the yawol version in this chart. Use at your own risk. |
| yawolFlavorID | string | `nil` | |
| yawolFloatingID | string | `nil` | |
| yawolImageID | string | `nil` | |
| yawolNetworkID | string | `nil` | |
| yawolOSSecretName | string | `nil` | |

Loading
0