From 465262729aa8164428ba2e8718af91a2bd54d9f0 Mon Sep 17 00:00:00 2001 From: David Gerchikov Date: Fri, 3 May 2024 12:25:44 +0300 Subject: [PATCH] Merge pull request #12 from aerospike/VEC-90-helm-for-proximus Add aerospike-proximus helm charts --- aerospike-proximus/.helmignore | 26 +++ aerospike-proximus/Chart.yaml | 24 +++ aerospike-proximus/README.md | 177 ++++++++++++++++ aerospike-proximus/eks/README.md | 16 ++ aerospike-proximus/eks/install-eks-env.sh | 87 ++++++++ aerospike-proximus/eks/run-quote-search.sh | 133 ++++++++++++ aerospike-proximus/eks/uninstall-eks-env.sh | 64 ++++++ aerospike-proximus/examples/eks/README.md | 53 +++++ .../examples/eks/aerospike.yaml | 86 ++++++++ .../examples/eks/as-proximus-eks-values.yaml | 45 ++++ aerospike-proximus/examples/gke/README.md | 53 +++++ .../examples/gke/aerospike.yaml | 86 ++++++++ .../examples/gke/as-proximus-gke-values.yaml | 45 ++++ .../examples/quote-search/README.md | 115 +++++++++++ .../examples/quote-search/aerospike.yaml | 86 ++++++++ .../quote-search/as-quote-search-values.yaml | 22 ++ aerospike-proximus/gke/README.md | 16 ++ .../config/kube-prometheus-stack-values.yaml | 20 ++ .../gke/config/servicemonitor.yaml | 14 ++ aerospike-proximus/gke/install-gke-env.sh | 74 +++++++ aerospike-proximus/gke/install-prometheus.sh | 13 ++ aerospike-proximus/gke/run-quote-search.sh | 67 ++++++ aerospike-proximus/gke/uninstall-gke-env.sh | 17 ++ .../gke/uninstall-prometheus.sh | 5 + aerospike-proximus/local-env/README.md | 23 +++ .../local-env/config/kind-cluster.yaml | 17 ++ .../local-env/config/metallb-config.yaml | 14 ++ aerospike-proximus/local-env/install-kind.sh | 63 ++++++ .../local-env/run-quote-search.sh | 17 ++ .../local-env/uninstall-kind.sh | 25 +++ aerospike-proximus/templates/NOTES.txt | 1 + aerospike-proximus/templates/_helpers.tpl | 69 +++++++ aerospike-proximus/templates/configmap.yaml | 9 + aerospike-proximus/templates/hpa.yaml | 28 +++ aerospike-proximus/templates/service.yaml | 96 +++++++++ .../templates/serviceaccount.yaml | 13 ++ aerospike-proximus/templates/statefulset.yaml | 124 +++++++++++ .../templates/tests/test-connection.yaml | 15 ++ aerospike-proximus/values.yaml | 194 ++++++++++++++++++ 39 files changed, 2052 insertions(+) create mode 100644 aerospike-proximus/.helmignore create mode 100644 aerospike-proximus/Chart.yaml create mode 100644 aerospike-proximus/README.md create mode 100644 aerospike-proximus/eks/README.md create mode 100755 aerospike-proximus/eks/install-eks-env.sh create mode 100755 aerospike-proximus/eks/run-quote-search.sh create mode 100755 aerospike-proximus/eks/uninstall-eks-env.sh create mode 100644 aerospike-proximus/examples/eks/README.md create mode 100644 aerospike-proximus/examples/eks/aerospike.yaml create mode 100644 aerospike-proximus/examples/eks/as-proximus-eks-values.yaml create mode 100644 aerospike-proximus/examples/gke/README.md create mode 100644 aerospike-proximus/examples/gke/aerospike.yaml create mode 100644 aerospike-proximus/examples/gke/as-proximus-gke-values.yaml create mode 100644 aerospike-proximus/examples/quote-search/README.md create mode 100644 aerospike-proximus/examples/quote-search/aerospike.yaml create mode 100644 aerospike-proximus/examples/quote-search/as-quote-search-values.yaml create mode 100644 aerospike-proximus/gke/README.md create mode 100644 aerospike-proximus/gke/config/kube-prometheus-stack-values.yaml create mode 100644 aerospike-proximus/gke/config/servicemonitor.yaml create mode 100755 aerospike-proximus/gke/install-gke-env.sh create mode 100755 aerospike-proximus/gke/install-prometheus.sh create mode 100755 aerospike-proximus/gke/run-quote-search.sh create mode 100755 aerospike-proximus/gke/uninstall-gke-env.sh create mode 100755 aerospike-proximus/gke/uninstall-prometheus.sh create mode 100644 aerospike-proximus/local-env/README.md create mode 100644 aerospike-proximus/local-env/config/kind-cluster.yaml create mode 100644 aerospike-proximus/local-env/config/metallb-config.yaml create mode 100755 aerospike-proximus/local-env/install-kind.sh create mode 100755 aerospike-proximus/local-env/run-quote-search.sh create mode 100755 aerospike-proximus/local-env/uninstall-kind.sh create mode 100644 aerospike-proximus/templates/NOTES.txt create mode 100644 aerospike-proximus/templates/_helpers.tpl create mode 100644 aerospike-proximus/templates/configmap.yaml create mode 100644 aerospike-proximus/templates/hpa.yaml create mode 100644 aerospike-proximus/templates/service.yaml create mode 100644 aerospike-proximus/templates/serviceaccount.yaml create mode 100644 aerospike-proximus/templates/statefulset.yaml create mode 100644 aerospike-proximus/templates/tests/test-connection.yaml create mode 100644 aerospike-proximus/values.yaml diff --git a/aerospike-proximus/.helmignore b/aerospike-proximus/.helmignore new file mode 100644 index 0000000..944f592 --- /dev/null +++ b/aerospike-proximus/.helmignore @@ -0,0 +1,26 @@ +# 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/ +local-env +templates/serviceaccount.yaml +templates/tests/test-connection.yaml diff --git a/aerospike-proximus/Chart.yaml b/aerospike-proximus/Chart.yaml new file mode 100644 index 0000000..eaa3649 --- /dev/null +++ b/aerospike-proximus/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: aerospike-proximus +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.3.1" diff --git a/aerospike-proximus/README.md b/aerospike-proximus/README.md new file mode 100644 index 0000000..0c35615 --- /dev/null +++ b/aerospike-proximus/README.md @@ -0,0 +1,177 @@ +# Aerospike Proximus + +This Helm chart allows you to configure and run our official [Aerospike Proximus](https://hub.docker.com/repository/docker/aerospike/aerospike-proximus) +docker image on a Kubernetes cluster. + +This helm chart sets up a `StatefulSet` for each proximus instance. We use a `StatefulSet` instead of a `Deployment`, to have stable DNS names for the +deployed proximus pods. + +## Prerequisites +- Kubernetes cluster +- Helm v3 +- An Aerospike cluster that can connect to Pods in the Kubernetes cluster. + The Aerospike cluster can be deployed in the same Kubernetes cluster using [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator) +- Ability to deploy a LoadBalancer on K8s in case proximus app runs outside the Kubernetes cluster + +## Adding the helm chart repository + +Add the `aerospike` helm repository if not already done + +```shell +helm repo add aerospike https://aerospike.github.io/helm-charts +``` + +## Supported configuration + +### Configuration + +| Parameter | Description | Default | +|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------| +| `replicaCount` | Configures the number Aerospike Proximus instance pods to run. | '1' | +| `image` | Configures Aerospike Proximus image repository, tag and pull policy. | see [values.yaml](values.yaml) | +| `imagePullSecrets` | For Private docker registries, when authentication is needed. | see [values.yaml](values.yaml) | +| `proximusConfig` | Proximus cluster configuration deployed to `/etc/aerospike-proximus/aerospike-proximus.yml`. | see [values.yaml](values.yaml) | +| `initContainers` | List of initContainers added to each proximus pods for custom cluster behavior. | `[]` | +| `serviceAccount` | Service Account details like name and annotations. | see [values.yaml](values.yaml) | +| `podAnnotations` | Additional pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/). Should be specified as a map of annotation names to annotation values. | `{}` | +| `podLabels` | Additional pod [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). Should be specified as a map of label names to label values. | `{}` | +| `podSecurityContext` | Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | `{}` | +| `securityContext` | Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) | `{}` | +| `service` | Load-Balancer configuration for more details please refer to a Load-Balancer docs. | `{}` | +| `resources` | Resource [requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the proximus pods. | `{}` | +| `autoscaling` | Enable the horizontal pod auto-scaler. | see [values.yaml](values.yaml) | +| `extraVolumes` | List of additional volumes to attach to the Proximus pod. | see [values.yaml](values.yaml) | +| `extraVolumeMounts` | Extra volume mounts corresponding to the volumes added to `extraVolumes`. | see [values.yaml](values.yaml) | +| `extraSecretVolumeMounts` | Extra secret volume mounts corresponding to the volumes added to `extraVolumes`. | see [values.yaml](values.yaml) | +| `affinity` | [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) rules if any for the pods. | `{}` | +| `nodeSelector` | [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for the pods. | `{}` | +| `tolerations` | [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for the pods. | `{}` | + +## Deploy the Proximus Cluster + +We recommend creating a new `.yaml` for providing configuration values to the helm chart for deployment. +See the [examples](examples) folder for examples. + +A sample values yaml file is shown below: + +```yaml +replicaCount: 1 + +image: + tag: "0.3.1" + +proximusConfig: + aerospike: + metadata-namespace: "proximus-meta" + seeds: + - aerospike-cluster-0-0.aerospike-cluster.aerospike.svc.cluster.local: + port: 3000 +``` + +Here `replicaCount` is the count of Proximus pods that are deployed. +The proximus configuration is provided as yaml under the key `proximusConfig`. +[comment]: <> (Link to proximus docs should be added) +See [Aerospike Proximus configuration]() for details. + +We recommend naming the file with the name of the Proximus cluster. For example if you want to name your Proximus cluster as +`as-proximus`, create a file `as-proximus-values.yaml`. +Once you have created this custom values file, deploy the Proximus cluster, using the following command. + +### Create a new namespace +We recommend using `aerospike` namespace for the Proximus cluster. If the namespace does not exist run the following command: +```shell +kubectl create namespace aerospike +``` + +### Create secrets +Create the secret for aerospike using your Aerospike licence file +```shell +# kubectl --namespace create secret generic aerospike-proximus-secret --from-file=features.conf= +kubectl --namespace aerospike create secret generic aerospike-secret --from-file=features.conf=features.conf +``` + +### Deploy the Proximus cluster + +```shell +# helm install --namespace -f aerospike/aerospike-proximus +helm install --namespace aerospike as-proximus -f as-proximus-values.yaml aerospike/as-proximus +``` + +Here `as-proximus` is the release name for the proximus cluster and also its cluster name. + +On successful deployment you should see output similar to below: + +```shell +NAME: as-proximus +LAST DEPLOYED: Sun Mar 31 13:47:28 2024 +NAMESPACE: aerospike +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +``` + +## List pods for the Proximus cluster +To list the pods for the Proximus cluster run the following command: +```shell +# kubectl get pods --namespace aerospike --selector=app=-aerospike-proximus +kubectl get pods --namespace aerospike --selector=app=as-proximus-aerospike-proximus +``` + +You should see output similar to the following: +```shell +NAME READY STATUS RESTARTS AGE +as-proximus-aerospike-proximus-0 1/1 Running 0 2m32s +``` + +If you are using [Aerospike Kubernetes Operator](https://docs.aerospike.com/connect/pulsar/from-asdb/configuring), +see [quote-search](examples/quote-search) for reference. + +## Get logs for all Proximus instances + +```shell +# kubectl -n aerospike logs -f statefulset/-aerospike-proximus +# Skip the -f flag to get a one time dump of the log +kubectl -n aerospike logs -f statefulset/as-proximus-aerospike-proximus +``` + +## Get logs for one Proximus pod + +```shell +# kubectl -n aerospike logs -f -aerospike-proximus-0 +# Skip the -f flag to get a one time dump of the log +kubectl -n aerospike logs -f as-proximus-aerospike-proximus-0 +``` + +## Updating Proximus configuration + +Edit the `proximusConfig` section in the custom values file and save the changes. + +Upgrade the Proximus deployment using the following command. + +```shell +#helm upgrade --namespace -f aerospike/aerospike-proximus +helm upgrade --namespace aerospike as-proximus -f as-proximus-values.yaml aerospike/aerospike-proximus +``` + +On successful execution of the command the Proximus pods will undergo a rolling restart and come up with the new configuration. + +To verify the changes are applied +- [List the pods](#list-pods-for-the-proximus-cluster) +- [Verify the configuration in proximus logs](#get-logs-for-all-proximus-instances) + +**_NOTE:_** The changes might take some time to apply. If you do not see the desired Proximus config try again after some time. + +## Scaling up/down the Proximus instances + +Edit the `replicaCount` to the desired Proximus instance count and upgrade the Proximus deployment using the following command. + +```shell +#helm upgrade --namespace -f aerospike/aerospike-proximus +helm upgrade --namespace aerospike as-proximus -f as-proximus-values.yaml aerospike/aerospike-proximus +``` + +Verify that the Proximus cluster have been scaled. +- [List the pods](#list-pods-for-the-proximus-cluster) and verify the count of Proximus instances is as desired + +**_NOTE:_** The changes might take some time to apply. If you do not see the desired count try again after some time. diff --git a/aerospike-proximus/eks/README.md b/aerospike-proximus/eks/README.md new file mode 100644 index 0000000..1220cde --- /dev/null +++ b/aerospike-proximus/eks/README.md @@ -0,0 +1,16 @@ +# EKS Installation + +### Create Local Env +```shell +./install-eks-env.sh +``` + +### Run `qoute-serch` Example App +```shell +./run-quote-search.sh +``` + +### Destroy Local Env +```shell +./uninstall-eks-env.sh +``` diff --git a/aerospike-proximus/eks/install-eks-env.sh b/aerospike-proximus/eks/install-eks-env.sh new file mode 100755 index 0000000..a182fdd --- /dev/null +++ b/aerospike-proximus/eks/install-eks-env.sh @@ -0,0 +1,87 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" +REGION="" + +if [ -z "$REGION" ]; then + echo "Set Region" + exit 1 +fi + +if [ ! -f "$WORKSPACE/aerospike-proximus/eks/config/features.conf" ]; then + echo "features.conf Not found" + exit 1 +fi + +eksctl create cluster \ +--region="$REGION" \ +--name=proximus-eks-cluster \ +--nodes=3 \ +--node-type=t3.xlarge \ +--with-oidc \ +--set-kubeconfig-context + +eksctl create iamserviceaccount \ +--region="$REGION" \ +--name ebs-csi-controller-sa \ +--namespace kube-system \ +--cluster proximus-eks-cluster \ +--role-name AmazonEKS_EBS_CSI_DriverRole \ +--role-only \ +--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \ +--approve + +eksctl create addon \ +--region="$REGION" \ +--name aws-ebs-csi-driver \ +--cluster proximus-eks-cluster \ +--service-account-role-arn arn:aws:iam::"$(aws sts get-caller-identity \ +--query "Account" \ +--output text)":role/AmazonEKS_EBS_CSI_DriverRole \ +--force + +sleep 30 +echo "Deploying AKO" +curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh \ +| bash -s v0.25.0 +kubectl create -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml +echo "Waiting for AKO" +while true; do + if kubectl --namespace operators get deployment/aerospike-operator-controller-manager &> /dev/null; then + kubectl --namespace operators wait \ + --for=condition=available --timeout=180s deployment/aerospike-operator-controller-manager + break + fi +done + +echo "Grant permissions to the target namespace" +kubectl create namespace aerospike +kubectl --namespace aerospike create serviceaccount aerospike-operator-controller-manager +kubectl create clusterrolebinding aerospike-cluster \ +--clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager + +echo "Set Secrets for Aerospike Cluster" +kubectl --namespace aerospike create secret generic aerospike-secret \ +--from-file=features.conf="$WORKSPACE/aerospike-proximus/eks/config/features.conf" +kubectl --namespace aerospike create secret generic auth-secret --from-literal=password='admin123' + +echo "Add Storage Class" +kubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-operator/master/config/samples/storage/eks_ssd_storage_class.yaml + +sleep 5 +echo "Deploy Aerospike Cluster" +kubectl apply -f "$WORKSPACE/aerospike-proximus/examples/eks/aerospike.yaml" + +sleep 5 +echo "Waiting for Aerospike Cluster" +while true; do + if kubectl --namespace aerospike get pods --selector=statefulset.kubernetes.io/pod-name &> /dev/null; then + kubectl --namespace aerospike wait pods \ + --selector=statefulset.kubernetes.io/pod-name --for=condition=ready --timeout=180s + break + fi +done + +sleep 30 +echo "Deploy Proximus" +helm install as-proximus-eks "$WORKSPACE/aerospike-proximus" \ +--values "$WORKSPACE/aerospike-proximus/examples/eks/as-proximus-eks-values.yaml" --namespace aerospike --wait diff --git a/aerospike-proximus/eks/run-quote-search.sh b/aerospike-proximus/eks/run-quote-search.sh new file mode 100755 index 0000000..0df4ef0 --- /dev/null +++ b/aerospike-proximus/eks/run-quote-search.sh @@ -0,0 +1,133 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" +REGION="" + +if [ -z "$REGION" ]; then + echo "Set Region" + exit 1 +fi + +VPC_ID="$(aws ec2 describe-vpcs \ +--region "$REGION" \ +--filters "Name=isDefault,Values=true" \ +--query 'Vpcs[0].VpcId' \ +--output text)" + +AMI_ID="$(aws ec2 describe-images \ +--region "$REGION" \ +--owners 099720109477 \ +--filters "Name=name,Values=*ubuntu/images/*ubuntu-mantic-23.10-amd64-server-*" \ +"Name=root-device-type,Values=ebs" "Name=virtualization-type,Values=hvm" \ +--query 'Images | sort_by(@, &CreationDate) | [-1].[ImageId]' \ +--output text)" + +SG_ID="$(aws ec2 create-security-group \ +--region "$REGION" \ +--group-name proximus-quote-search-sg \ +--description "Proximus Quote Search Security Group" \ +--vpc-id "$VPC_ID" \ +--output text)" + +aws ec2 authorize-security-group-ingress \ +--region "$REGION" --group-id "$SG_ID" --protocol tcp --port 80 --cidr 0.0.0.0/0 + +aws ec2 authorize-security-group-ingress \ +--region "$REGION" --group-id "$SG_ID" --protocol tcp --port 443 --cidr 0.0.0.0/0 + +aws ec2 authorize-security-group-ingress \ +--region "$REGION" --group-id "$SG_ID" --protocol tcp --port 22 --cidr 0.0.0.0/0 + +SUBNET_ID="$(aws ec2 describe-subnets \ +--region "$REGION" \ +--filters "Name=vpc-id,Values=$VPC_ID" \ +--query 'Subnets[0].SubnetId' \ +--output text)" + +aws ec2 create-key-pair \ +--region "$REGION" \ +--key-name proximus-quote-search-key \ +--query 'KeyMaterial' \ +--output text > "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" + +chmod 400 "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" + +cat <<-EOF > "$WORKSPACE/aerospike-proximus/eks/user-data.sh" +#!/bin/bash -e +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +rm -f get-docker.sh +usermod -aG docker ubuntu +EOF + +echo "Creating Instance" +aws ec2 run-instances \ +--region "$REGION" \ +--image-id "$AMI_ID" \ +--count 1 \ +--instance-type t3.medium \ +--key-name proximus-quote-search-key \ +--subnet-id "$SUBNET_ID" \ +--security-group-ids "$SG_ID" \ +--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=30,DeleteOnTermination=true}' \ +--tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=proximus-quote-search}]" \ +--user-data "file://$WORKSPACE/aerospike-proximus/eks/user-data.sh" > /dev/null + +INSTANCE_ID="$(aws ec2 describe-instances \ +--region "$REGION" \ +--filters "Name=tag:Name,Values=proximus-quote-search" \ +--query 'Reservations[*].Instances[?!contains(State.Name, `terminated`)].InstanceId' \ +--output text)" + +rm "$WORKSPACE/aerospike-proximus/eks/user-data.sh" +echo "Waiting for Instance to be ready" +aws ec2 wait instance-running --region "$REGION" --instance-ids "$INSTANCE_ID" +aws ec2 wait instance-status-ok --region "$REGION" --instance-ids "$INSTANCE_ID" + +PUBLIC_IP="$(aws ec2 describe-instances \ +--region "$REGION" \ +--instance-ids "$INSTANCE_ID" \ +--query 'Reservations[*].Instances[*].PublicIpAddress' \ +--output text)" + +cat <<-EOF > "$WORKSPACE/aerospike-proximus/eks/build-app.sh" +#!/bin/bash -e +git clone --branch VEC-95 https://github.com/aerospike/proximus-examples.git +cd ./proximus-examples/quote-semantic-search +docker build -f "Dockerfile-quote-search" -t "quote-search" . +cd - +rm -rf ./proximus-examples +EOF +chmod +x "$WORKSPACE/aerospike-proximus/eks/build-app.sh" + +scp -o StrictHostKeyChecking=no -i "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" \ +"$WORKSPACE/aerospike-proximus/eks/build-app.sh" ubuntu@"$PUBLIC_IP":/home/ubuntu +rm "$WORKSPACE/aerospike-proximus/eks/build-app.sh" + +ssh -o StrictHostKeyChecking=no \ +-i "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" ubuntu@"$PUBLIC_IP" bash /home/ubuntu/build-app.sh + +cat <<-EOF > "$WORKSPACE/aerospike-proximus/eks/run-app.sh" +#!/bin/bash -e +mkdir -p ./data +curl -L -o "./data/quotes.csv.tgz" \ +https://github.com/aerospike/proximus-examples/raw/main/quote-semantic-search/container-volumes/quote-search/data/quotes.csv.tgz +docker run -d \ +--name "quote-search" \ +-v "./data:/container-volumes/quote-search/data" \ +-p "8080:8080" \ +-e "PROXIMUS_HOST=$(kubectl -n aerospike get svc/as-proximus-eks-aerospike-proximus-lb \ +-o=jsonpath='{.status.loadBalancer.ingress[0].hostname}')" \ +-e "PROXIMUS_PORT=5000" \ +-e "APP_NUM_QUOTES=5000" \ +-e "GRPC_DNS_RESOLVER=native" \ +-e "PROXIMUS_IS_LOADBALANCER=True" quote-search +EOF + +chmod +x "$WORKSPACE/aerospike-proximus/eks/run-app.sh" +scp -o StrictHostKeyChecking=no \ +-i "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" \ +"$WORKSPACE/aerospike-proximus/eks/run-app.sh" ubuntu@"$PUBLIC_IP":/home/ubuntu +rm "$WORKSPACE/aerospike-proximus/eks/run-app.sh" + +ssh -o StrictHostKeyChecking=no \ +-i "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" ubuntu@"$PUBLIC_IP" bash /home/ubuntu/run-app.sh diff --git a/aerospike-proximus/eks/uninstall-eks-env.sh b/aerospike-proximus/eks/uninstall-eks-env.sh new file mode 100755 index 0000000..81e1673 --- /dev/null +++ b/aerospike-proximus/eks/uninstall-eks-env.sh @@ -0,0 +1,64 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" +REGION="" + +if [ -z "$REGION" ]; then + echo "set Region" + exit 1 +fi + +SG_ID="$(aws ec2 describe-security-groups \ +--region "$REGION" \ +--filters "Name=group-name,Values=proximus-quote-search-sg" \ +--query "SecurityGroups[*].GroupId" \ +--output text)" + +INSTANCE_ID="$(aws ec2 describe-instances \ +--region "$REGION" \ +--filters "Name=instance-state-name,Values=running" "Name=tag:Name,Values=proximus-quote-search" \ +--query "Reservations[*].Instances[*].InstanceId" \ +--output text)" + +aws ec2 terminate-instances \ +--region "$REGION" \ +--instance-ids "$INSTANCE_ID" + +aws ec2 wait instance-terminated \ +--region "$REGION" \ +--instance-ids "$INSTANCE_ID" + +aws ec2 delete-key-pair \ +--region "$REGION" \ +--key-name proximus-quote-search-key + +rm -f "$WORKSPACE/aerospike-proximus/eks/proximus-quote-search.pem" +aws ec2 delete-security-group \ +--region "$REGION" \ +--group-id "$SG_ID" + +kubectl delete -f "$WORKSPACE/aerospike-proximus/examples/eks/aerospike.yaml" +kubectl delete -f https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-operator/master/config/samples/storage/eks_ssd_storage_class.yaml +helm uninstall as-proximus-eks -n aerospike +kubectl --namespace aerospike delete secret auth-secret +kubectl --namespace aerospike delete secret aerospike-secret +kubectl delete clusterrolebinding aerospike-cluster +kubectl --namespace aerospike delete serviceaccount aerospike-operator-controller-manager +kubectl delete namespace aerospike +kubectl delete -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml +kubectl delete clusterserviceversion "$(kubectl get clusterserviceversion -o=jsonpath='{.items[0].metadata.name}')" +kubectl delete crd aerospikeclusters.asdb.aerospike.com + +eksctl delete iamserviceaccount \ +--region="$REGION" \ +--cluster proximus-eks-cluster \ +--name ebs-csi-controller-sa \ +--namespace kube-system + +eksctl delete addon \ +--region="$REGION" \ +--name aws-ebs-csi-driver \ +--cluster proximus-eks-cluster + +eksctl delete cluster \ +--region="$REGION" \ +--name proximus-eks-cluster diff --git a/aerospike-proximus/examples/eks/README.md b/aerospike-proximus/examples/eks/README.md new file mode 100644 index 0000000..b402da1 --- /dev/null +++ b/aerospike-proximus/examples/eks/README.md @@ -0,0 +1,53 @@ +# Aerospike Proximus EKS example + +## Prerequisites +- EKS cluster +- Helm v3 +- An Aerospike cluster that can connect to Pods in the Kubernetes cluster + The Aerospike cluster can be deployed in the same Kubernetes cluster using [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator) +- Aerospike Proximus [Helm chart](../../README.md#configuration) + +## Adding the helm chart repository + +Add the `aerospike` helm repository if not already done + +```shell +helm repo add aerospike https://aerospike.github.io/helm-charts +``` + +## Deploy Proximus Cluster. + +All subsequent commands are run from this directory. + +## Deploy the Aerospike cluster +If you do not have a preexisting Aerospike server, install [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator/install-operator). +The steps below will deploy an Aerospike cluster using Aerospike Kubernetes Operator and this [sample](aerospike.yaml) custom resource. + +### Create secrets +Create the secret for aerospike using your Aerospike licence file +```shell +kubectl --namespace aerospike create secret generic aerospike-secret --from-file=features.conf=features.conf +``` + +### Launch the Aerospike cluster +```shell +kubectl -n aerospike create -f aerospike.yaml +``` + +### Create a new Kubernetes namespace +Create a Kubernetes namespace if not already done +```shell +kubectl create namespace aerospike +``` + +### EKS LoadBalancer configuration +In this example we configure internal facing L4 LoadBalancer (NLB) for more details please refer to AWS [documentation](https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html). + +### Deploy Proximus. +Update the [as-proximus-eks-values.yaml](as-proximus-eks-values.yaml) file to change Proximus configuration. + + +Deploy the Proximus cluster using configuration from [as-proximus-eks-values.yaml](as-proximus-eks-values.yaml) +```shell +helm install --namespace aerospike as-proximus-eks -f as-proximus-eks-values.yaml ../../../aerospike-proximus +``` diff --git a/aerospike-proximus/examples/eks/aerospike.yaml b/aerospike-proximus/examples/eks/aerospike.yaml new file mode 100644 index 0000000..daa21c5 --- /dev/null +++ b/aerospike-proximus/examples/eks/aerospike.yaml @@ -0,0 +1,86 @@ +--- +apiVersion: asdb.aerospike.com/v1 +kind: AerospikeCluster +metadata: + name: aerospike-cluster + namespace: aerospike +spec: + size: 3 + image: aerospike/aerospike-server-enterprise:7.0.0.5 + + podSpec: + multiPodPerHost: false + + storage: + filesystemVolumePolicy: + cascadeDelete: true + initMethod: deleteFiles + volumes: + - name: workdir + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 3Gi + aerospike: + path: /opt/aerospike + - name: nsvol1 + aerospike: + path: /mnt/disks/test + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 5Gi + - name: nsvol2 + aerospike: + path: /mnt/disks/proximus + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 5Gi + - name: aerospike-config-secret + source: + secret: + secretName: aerospike-secret + aerospike: + path: /etc/aerospike/secret + + # aerospikeAccessControl: + # users: + # - name: admin + # secretName: auth-secret + # roles: + # - sys-admin + # - user-admin + + aerospikeConfig: + service: + feature-key-file: /etc/aerospike/secret/features.conf + # security: {} + network: + service: + port: 3000 + fabric: + port: 3001 + heartbeat: + port: 3002 + namespaces: + - name: test + replication-factor: 2 + storage-engine: + type: device + filesize: 5368709120 + files: + - /mnt/disks/test/test.dat + - name: proximus-meta + nsup-period: 600 + nsup-threads: 2 + evict-tenths-pct: 5 + replication-factor: 2 + storage-engine: + type: device + filesize: 5368709120 + files: + - /mnt/disks/proximus/proximus.dat diff --git a/aerospike-proximus/examples/eks/as-proximus-eks-values.yaml b/aerospike-proximus/examples/eks/as-proximus-eks-values.yaml new file mode 100644 index 0000000..34efefc --- /dev/null +++ b/aerospike-proximus/examples/eks/as-proximus-eks-values.yaml @@ -0,0 +1,45 @@ +replicaCount: 3 +proximusConfig: + heartbeat: + seeds: + - address: as-proximus-eks-aerospike-proximus-0.as-proximus-eks-aerospike-proximus.aerospike.svc.cluster.local + port: 5001 + interconnect: + ports: + 5001: + addresses: + 0.0.0.0 + aerospike: + metadata-namespace: "proximus-meta" + seeds: + - aerospike-cluster-0-0.aerospike-cluster.aerospike.svc.cluster.local: + port: 3000 + logging: + # file: /var/log/aerospike-proximus/aerospike-proximus.log + enable-console-logging: false + format: simple + max-history: 30 + levels: + metrics-ticker: info + root: info + ticker-interval: 10 + +service: + enabled: true + annotations: + service.beta.kubernetes.io/aws-load-balancer-type: nlb + ports: + - name: "svc-port" + port: 5000 + targetPort: 5000 + +affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "kubernetes.io/hostname" + labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - "aerospike-proximus" diff --git a/aerospike-proximus/examples/gke/README.md b/aerospike-proximus/examples/gke/README.md new file mode 100644 index 0000000..7881ce2 --- /dev/null +++ b/aerospike-proximus/examples/gke/README.md @@ -0,0 +1,53 @@ +# Aerospike Proximus GKE example + +## Prerequisites +- GKE cluster +- Helm v3 +- An Aerospike cluster that can connect to Pods in the Kubernetes cluster + The Aerospike cluster can be deployed in the same Kubernetes cluster using [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator) +- Aerospike Proximus [Helm chart](../../README.md#configuration) + +## Adding the helm chart repository + +Add the `aerospike` helm repository if not already done + +```shell +helm repo add aerospike https://aerospike.github.io/helm-charts +``` + +## Deploy Proximus Cluster. + +All subsequent commands are run from this directory. + +## Deploy the Aerospike cluster +If you do not have a preexisting Aerospike server, install [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator/install-operator). +The steps below will deploy an Aerospike cluster using Aerospike Kubernetes Operator and this [sample](aerospike.yaml) custom resource. + +### Create secrets +Create the secret for aerospike using your Aerospike licence file +```shell +kubectl --namespace aerospike create secret generic aerospike-secret --from-file=features.conf=features.conf +``` + +### Launch the Aerospike cluster +```shell +kubectl -n aerospike create -f aerospike.yaml +``` + +### Create a new Kubernetes namespace +Create a Kubernetes namespace if not already done +```shell +kubectl create namespace aerospike +``` + +### GKE LoadBalancer configuration +In this example we configure internal facing L4 LoadBalancer for more details please refer to GCP [documentation](https://cloud.google.com/kubernetes-engine/docs/concepts/service-load-balancer). + +### Deploy Proximus. +Update the [as-proximus-gke-values.yaml](as-proximus-gke-values.yaml) file to change Proximus configuration. + + +Deploy the Proximus cluster using configuration from [as-proximus-gke-values.yaml](as-proximus-gke-values.yaml) +```shell +helm install --namespace aerospike as-proximus-gke -f as-proximus-gke-values.yaml ../../../aerospike-proximus +``` diff --git a/aerospike-proximus/examples/gke/aerospike.yaml b/aerospike-proximus/examples/gke/aerospike.yaml new file mode 100644 index 0000000..daa21c5 --- /dev/null +++ b/aerospike-proximus/examples/gke/aerospike.yaml @@ -0,0 +1,86 @@ +--- +apiVersion: asdb.aerospike.com/v1 +kind: AerospikeCluster +metadata: + name: aerospike-cluster + namespace: aerospike +spec: + size: 3 + image: aerospike/aerospike-server-enterprise:7.0.0.5 + + podSpec: + multiPodPerHost: false + + storage: + filesystemVolumePolicy: + cascadeDelete: true + initMethod: deleteFiles + volumes: + - name: workdir + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 3Gi + aerospike: + path: /opt/aerospike + - name: nsvol1 + aerospike: + path: /mnt/disks/test + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 5Gi + - name: nsvol2 + aerospike: + path: /mnt/disks/proximus + source: + persistentVolume: + storageClass: ssd + volumeMode: Filesystem + size: 5Gi + - name: aerospike-config-secret + source: + secret: + secretName: aerospike-secret + aerospike: + path: /etc/aerospike/secret + + # aerospikeAccessControl: + # users: + # - name: admin + # secretName: auth-secret + # roles: + # - sys-admin + # - user-admin + + aerospikeConfig: + service: + feature-key-file: /etc/aerospike/secret/features.conf + # security: {} + network: + service: + port: 3000 + fabric: + port: 3001 + heartbeat: + port: 3002 + namespaces: + - name: test + replication-factor: 2 + storage-engine: + type: device + filesize: 5368709120 + files: + - /mnt/disks/test/test.dat + - name: proximus-meta + nsup-period: 600 + nsup-threads: 2 + evict-tenths-pct: 5 + replication-factor: 2 + storage-engine: + type: device + filesize: 5368709120 + files: + - /mnt/disks/proximus/proximus.dat diff --git a/aerospike-proximus/examples/gke/as-proximus-gke-values.yaml b/aerospike-proximus/examples/gke/as-proximus-gke-values.yaml new file mode 100644 index 0000000..2ae2bb9 --- /dev/null +++ b/aerospike-proximus/examples/gke/as-proximus-gke-values.yaml @@ -0,0 +1,45 @@ +replicaCount: 3 +proximusConfig: + heartbeat: + seeds: + - address: as-proximus-gke-aerospike-proximus-0.as-proximus-gke-aerospike-proximus.aerospike.svc.cluster.local + port: 5001 + interconnect: + ports: + 5001: + addresses: + 0.0.0.0 + aerospike: + metadata-namespace: "proximus-meta" + seeds: + - aerospike-cluster-0-0.aerospike-cluster.aerospike.svc.cluster.local: + port: 3000 + logging: + # file: /var/log/aerospike-proximus/aerospike-proximus.log + enable-console-logging: false + format: simple + max-history: 30 + levels: + metrics-ticker: info + root: info + ticker-interval: 10 + +service: + enabled: true + annotations: + networking.gke.io/load-balancer-type: "Internal" + ports: + - name: "svc-port" + port: 5000 + targetPort: 5000 + +affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "kubernetes.io/hostname" + labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - "aerospike-proximus" diff --git a/aerospike-proximus/examples/quote-search/README.md b/aerospike-proximus/examples/quote-search/README.md new file mode 100644 index 0000000..2b7d76a --- /dev/null +++ b/aerospike-proximus/examples/quote-search/README.md @@ -0,0 +1,115 @@ +# Aerospike Proximus Quote Search example + +This example deploys Aerospike Proximus cluster along with an Aerospike cluster and runs `quote-search` example app. + +## Prerequisites +- Kubernetes cluster +- Helm v3 +- An Aerospike cluster that can connect to Pods in the Kubernetes cluster + The Aerospike cluster can be deployed in the same Kubernetes cluster using [Aerospike Kubernetes Operator](https://docs.aerospike.com/cloud/kubernetes/operator) +- Aerospike Proximus [Helm chart](../../README.md#configuration) + +## Clone this repository. +- A clone of this git repository + +## Deploy Proximus Cluster. + +All subsequent commands are run from this directory. + +### Install and Configure Load-Balancer +Proximus cluster can be reach outside of Kubernetes cluster using a Load-Balancer in this example we're using Metallb but it could be any L4 Load-Balancer of your choice. +#### Deploy MetalLB +```shell +kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.4/config/manifests/metallb-native.yaml +``` +Wait for a few minutes until everything is set up +#### Deploy MetalLB Configuration +```shell +kubectl apply -f - < /dev/null; then + kubectl --namespace operators wait \ + --for=condition=available --timeout=180s deployment/aerospike-operator-controller-manager + break + fi +done + +echo "Grant permissions to the target namespace" +kubectl create namespace aerospike +kubectl --namespace aerospike create serviceaccount aerospike-operator-controller-manager +kubectl create clusterrolebinding aerospike-cluster \ +--clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager + +echo "Set Secrets for Aerospike Cluster" +kubectl --namespace aerospike create secret generic aerospike-secret \ +--from-file=features.conf="$WORKSPACE/aerospike-proximus/gke/config/features.conf" +kubectl --namespace aerospike create secret generic auth-secret --from-literal=password='admin123' + +echo "Add Storage Class" +kubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-operator/master/config/samples/storage/gce_ssd_storage_class.yaml + +sleep 5 +echo "Deploy Aerospike Cluster" +kubectl apply -f "$WORKSPACE/aerospike-proximus/examples/gke/aerospike.yaml" + +sleep 5 +echo "Waiting for Aerospike Cluster" +while true; do + if kubectl --namespace aerospike get pods --selector=statefulset.kubernetes.io/pod-name &> /dev/null; then + kubectl --namespace aerospike wait pods \ + --selector=statefulset.kubernetes.io/pod-name --for=condition=ready --timeout=180s + break + fi +done + +sleep 30 +echo "Deploy Proximus" +helm install as-proximus-gke "$WORKSPACE/aerospike-proximus" \ +--values "$WORKSPACE/aerospike-proximus/examples/gke/as-proximus-gke-values.yaml" --namespace aerospike --wait diff --git a/aerospike-proximus/gke/install-prometheus.sh b/aerospike-proximus/gke/install-prometheus.sh new file mode 100755 index 0000000..8233615 --- /dev/null +++ b/aerospike-proximus/gke/install-prometheus.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" + +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts +helm repo update +helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \ +--values "$WORKSPACE"/aerospike-proximus/gke/config/kube-prometheus-stack-values.yaml \ +--namespace monitoring \ +--create-namespace \ +--wait +kubectl apply -f "$WORKSPACE"/aerospike-proximus/gke/config/servicemonitor.yaml + +#kubectl port-forward service/kube-prometheus-stack-prometheus 9090 -n monitoring diff --git a/aerospike-proximus/gke/run-quote-search.sh b/aerospike-proximus/gke/run-quote-search.sh new file mode 100755 index 0000000..f39e276 --- /dev/null +++ b/aerospike-proximus/gke/run-quote-search.sh @@ -0,0 +1,67 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" +PROJECT="" +ZONE="" + +gcloud compute instances create proximus-app \ +--zone="$ZONE" \ +--machine-type=e2-medium \ +--boot-disk-size=30GB \ +--image-project=ubuntu-os-cloud \ +--image-family=ubuntu-2310-amd64 \ +--metadata=startup-script="$(cat <<-EOF +#!/bin/bash -e +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +rm -f get-docker.sh +EOF +)" +sleep 120 + +gcloud compute ssh proximus-app \ +--zone="$ZONE" \ +--project="$PROJECT" \ +--command="sudo usermod -aG docker $USER" + +cat <<-EOF > "$WORKSPACE/aerospike-proximus/gke/build-app.sh" +#!/bin/bash -e +git clone --branch VEC-95 https://github.com/aerospike/proximus-examples.git +cd ./proximus-examples/quote-semantic-search +docker build -f "Dockerfile-quote-search" -t "quote-search" . +cd - +rm -rf ./proximus-examples +EOF +chmod +x "$WORKSPACE/aerospike-proximus/gke/build-app.sh" + +gcloud compute scp build-app.sh proximus-app:~/build-app.sh \ +--zone="$ZONE" \ +--project="$PROJECT" +rm "$WORKSPACE/aerospike-proximus/gke/build-app.sh" + +gcloud compute ssh proximus-app --zone="$ZONE" --project="$PROJECT" -- "./build-app.sh" + +cat <<-EOF > "$WORKSPACE/aerospike-proximus/gke/run-app.sh" +#!/bin/bash -e +mkdir -p ./data +curl -L -o "./data/quotes.csv.tgz" \ +https://github.com/aerospike/proximus-examples/raw/main/quote-semantic-search/container-volumes/quote-search/data/quotes.csv.tgz +docker run -d \ +--name "quote-search" \ +-v "./data:/container-volumes/quote-search/data" \ +-p "8080:8080" \ +-e "PROXIMUS_HOST=$(kubectl -n aerospike get svc/as-proximus-gke-aerospike-proximus-lb \ +-o=jsonpath='{.status.loadBalancer.ingress[0].ip}')" \ +-e "PROXIMUS_PORT=5000" \ +-e "APP_NUM_QUOTES=5000" \ +-e "GRPC_DNS_RESOLVER=native" \ +-e "PROXIMUS_IS_LOADBALANCER=True" quote-search +EOF + +chmod +x "$WORKSPACE/aerospike-proximus/gke/run-app.sh" + +gcloud compute scp run-app.sh proximus-app:~/run-app.sh \ +--zone="$ZONE" \ +--project="$PROJECT" +rm "$WORKSPACE/aerospike-proximus/gke/run-app.sh" + +gcloud compute ssh proximus-app --zone="$ZONE" --project="$PROJECT" -- "./run-app.sh" diff --git a/aerospike-proximus/gke/uninstall-gke-env.sh b/aerospike-proximus/gke/uninstall-gke-env.sh new file mode 100755 index 0000000..393ef8d --- /dev/null +++ b/aerospike-proximus/gke/uninstall-gke-env.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" +ZONE="" + +gcloud compute instances delete proximus-app --zone="$ZONE" --quiet +kubectl delete -f "$WORKSPACE/aerospike-proximus/examples/gke/aerospike.yaml" +kubectl delete -f https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-operator/master/config/samples/storage/gce_ssd_storage_class.yaml +helm uninstall as-proximus-gke -n aerospike +kubectl --namespace aerospike delete secret auth-secret +kubectl --namespace aerospike delete secret aerospike-secret +kubectl delete clusterrolebinding aerospike-cluster +kubectl --namespace aerospike delete serviceaccount aerospike-operator-controller-manager +kubectl delete namespace aerospike +kubectl delete -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml +kubectl delete clusterserviceversion "$(kubectl get clusterserviceversion -o=jsonpath='{.items[0].metadata.name}')" +kubectl delete crd aerospikeclusters.asdb.aerospike.com +gcloud container clusters delete proximus-gke-cluster --zone="$ZONE" --quiet \ No newline at end of file diff --git a/aerospike-proximus/gke/uninstall-prometheus.sh b/aerospike-proximus/gke/uninstall-prometheus.sh new file mode 100755 index 0000000..ed68c08 --- /dev/null +++ b/aerospike-proximus/gke/uninstall-prometheus.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" + +kubectl delete -f "$WORKSPACE"/aerospike-proximus/gke/config/servicemonitor.yaml +helm uninstall kube-prometheus-stack --namespace monitoring diff --git a/aerospike-proximus/local-env/README.md b/aerospike-proximus/local-env/README.md new file mode 100644 index 0000000..18eb9f2 --- /dev/null +++ b/aerospike-proximus/local-env/README.md @@ -0,0 +1,23 @@ +# Local Env Installation +## Prerequisites +### Build `quote-serch` +```shell +git clone --branch VEC-95 https://github.com/aerospike/proximus-examples.git +cd ./proximus-examples/quote-semantic-search +docker build -f "Dockerfile-quote-search" -t "quote-search" . + +``` +### Create Local Env +```shell +./install-kind.sh +``` + +### Run `qoute-serch` Example App +```shell +./run-quote-search.sh +``` + +### Destroy Local Env +```shell +./uninstall-kind.sh +``` diff --git a/aerospike-proximus/local-env/config/kind-cluster.yaml b/aerospike-proximus/local-env/config/kind-cluster.yaml new file mode 100644 index 0000000..d4c7007 --- /dev/null +++ b/aerospike-proximus/local-env/config/kind-cluster.yaml @@ -0,0 +1,17 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane + kubeadmConfigPatches: + - | + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "ingress-ready=true" + extraPortMappings: + - containerPort: 80 + hostPort: 80 + protocol: TCP + - containerPort: 443 + hostPort: 443 + protocol: TCP diff --git a/aerospike-proximus/local-env/config/metallb-config.yaml b/aerospike-proximus/local-env/config/metallb-config.yaml new file mode 100644 index 0000000..59afce4 --- /dev/null +++ b/aerospike-proximus/local-env/config/metallb-config.yaml @@ -0,0 +1,14 @@ +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: example + namespace: metallb-system +spec: + addresses: + - 172.18.255.200-172.18.255.250 +--- +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: empty + namespace: metallb-system diff --git a/aerospike-proximus/local-env/install-kind.sh b/aerospike-proximus/local-env/install-kind.sh new file mode 100755 index 0000000..0c8816d --- /dev/null +++ b/aerospike-proximus/local-env/install-kind.sh @@ -0,0 +1,63 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" + +if [ ! -f "$WORKSPACE/aerospike-proximus/local-env/config/features.conf" ]; then + echo "features.conf Not found" + exit 1 +fi + +echo "Installing Kind" +kind create cluster --config "$WORKSPACE/aerospike-proximus/local-env/config/kind-cluster.yaml" +kubectl cluster-info --context kind-kind + +echo "Deploying AKO" +curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh \ +| bash -s v0.25.0 +kubectl create -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml +echo "Waiting for AKO" +while true; do + if kubectl --namespace operators get deployment/aerospike-operator-controller-manager &> /dev/null; then + kubectl --namespace operators wait \ + --for=condition=available --timeout=180s deployment/aerospike-operator-controller-manager + break + fi +done + +echo "Grant permissions to the target namespace" +kubectl create namespace aerospike +kubectl --namespace aerospike create serviceaccount aerospike-operator-controller-manager +kubectl create clusterrolebinding aerospike-cluster \ +--clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager + +echo "Set Secrets for Aerospike Cluster" +kubectl --namespace aerospike create secret generic aerospike-secret \ +--from-file=features.conf="$WORKSPACE/aerospike-proximus/local-env/config/features.conf" +kubectl --namespace aerospike create secret generic auth-secret --from-literal=password='admin123' + + +sleep 5 +echo "Deploy Aerospike Cluster" +kubectl apply -f "$WORKSPACE/aerospike-proximus/examples/quote-search/aerospike.yaml" + +sleep 5 +echo "Waiting for Aerospike Cluster" +while true; do + if kubectl --namespace aerospike get pods --selector=statefulset.kubernetes.io/pod-name &> /dev/null; then + kubectl --namespace aerospike wait pods \ + --selector=statefulset.kubernetes.io/pod-name --for=condition=ready --timeout=180s + break + fi +done + +echo "Deploy MetalLB" +kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.4/config/manifests/metallb-native.yaml +kubectl wait --namespace metallb-system \ + --for=condition=ready pod \ + --selector=app=metallb \ + --timeout=90s +kubectl apply -f "$WORKSPACE/aerospike-proximus/local-env/config/metallb-config.yaml" + +sleep 30 +echo "Deploy Proximus" +helm install as-quote-search "$WORKSPACE/aerospike-proximus" \ +--values "$WORKSPACE/aerospike-proximus/examples/quote-search/as-quote-search-values.yaml" --namespace aerospike diff --git a/aerospike-proximus/local-env/run-quote-search.sh b/aerospike-proximus/local-env/run-quote-search.sh new file mode 100755 index 0000000..ab7d61a --- /dev/null +++ b/aerospike-proximus/local-env/run-quote-search.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e +WORKSPACE="$(git rev-parse --show-toplevel)" + +mkdir -p "$WORKSPACE/aerospike-proximus/proximus-examples/local-env/data" + +curl -L -o "$WORKSPACE/aerospike-proximus/proximus-examples/local-env/data/quotes.csv.tgz" \ +https://github.com/aerospike/proximus-examples/raw/main/quote-semantic-search/container-volumes/quote-search/data/quotes.csv.tgz +docker run -d \ +--name "quote-search" \ +-v "$WORKSPACE/aerospike-proximus/local-env/data:/container-volumes/quote-search/data" \ +--network "kind" -p "8080:8080" \ +-e "PROXIMUS_HOST=$(kubectl -n aerospike get svc/as-quote-search-aerospike-proximus-lb \ +-o=jsonpath='{.status.loadBalancer.ingress[0].ip}')" \ +-e "PROXIMUS_PORT=80" \ +-e "APP_NUM_QUOTES=5000" \ +-e "GRPC_DNS_RESOLVER=native" \ +-e "PROXIMUS_IS_LOADBALANCER=True" quote-search diff --git a/aerospike-proximus/local-env/uninstall-kind.sh b/aerospike-proximus/local-env/uninstall-kind.sh new file mode 100755 index 0000000..e1e6a37 --- /dev/null +++ b/aerospike-proximus/local-env/uninstall-kind.sh @@ -0,0 +1,25 @@ +#!/bin/bash -e + +WORKSPACE="$(git rev-parse --show-toplevel)" + +container_exists="$(docker ps -a -q -f name=^quote-search$)" +if [ ! -z "$container_exists" ]; then + docker stop quote-search + docker rm quote-search + fi + +rm -rf "$WORKSPACE/aerospike-proximus/local-env/data" +helm delete as-quote-search --namespace aerospike +kubectl delete -f "$WORKSPACE/aerospike-proximus/local-env/config/metallb-config.yaml" +kubectl delete -f https://raw.githubusercontent.com/metallb/metallb/v0.14.4/config/manifests/metallb-native.yaml +kubectl delete -f "$WORKSPACE/aerospike-proximus/examples/quote-search/aerospike.yaml" +kubectl --namespace aerospike delete secret auth-secret +kubectl --namespace aerospike delete secret aerospike-secret +kubectl delete clusterrolebinding aerospike-cluster +kubectl --namespace aerospike delete serviceaccount aerospike-operator-controller-manager +kubectl delete namespace aerospike +kubectl delete -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml +kubectl delete clusterserviceversion "$(kubectl get clusterserviceversion -o=jsonpath='{.items[0].metadata.name}')" +kubectl delete crd aerospikeclusters.asdb.aerospike.com +kind delete cluster +docker network rm kind diff --git a/aerospike-proximus/templates/NOTES.txt b/aerospike-proximus/templates/NOTES.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/aerospike-proximus/templates/NOTES.txt @@ -0,0 +1 @@ + diff --git a/aerospike-proximus/templates/_helpers.tpl b/aerospike-proximus/templates/_helpers.tpl new file mode 100644 index 0000000..383036c --- /dev/null +++ b/aerospike-proximus/templates/_helpers.tpl @@ -0,0 +1,69 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "aerospike-proximus.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "aerospike-proximus.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "aerospike-proximus.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aerospike-proximus.labels" -}} +helm.sh/chart: {{ include "aerospike-proximus.chart" . }} +{{ include "aerospike-proximus.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aerospike-proximus.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aerospike-proximus.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aerospike-proximus.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aerospike-proximus.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Generate a list of keys from a dictionary. +*/}} +{{- define "aerospike-proximus.proximusConfigPorts" -}} + +{{- end -}} \ No newline at end of file diff --git a/aerospike-proximus/templates/configmap.yaml b/aerospike-proximus/templates/configmap.yaml new file mode 100644 index 0000000..5241d49 --- /dev/null +++ b/aerospike-proximus/templates/configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aerospike-proximus.fullname" . }} + labels: + {{- include "aerospike-proximus.labels" . | nindent 4 }} +data: + aerospike-proximus.yml: |- + {{- .Values.proximusConfig | toYaml | nindent 4 }} diff --git a/aerospike-proximus/templates/hpa.yaml b/aerospike-proximus/templates/hpa.yaml new file mode 100644 index 0000000..3879938 --- /dev/null +++ b/aerospike-proximus/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "aerospike-proximus.fullnamee" . }} + labels: + {{- include "aerospike-proximus.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: StatefulSet + name: {{ include "aerospike-proximus.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/aerospike-proximus/templates/service.yaml b/aerospike-proximus/templates/service.yaml new file mode 100644 index 0000000..fffc2d8 --- /dev/null +++ b/aerospike-proximus/templates/service.yaml @@ -0,0 +1,96 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aerospike-proximus.fullname" . }} + labels: + app: {{ include "aerospike-proximus.fullname" . }} + {{- include "aerospike-proximus.labels" . | nindent 4 }} +spec: + clusterIP: None + ports: + {{- range $k := .Values.proximusConfig.service.ports | keys }} + - name: {{ printf "svc-%s" $k }} + port: {{ $k }} + {{- end -}} + {{- range $k := .Values.proximusConfig.manage.ports | keys }} + - name: {{ printf "manage-%s" $k }} + port: {{ $k }} + {{- end -}} + {{- range $k := .Values.proximusConfig.interconnect.ports | keys }} + - name: {{ printf "interc-%s" $k }} + port: {{ $k }} + {{- end }} + selector: + app: {{ include "aerospike-proximus.fullname" . }} + {{- include "aerospike-proximus.selectorLabels" . | nindent 4 }} + +--- +{{- if and .Values.service.enabled -}} +apiVersion: v1 +kind: Service +metadata: + annotations: + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "aerospike-proximus.labels" . | nindent 4 }} + app: {{ include "aerospike-proximus.fullname" . }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ include "aerospike-proximus.fullname" . }}-lb +spec: + type: {{ .Values.service.type }} +{{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} +{{- if .Values.service.externalIPs }} + externalIPs: {{ toYaml .Values.service.externalIPs | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} +{{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerClass }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} +{{- end }} +{{- if hasKey .Values.service "allocateLoadBalancerNodePorts" }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} +{{- end }} +{{- if .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} +{{- end }} +{{- if .Values.service.sessionAffinity }} + sessionAffinity: {{ .Values.service.sessionAffinity }} +{{- end }} +{{- if .Values.service.healthCheckNodePort }} + healthCheckNodePort: {{ .Values.service.healthCheckNodePort }} +{{- end }} +{{- if semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version -}} +{{- if .Values.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} +{{- end }} +{{- if .Values.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.service.ipFamilies | nindent 4 }} +{{- end }} +{{- end }} + ports: + {{- range $v := .Values.service.ports }} + - name: {{ $v.name }} + port: {{ $v.port }} + protocol: TCP + {{- if ($v.targetPort) }} + targetPort: {{ $v.targetPort }} + {{- end }} + {{- if and (semverCompare ">=1.20" $.Capabilities.KubeVersion.Version) ($v.appProtocol) }} + appProtocol: {{ $v.appProtocol }} + {{- end }} + {{- end }} + selector: + app: {{ include "aerospike-proximus.fullname" . }} + {{- include "aerospike-proximus.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/aerospike-proximus/templates/serviceaccount.yaml b/aerospike-proximus/templates/serviceaccount.yaml new file mode 100644 index 0000000..d7691fb --- /dev/null +++ b/aerospike-proximus/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "aerospike-proximus.serviceAccountName" . }} + labels: + {{- include "aerospike-proximus.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/aerospike-proximus/templates/statefulset.yaml b/aerospike-proximus/templates/statefulset.yaml new file mode 100644 index 0000000..1a4d479 --- /dev/null +++ b/aerospike-proximus/templates/statefulset.yaml @@ -0,0 +1,124 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "aerospike-proximus.fullname" . }} + labels: + app: {{ include "aerospike-proximus.fullname" . }} + {{- include "aerospike-proximus.labels" . | nindent 4 }} +spec: + updateStrategy: + type: RollingUpdate + podManagementPolicy: Parallel + replicas: {{ .Values.replicaCount }} + serviceName: {{ include "aerospike-proximus.fullname" . }} + selector: + matchLabels: + {{- include "aerospike-proximus.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/configmap: {{ .Values.proximusConfig | toString | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "aerospike-proximus.fullname" . }} + {{- include "aerospike-proximus.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "aerospike-proximus.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{ if .Values.initContainers }} + initContainers: + {{- toYaml .Values.initContainers | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + {{- range $k := .Values.proximusConfig.service.ports | keys }} + - name: {{ printf "svc-%s" $k }} + containerPort: {{ $k }} + protocol: TCP + {{- end -}} + {{- range $k := .Values.proximusConfig.manage.ports | keys }} + - name: {{ printf "manage-%s" $k }} + containerPort: {{ $k }} + protocol: TCP + {{- end -}} + {{- range $k := .Values.proximusConfig.interconnect.ports | keys }} + - name: {{ printf "interc-%s" $k }} + containerPort: {{ $k }} + protocol: TCP + {{- end }} + volumeMounts: + - name: aerospike-proximus-configmap + mountPath: /etc/aerospike-proximus/aerospike-proximus.yml + subPath: aerospike-proximus.yml + readOnly: true + - name: aerospike-secret + mountPath: {{ index .Values.proximusConfig "feature-key-file" }} + subPath: {{ index .Values.proximusConfig "feature-key-file" | base }} + readOnly: true + {{- if .Values.extraVolumeMounts }} + {{- range .Values.extraVolumeMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + readOnly: {{ .readOnly | default true }} + {{- end }} + {{- end }} + {{- if .Values.extraSecretVolumeMounts }} + {{- range .Values.extraSecretVolumeMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + readOnly: {{ .readOnly | default true }} + {{- end }} + {{- end }} + livenessProbe: + httpGet: + port: 5040 + path: /manage/rest/v1 + initialDelaySeconds: 10 + timeoutSeconds: 2 + readinessProbe: + httpGet: + port: 5040 + path: /manage/rest/v1 + initialDelaySeconds: 10 + timeoutSeconds: 2 + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: aerospike-proximus-configmap + configMap: + name: {{ include "aerospike-proximus.fullname" . }} + optional: false + - name: aerospike-secret + secret: + secretName: aerospike-secret + optional: false + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/aerospike-proximus/templates/tests/test-connection.yaml b/aerospike-proximus/templates/tests/test-connection.yaml new file mode 100644 index 0000000..29f1896 --- /dev/null +++ b/aerospike-proximus/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "aerospike-proximus.fullname" . }}-test-connection" + labels: + {{- include "aerospike-proximus.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "aerospike-proximus.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/aerospike-proximus/values.yaml b/aerospike-proximus/values.yaml new file mode 100644 index 0000000..9f89b54 --- /dev/null +++ b/aerospike-proximus/values.yaml @@ -0,0 +1,194 @@ +# Default values for aerospike-proximus. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: "aerospike/aerospike-proximus" + pullPolicy: "IfNotPresent" + # Overrides the image tag whose default is the chart appVersion. + tag: "0.3.1" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +proximusConfig: + cluster: + # TODO Figure out how to Add node-id field + cluster-name: "proximus-db-1" + feature-key-file: "/etc/aerospike-proximus/features.conf" + service: + # Required when running behind NAT + # advertised-listeners: + # List of externally accessible addresses and ports for this Proximus instance. + # default: + # - address: 10.0.0.1 + # port: 5000 + ports: + 5000: + addresses: + "0.0.0.0" +# cluster-name: "product-name" + #max-inbound-message-size: 8388608 + #flow-control: + # TODO Give reasonable example values for io-threads + # io-threads: 4 + # TODO Give reasonable example values for worker-threads + # worker-threads: 4 + #memory-high-water-mark-percentage: 80 + #memory-low-water-mark-percentage: 60 + #period: 10 + #stream-ready-timeout: 10000 + #minimum-enable-time: 10000 + manage: + ports: + 5040: {} + interconnect: + ports: + 5001: + addresses: + "0.0.0.0" + #heartbeat: + # TODO Not clear how seeds should be look like + # seeds: + # - address: "127.0.0.1" + # port: 5001 + #interval: 500 + #timeout: 5000 + aerospike: + metadata-namespace: "proximus-meta" + seeds: + - 127.0.0.1: + port: 3000 + #client-policy: + # TODO Give reasonable name for cluster-name + #cluster-name: "aerospike-cluster" + # TODO Give reasonable value for unary-event-loops + # unary-event-loops: 4 + #batch-event-loops: 1 + #query-event-loops: 1 + #auth-mode: "INTERNAL" + #timeout: 1000 + #login-timeout: 5000 + #close-timeout: 0 + #min-conns-per-node: 0 + #max-conns-per-node: 100 + #conn-pools-per-node: 1 + #max-socket-idle: 0 + #max-error-rate: 0 + #error-rate-window: 1 + #tend-interval: 1000 + #use-services-alternate: false + # keep-alive: "" + # ip-map: "" + # rack-aware: "" + # rack-id: "" + # rack-ids: "" + #indexing: + #cache: + #max-entries: 5000000 + # TODO Set some resonable value for expiry-millis field + # expiry-millis: 300000 + logging: + # file: /var/log/aerospike-proximus/aerospike-proximus.log + enable-console-logging: false + format: simple + max-history: 30 + levels: + metrics-ticker: info + root: debug + ticker-interval: 10 + + +initContainers: [] + +serviceAccount: + # Specifies whether a service account should be created + create: false + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + enabled: false + annotations: {} + labels: {} + type: LoadBalancer + clusterIP: "" + externalIPs: [] + loadBalancerIP: "" + loadBalancerSourceRanges: [] + loadBalancerClass: "" + externalTrafficPolicy: "" + sessionAffinity: "" + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 + ports: + - name: "svc-port" + port: 80 + targetPort: 5000 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + +# Additional volumes on the output Deployment definition. +extraVolumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +extraVolumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true +extraSecretVolumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + + +nodeSelector: {} + +tolerations: [] + +affinity: {}