Alpaca Eureka Configuration

This guide details all configurations that are available within the Alpaca Eureka. All configurations can be used in the application-prod.yml file located in the /etc/alpaca/eureka/config.

Any changes made while Eureka is running will not take effect until after a restart. Use the following command to restart Eureka - alpacactl eureka resstart.

YAML (YAML Ain't Markup Language)

All Alpaca configurations are in the YAML (.yml) format.

Basic Rules

  • YAML is case-sensitive.
  • YAML does not allow the use of tabs. Spaces are used instead as tabs are not universally supported.
  • A dictionary is represented in a simple key: value form (the colon must be followed by a space):

        alpaca:
            migration:
              announcementRepositoryUsername: "BoNjOuRlEsAmIs049"
              announcementRepositoryPassword: "viveLEROILouis14"
              htmlEncodeExports: true
    
  • All members of a list are lines beginning at the same indentation level starting with a - (a dash and a space):

      broadworks:
        profileServer:
        - cluster: Production
          fileRepo: ProfileServer
          username: fileadmin
          password: P@ssw0rd
        - cluster: Lab
          fileRepo: ProfileServer
          username: fileadmin
          password: P@ssw0rd
    
  • Comments are denoted by #.

      # Alpaca Configuration
      alpaca:
          # Migration Configuration
          migration:
            announcementRepositoryUsername: "BoNjOuRlEsAmIs049"
            announcementRepositoryPassword: "viveLEROILouis14"
            htmlEncodeExports: true
    

Full Documentation

Complete YAML documentation can be found here.

Example Configuration

This sample configuration is meant as a guide only. Do not copy and paste the entire content into your configuration.

Configuration using AWS S3 or MinIo for cloud configuration

Full AWS S3 and MinIo examples can be found here.

server:
  port: 8761
spring:
  cloud:
    config:
      server:
        prefix: /config
        awss3:
          region: us-east-1
          bucket: alpaca # Bucket name when using AWS S3, subdomain of MinIo server when using MinIo
          endpoint: https://my-minio.acme.com:9000
        default-label: config # Bucket name when using MinIo. Not use for AWS S3. 
    security:
      user:
        name: alpaca
        password: alpaca
        roles: USER
eureka:
  instance:
    hostname: eureka
  client:
    registerWithEureka: true
    fetchRegistry: false
    service-url:
      defaultZone: http://alpaca:alpaca@eureka2:8761/eureka
logging:
  file:
    name: ${logging.file.path}/alpaca-eureka.log
    path: /var/log/alpaca
    max-history: 60

Configuration using local file storage for cloud configuration (non-HA)

server:
  port: 8761
spring:
  cloud:
    config:
      server:
        prefix: /config
        native:
          search-locations: file:///etc/alpaca/eureka/cloud-config
    security:
      user:
        name: alpaca
        password: alpaca
        roles: USER
eureka:
  instance:
    hostname: eureka
  client:
    registerWithEureka: true
    fetchRegistry: false
    service-url:
      defaultZone: http://alpaca:alpaca@eureka2:8761/eureka
logging:
  file:
    name: ${logging.file.path}/alpaca-eureka.log
    path: /var/log/alpaca
    max-history: 60

Server (server)

  • port: The TCP port on which to run the Eureka server.

Spring Cloud Config Server (spring.cloud.config.server)

  • prefix: This is the path that all Alpaca Servers will access the centralized configuration. This defaults to /config.
  • security.user.name: This is the username that the Alpaca Server will include in the request to retrieve the centralized configuration.
  • security.user.password: This is the password that the Alpaca Server will include in the request to retrieve the centralized configuration.
  • security.user.roles: These are the roles assigned to the user on login. This should remain USER as default.
  • default-label: This is the default directory to locate centralized configurations. When using Minio this is used as the name of the bucket.
  • native.search-locations: List of locations to look for the Alpaca Server configuration (alpaca-server-prod.yml).

AWS S3 (awss3)

When using an S3 compatible storage for centralized configuration the awss3 profile must be entered into the alpaca_config script in /etc/sysconfig.

  • region: The region of the S3 storage.
  • bucket: The name of the bucket if using AWS. If using Minio this will be subdomain of the Minio server.
  • endpoint: This is the endpoint of the S3 storage system. This is necessary when using Minio but can be excluded with AWS.

Eureka (eureka)

  • instance.hostname: This is a comma separated list of additional Eureka URLs to register with. This allows clustering of Eureka nodes for service discovery.
  • client.registerWithEureka - Indicates whether this instance should register its information with the Eureka server for discovery by others. This defaults to true.
  • client.fetchRegistry - Controls whether this client is going to try to connect to the Eureka server(s) in order to download the information on other services' endpoint. It can do so without registering itself. Defaults to false.

Logging (logging)

  • file.path: The location to write the gateway log. This defaults to /var/log/alpaca. Rotation and file naming are configured in the logback-spring.xml file.

Profiles

  • prod: This is the primary configuration for production.
  • native: Enables local file storage for Alpaca Server configuration (non-HA).
  • awss3: Enables S3 Bucket support for Alpaca Server configuration.

Profile selection can be done in the /etc/sysconfig/alpaca_config file.

Examples

MinIo

  • Formula: {endpoint.scheme}://{bucket}{endpoint.url}:{endpoint.port}/{default-label}
  • Example Minio URL - https://sample-minio.acme.com:9000/my-bucket
  • Configuration yaml spring: cloud: config: server: prefix: /config # Always /config awss3: region: us-east-1 bucket: sample-minio # For MinIo, the bucket configuration is the subdomain of the MinIo url. endpoint: https://acme.com:9000 default-label: my-bucket # For MinIo, the default-label is the name of the bucket security: user: name: alpaca password: alpaca roles: USER

MinIo

  • Formula: {endpoint.scheme}://{bucket}{endpoint.url}:{endpoint.port}/{default-label}
  • Example Minio URL - https://sample-minio.acme.com:9000/my-bucket
  • Configuration yaml spring: cloud: config: server: prefix: /config # Always /config awss3: region: us-east-1 bucket: sample-minio # For MinIo, the bucket configuration is the subdomain of the MinIo url. endpoint: https://acme.com:9000 default-label: my-bucket # For MinIo, the default-label is the name of the bucket security: user: name: alpaca password: alpaca roles: USER

AWS S3

  • Formula: {endpoint.scheme}://{bucket}{endpoint.url}:{endpoint.port}/{default-label}
  • Example S3 URL - https://s3.amazonaws.com/my-bucket
  • Configuration yaml spring: cloud: config: server: prefix: /config # Always /config awss3: region: us-east-1 # Should match the region that the AWS bucket is located in bucket: my-bucket # The bucket name endpoint: https://s3.amazonaws.com security: user: name: alpaca password: alpaca roles: USER

Testing

Eureka's access to the Alpaca configuration store in an S3 bucket can be tested using the following cUrl command on the Alpaca server:

curl -v http://<EUREK_USERNAME>:<EUREKA_PASSWORD>@localhost:8761/config/alpaca-server-prod.yml

  • The username and password can be found in the Eureka config (/etc/alpaca/eureka/config/application-prod.yml)
  • If the command returns the uploaded config, everything is working correctly.
  • If the command returns a 200, but an empty body, Eureka is running but is unable to access the file within the bucket. Check the Eureka logs for more details.
  • If the command returns something other than a 200, Eureka is not running.