-
Notifications
You must be signed in to change notification settings - Fork 95
Yugabyte: Working GCP implementation #1190
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,15 @@ locals { | |
| # Tanka defines itself the variable below. For helm, since we are using the official helm CRDB chart, | ||
| # the following variable has to be provided here. | ||
| helm_crdb_statefulset_name = "dss-cockroachdb" | ||
|
|
||
| # This pre command is used bellow in yugabyte deployements to make the local ip pointing to the public hostname we want to use, until https://github.com/yugabyte/yugabyte-db/issues/27367 is fixed | ||
| yugabyte_precommand_prefix = "sed -E \"/\\.svc\\.cluster\\.local/ s/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)([[:space:]]+)/\\1 $(echo \"$${HOSTNAMENO}." | ||
| yugabyte_precommand_sufix = ".${var.crdb_hostname_suffix}\" | sed 's/[\\/&]/\\\\&/g')\\2/\" /etc/hosts > /tmp/newhosts && /bin/cp /tmp/newhosts /etc/hosts && \\" | ||
barroco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| resource "local_file" "helm_chart_values" { | ||
| filename = "${local.workspace_location}/helm_values.yml" | ||
| content = yamlencode({ | ||
| content = var.datastore_type == "cockroachdb" ? yamlencode({ | ||
| cockroachdb = { | ||
| image = { | ||
| tag = var.crdb_image_tag | ||
|
|
@@ -66,8 +70,134 @@ resource "local_file" "helm_chart_values" { | |
| } | ||
| } | ||
|
|
||
| global = { | ||
| cloudProvider = var.kubernetes_cloud_provider_name | ||
| } | ||
| }) : yamlencode({ | ||
| cockroachdb = { | ||
| enabled = false | ||
| } | ||
| yugabyte = { | ||
| enabled = true | ||
|
|
||
| resource = var.yugabyte_light_resources ? { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this and address it in another PR if needed. Since there is no autoscalling, this would only change the requested resources without changing the type of nodes provisionned.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though, I would expect to see a configuration flag similar to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's needed when testing on a small cluster (e.g. by following the default values / README) because the services are requesting a lot of resources, I would suggest to keep it to ease quick / test deployments without having the need of spawning a big cluster. Not sure how it's related to autoscalling however ? (Will do add a configuration flag for the number of nodes)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Number of nodes support added) |
||
| master = { | ||
| requests = { | ||
| cpu = "0.1" | ||
| memory = "0.5G" | ||
| } | ||
| } | ||
| tserver = { | ||
| requests = { | ||
| cpu = "0.1" | ||
| memory = "0.5G" | ||
| } | ||
| } | ||
| } : {} | ||
| enableLoadBalancer = false | ||
|
|
||
| replicas = { | ||
| master = var.node_count | ||
| tserver = var.node_count | ||
| totalMasters = length(var.yugabyte_external_nodes) + var.node_count | ||
| } | ||
|
|
||
| master = { | ||
| extraEnv = [{ | ||
| name = "HOSTNAMENO" | ||
| valueFrom = { | ||
| fieldRef = { | ||
| fieldPath = "metadata.labels['apps.kubernetes.io/pod-index']" | ||
| } | ||
| } | ||
| }] | ||
| serverBroadcastAddress : "$${HOSTNAMENO}.master.${var.crdb_hostname_suffix}" | ||
| rpcBindAddress : "$${HOSTNAMENO}.master.${var.crdb_hostname_suffix}" | ||
| advanced = { | ||
| preCommands : "${local.yugabyte_precommand_prefix}master${local.yugabyte_precommand_sufix}" | ||
barroco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| tserver = { | ||
| extraEnv = [{ | ||
| name = "HOSTNAMENO" | ||
| valueFrom = { | ||
| fieldRef = { | ||
| fieldPath = "metadata.labels['apps.kubernetes.io/pod-index']" | ||
| } | ||
| } | ||
| }] | ||
| serverBroadcastAddress : "$${HOSTNAMENO}.tserver.${var.crdb_hostname_suffix}" | ||
| rpcBindAddress : "$${HOSTNAMENO}.tserver.${var.crdb_hostname_suffix}" | ||
| advanced = { | ||
| preCommands : "${local.yugabyte_precommand_prefix}tserver${local.yugabyte_precommand_sufix}" | ||
barroco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| gflags = { | ||
| master = { | ||
| placement_cloud : var.yugabyte_cloud | ||
| placement_region : var.yugabyte_region | ||
| placement_zone : var.yugabyte_zone | ||
| use_private_ip : "zone" | ||
| } | ||
| tserver = { | ||
| placement_cloud : var.yugabyte_cloud | ||
| placement_region : var.yugabyte_region | ||
| placement_zone : var.yugabyte_zone | ||
| use_private_ip : "zone" | ||
| } | ||
| } | ||
|
|
||
| masterAddresses = join(",", concat([ | ||
| for i in range(var.node_count) : format("%s.master.${var.crdb_hostname_suffix}", i) | ||
| ], var.yugabyte_external_nodes)) | ||
| } | ||
|
|
||
| loadBalancers = { | ||
| cockroachdbNodes = [] | ||
|
|
||
| yugabyteMasterNodes = [ | ||
| for ip in var.yugabyte_internal_masters_nodes[*].ip : | ||
| { | ||
| ip = ip | ||
| subnet = var.workload_subnet | ||
| } | ||
| ] | ||
|
|
||
| yugabyteTserverNodes = [ | ||
| for ip in var.yugabyte_internal_tservers_nodes[*].ip : | ||
| { | ||
| ip = ip | ||
| subnet = var.workload_subnet | ||
| } | ||
| ] | ||
|
|
||
| dssGateway = { | ||
| ip = var.ip_gateway | ||
| subnet = var.workload_subnet | ||
| certName = var.gateway_cert_name | ||
| sslPolicy = var.ssl_policy | ||
| } | ||
| } | ||
|
|
||
| dss = { | ||
| image = var.image | ||
|
|
||
| conf = { | ||
| pubKeys = [ | ||
| "/test-certs/auth2.pem" | ||
| ] | ||
| jwksEndpoint = var.authorization.jwks != null ? var.authorization.jwks.endpoint : "" | ||
| jwksKeyIds = var.authorization.jwks != null ? [var.authorization.jwks.key_id] : [] | ||
| hostname = var.app_hostname | ||
| enableScd = var.enable_scd | ||
| } | ||
| } | ||
|
|
||
| global = { | ||
| cloudProvider = var.kubernetes_cloud_provider_name | ||
| } | ||
| }) | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # This file was automatically generated by terraform-commons-dss. | ||
| # Do not edit it directly. | ||
|
|
||
| set -eo pipefail | ||
|
|
||
| OS=$(uname) | ||
| if [[ "$OS" == "Darwin" ]]; then | ||
| # OSX uses BSD readlink | ||
| BASEDIR="$(dirname "$0")" | ||
| else | ||
| BASEDIR=$(readlink -e "$(dirname "$0")") | ||
| fi | ||
| cd "$BASEDIR/../../../deploy/operations/certificates-management/" || exit 1 | ||
|
|
||
| ./dss-certs.py --name ${cluster_context} --organization default_orga --cluster-context ${cluster_context} --nodes-public-address "<ID>.<TYPE>.${crdb_hostname_suffix}" --namespace ${namespace} --nodes-count ${node_count} "$@" |
Uh oh!
There was an error while loading. Please reload this page.