How to customize the AWS S3 backups for your Master to use your own endpoints via Cluster Operation

Issue

  • How to customize the AWS S3 backups for your Master to use your own endpoints?
  • I would like to create a Cluster Operation for backup my Masters to custom endpoints

Environment

Resolution

1.- Get the endpoints.json compatible with your AWS plugin( looking into the tag for the version) to get the version tag of the aws-java-sdk plguin run the following script in the Jenkins Script Console:

def plugin = Jenkins.instance.pluginManager.plugins.find{it.getShortName() == 'aws-java-sdk'}

if (plugin){
  println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}")
} else {
  println ("aws-java-sdk is not installed in this instance")
}

2.- Customize as explained here. A valid example would be:

{
   "partitions" :
   [
       {
           "defaults" : {
               "hostname" : "{service}.{region}.{dnsSuffix}",
               "protocols" : [ "http" ],
               "signatureVersions" : [ "v4" ]
           },
           "dnsSuffix" : "cloudstorage.corp",
           "partition" : "CCC",
           "partitionName" : "Example storage",
           "regionRegex" : "*",
           "regions" : {
               "example-region" : {
                   "description" : "example scality endpoint"
               }
           },
           "services" : {
               "s3" : {
                   "defaults": {
                       "protocols": [
                           "http",
                           "https"
                       ],
                       "signatureVersions": [
                           "s3",
                           "s3v4"
                       ]
                   },
                   "endpoints" : {
                       "example-region" : {
                           "hostname": "s3.example.cloudstorage.corp"
                       }
                   }
               }
           }
       }
   ],
   "version" : 3
}

3.- Create the CLASSPATH_HOME folder to override endpoints.json and place your custom file there, com/amazonaws/partitions/override/endpoints.json for your Operation Ceneter as well as the Masters to backup.

$> mkdir -p $JENKINS_HOME/classpath/com/amazonaws/partitions/override/
$> CLASSPATH_HOME="$JENKINS_HOME/classpath"
$> mv endpoints.json $JENKINS_HOME/classpath/com/amazonaws/partitions/override/

4.- Add to the JAVA Properties -Xbootclasspath/a:$CLASSPATH_HOME to the Operations Center as well as every Master.

5.- Create a Cluster Operation job, go to the Build section and add a Take Backup step, specifying Amazon S3 for Where to back up? and finally example-region must be shown as option.

Cluster Operation AWS Backup

Tested product/plugin versions

The latest update of this article has been tested with:

References

Have more questions?

0 Comments

Please sign in to leave a comment.