Coder Social home page Coder Social logo

aerospike / aerospike-kubernetes-enterprise Goto Github PK

View Code? Open in Web Editor NEW
17.0 60.0 7.0 4.17 MB

Home Page: https://www.aerospike.com/docs

License: Apache License 2.0

Shell 50.40% Mustache 49.60%
aerospike-kubernetes statefulset aerospike database helm

aerospike-kubernetes-enterprise's Introduction

aerospike-kubernetes-enterprise

This project contains the init container used in Kubernetes (k8s) and the Aerospike StatefulSet definition. This manifest will allow you to deploy a fully formed Aerospike cluster in minutes.

This project uses:

Usage:

Configure:

Set environment variables (modify if necessary):

export APP_NAME=aerospike
export NAMESPACE=default
export AEROSPIKE_NODES=3
export AEROSPIKE_NAMESPACE=test
export AEROSPIKE_REPL=2
export AEROSPIKE_MEM=1
export AEROSPIKE_TTL=0
export AEROSPIKE_FEATURE_KEY_FILE=/etc/aerospike/features.conf
export AEROSPIKE_NSUP_PERIOD=0 # if AEROSPIKE_TTL is not 0, AEROSPIKE_NSUP_PERIOD should not be 0.

All AEROSPIKE_* parameters except AEROSPIKE_NODES, AEROSPIKE_MEM are optional. Default values are listed above. All other parameters are required.

NOTE: Feature key file is mandatory for running aerospike server enterprise edition.

Configuring Storage:

The statefulset definition refers to a custom StorageClass ssd. You can find the storageclass ssd definition in storageclass-aws.yaml or storageclass-gcp.yaml (Uncomment them to use). You can also define your own storageclass and use it within the statefulset definition.

Dynamic provisioning for local volumes are not supported yet. However, a local volume provisioner can be deployed to automate the provisioning of local devices. Please check examples/ for using a local volume static provisioner.

If you want to use the raw block volume mode, you need to define volumeMode as Block in the Volume Claim and use volumeDevices and devicePath instead of volumeMounts and mountPath as shown in the example below.

  volumeClaimTemplates:
  - metadata:
      name: data-dev
      labels: *AerospikeDeploymentLabels
    spec:
      volumeMode: Block
      accessModes:
        - ReadWriteOnce
      storageClassName: ssd
      resources:
        requests:
          storage: ${AEROSPIKE_MEM}Gi
.....
volumeMounts:
        - name: confdir
          mountPath: /etc/aerospike
volumeDevices:
        - name: data-dev
          devicePath: /dev/sdb
.....

For Kubernetes version > 1.11, there's a default storage class gp2 available on AWS EKS clusters, uses aws-ebs provisioner and volume type gp2.

Apply feature-key-file:

To apply feature-key-file, simply add the file to configs/ and create the ConfigMap. If using mounted volumes to apply the feature-key-file, you can use AEROSPIKE_FEATURE_KEY_FILE to specify the file path within the container.

Examples:

To view and run the examples, go to examples/

Deployment:

Please follow the below steps or run start.sh script:

  1. Expand manifest template:
cat manifests/* | envsubst > expanded.yaml
  1. Create the configmap object:
kubectl create configmap aerospike-conf -n $NAMESPACE --from-file=configs/
  1. Deploy:
kubectl create -f expanded.yaml

Helm Charts

Helm chart for the same can be found here

Requirements

  • Kubernetes 1.8+
  • Kubernetes DNS add-in

aerospike-kubernetes-enterprise's People

Contributors

abhishekdwivedi3060 avatar arrowplum avatar danielcoman avatar dmtr-vrd avatar ken-tune avatar mtendjou avatar spkesan avatar sud82 avatar tanmayja avatar volmarl avatar whyrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aerospike-kubernetes-enterprise's Issues

Need a means of passing pod annotations to the pods

In order to use things like the datadog integration for aerospike, we need to be able to put (and keep) annotations on the aerospike statefulset pods. With the operator managing the pods, it would be optimal to be able to add pod annotations to the AerospikeCluster spec which get applied to the pods of the statefulset that gets created by the kubernetes operator.

`helm lint` does not work since helm v3.7.0

helm v3.7.0 broke helm lint when leading dash are set at top of yaml document
cf helm/helm#10149 (comment)

$ helm lint helm
engine.go:180: [INFO] Fail: feature key file not provided!
==> Linting helm
[ERROR] templates/clusterrole.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: rbac.authorization.k8s.io/v1
[ERROR] templates/clusterrolebinding.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: rbac.authorization.k8s.io/v1
[ERROR] templates/serviceaccount.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: v1

Error: 1 chart(s) linted, 1 chart(s) failed

Removing leading dashs for clusterrole.yaml, clusterrolebinding.yaml, serviceaccount.yaml solves this issue

XDR Does not update IP addresses of nodes in the other cluster if they change

There are scenarios where the IP address (or the entire nodes) of a cluster might change. The aerospike instances get the list of IP's for the nodes, but do not track any changes. It would be preferable if either the list of IP's had a TTL, or if on failure to connect, it would check for an updated list of IP addresses. The instances currently need to be restarted to get an updated list of IP's to connect to.

While this might not be as important in a less ephemeral, static instance type environment, features as described above become more important moving into kubernetes.

"helm install aerospike/aerospike-enterprise" behind a proxy is not working

Hello,

I'm currently trying to deploy aerospike on my Kubernetes cluster with Helm but unfortunately I'm not able to make it work properly ๐Ÿ˜ž

The command I'm executing to run it is:

$ helm install aerospike-release --set-file featureKeyFilePath=feature.conf -n aerospike aerospike/aerospike-enterprise

It displays the following after the command:

NAME: aerospike-release
LAST DEPLOYED: Thu Jan 23 12:53:04 2020
NAMESPACE: aerospike
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing aerospike-enterprise-4.7.0.5.
Release Name - aerospike-release.
              __
             /  \
           /      \
         /    /\    \
        |    /  \    |
        |   /    \   |
   /\   |  | (  ) |  |   /\
  /  \  |  | (  ) |  |  /  \
 |----| |  |      |  | |----|
 |    | | /|   .  |\ | |    |
 |    | /  |   .  |  \ |    |
 |    /    |   .  |    \    |
 |  /      |   .  |      \  |
 |/        |   .  |        \|
/ AEROSPIKE|   .  |AEROSPIKE \
(          |      |           )     Launched!
 |    | |--|      |--| |    |
  /  \-----/  \/  \-----/  \
  \\//     \\//\\//     \\//
   \/       \/  \/       \/

Run the following commands to get more information about deployment:
  $ helm status aerospike-release
  $ helm get aerospike-release

But it never starts

$ kubectl get pods
NAME                                       READY   STATUS                  RESTARTS   AGE
aerospike-release-aerospike-enterprise-0   0/1     Init:CrashLoopBackOff   3          60s

If I look at the logs, I see that it is blocked because it is trying to run apt-get update in "helm/files/install.sh":

$ kubectl logs aerospike-release-aerospike-enterprise-0 --all-containers
installing aerospike.conf into /etc/aerospike
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Could not resolve 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not resolve 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Could not resolve 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Could not resolve 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not resolve 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package wget
/install.sh: line 41: wget: command not found
chmod: cannot access '/peer-finder': No such file or directory
/install.sh: line 49: /peer-finder: No such file or directory
Error from server (BadRequest): container "aerospike" in pod "aerospike-release-aerospike-enterprise-0" is waiting to start: PodInitializing

If I clone your repo and edit the script "helm/files/install.sh" to add the variables http_proxy, https_proxy and no_proxy like this:

$ cat helm/files/install.sh

# ...
mkdir -p "${CONFIG_VOLUME}"
#chown -R aerospike:aerospike "${CONFIG_VOLUME}"

export http_proxy="<proxy_url>"
export https_proxy="<proxy_url>"
export no_proxy="localhost,127.0.0.1,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12"

apt-get update && apt-get install -y wget
# ...

The helm install aerospike-release --set-file featureKeyFilePath=feature.conf -n aerospike ./helm is going one step further but then the pod "aerospike-release-aerospike-enterprise-1" seems to not be able to resolve my proxy address.

$ kubectl get pods
NAME                                       READY   STATUS     RESTARTS   AGE
aerospike-release-aerospike-enterprise-0   1/1     Running    0          2m33s
aerospike-release-aerospike-enterprise-1   0/1     Init:0/1   1          2m2s


$ kubectl logs aerospike-release-aerospike-enterprise-1 --all-containers
installing aerospike.conf into /etc/aerospike
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving '<proxy_url>'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving '<proxy_url>'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving '<proxy_url>'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving '<proxy_url>'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving '<proxy_url>'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving '<proxy_url>'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving '<proxy_url>'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving '<proxy_url>'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package wget
/install.sh: line 46: wget: command not found
chmod: cannot access '/peer-finder': No such file or directory
/install.sh: line 54: /peer-finder: No such file or directory
Error from server (BadRequest): container "aerospike" in pod "aerospike-release-aerospike-enterprise-1" is waiting to start: PodInitializing

My config:


$ helm version
version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.1", GitCommit:"d224476cd0730baca2b6e357d144171ed74192d6", GitTreeState:"clean", BuildDate:"2020-01-14T20:56:50Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

$ kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:17:50Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

$ docker version
Docker version 18.09.8, build 0dd43dd87f

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)

I am probably missing something in my configuration or doing something wrong but I'm stuck in this state.
Could you please help me to make this working, using the helm chart available on "https://aerospike.github.io/aerospike-kubernetes-enterprise" ? ๐Ÿ˜Š

Thanks for your help.

Alexis GEORGES

aerospike is in init state

helm install is successful with featureKeyFilePath. but the pods are in init state
root@ddeVM(~)$ kubectl get pods
NAME READY STATUS RESTARTS AGE
aerospike-release-aerospike-enterprise-0 0/1 Init:0/1 0 13m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.