updated readme

This commit is contained in:
jainish shah
2018-04-18 21:14:50 -07:00
parent 40e4d4bd72
commit 44afee3652
2 changed files with 59 additions and 64 deletions

View File

@@ -48,6 +48,7 @@
### Note:
1. This template only supports Artifactory version 5.8.x and above.
2. Turn off daily backups. Read the [Documentation](https://www.jfrog.com/confluence/display/RTF/Managing+Backups).
**Note**: In this template as default S3 is default filestore and data is persisted in S3. If you keep daily backups on disk space (default 250Gb) will get occupied quickly.
3. Use an SSL Certificate with a valid wild card to use Artifactory as a Docker registry using the subdomain method.
### Steps to setup Artifactory as a secure Docker Registry

View File

@@ -1,88 +1,82 @@
# Terraform Template For Artifactory Enterprise
### Prerequisites:
* AWS account
* Basic knowledge to AWS
* Pre created Keys
* An AWS account
* Basic knowledge of AWS
* Predefined Keys
* Basic knowledge of Artifactory
* Learn about [system requirements for Artifactory](https://www.jfrog.com/confluence/display/RTF/System+Requirements#SystemRequirements-RecommendedHardware)
* Learn more about Terraform AWS provider follow: https://www.terraform.io/docs/providers/aws/index.html
### Steps to Deploy Artifactory Enterprise using Terraform template
1. Set your AWS account credentials.
Easy way to do it is by setting environment variables.
### Steps to Deploy Artifactory Enterprise Using Terraform Template
1. Set your AWS account credentials by setting environment variables:
```
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_DEFAULT_REGION="aws_region"
```
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_DEFAULT_REGION="aws_region"
```
To learn more about Terraform aws provider follow there documentation.
https://www.terraform.io/docs/providers/aws/index.html
2. Make Changes in `variables.tf` file to change default values to desired once. Also pass Artifactory Enterprise licenses as string in Variables `artifactory_license_1-5`."
e.g Change disk space to 500Gb:
2. Modify the default values in the `variables.tf` file
3. Pass the Artifactory Enterprise licenses as a string in the variables `artifactory_license_1-5`.
For example: Change disk space to 500Gb:
```
variable "volume_size" {
description = "Disk size for each EC2 instances"
default = 500
}
variable "volume_size" {
description = "Disk size for each EC2 instances"
default = 500
}
```
4. Run the `terraform init -var 'key_name=myAwsKey'` command. This will install the required plugin for the AWS provider.
3. Run command `terraform init -var 'key_name=myAwsKey'`
This is install required plugin for AWS provider.
5. Run the `terraform plan -var 'key_name=myAwsKey'` command.
4. Run command `terraform plan -var 'key_name=myAwsKey'`.
6. Run the `terraform apply -var 'key_name=myAwsKey'` command to deploy Artifactory Enterprise cluster on AWS
5. Run command `terraform apply -var 'key_name=myAwsKey'` to deploy Artifactory Enterprise cluster on AWS.
**Note**: it takes approximately 15 minutes to bring up the cluster.
It will take approximately 15 min to bring up cluster.
7. You will receive ELB Url to access Artifactory. By default, this template starts only one node in the Artifactory cluster.
It takes 7-10 minutes for Artifactory to start and to attach the instance to the ELB.The output can be viewed as:
```
Outputs:
You will get ELB Url to access Artifactory.By default This template will start only 1 node in Artifactory cluster.
It takes 7-10 minutes for Artifactory to start and attach instance to ELB.
```
Outputs:
address = artifactory-elb-265664219.us-west-2.elb.amazonaws.com
address = artifactory-elb-265664219.us-west-2.elb.amazonaws.com
```
6. Access Artifactory UI using ELB Url provided in outputs.
7. Scale your cluster using following command:
`terraform apply -var 'key_name=myAwsKey' -var 'secondary_node_count=2'`
8. Access the Artifactory UI using ELB Url provided in outputs.
9. Scale your cluster using following command: `terraform apply -var 'key_name=myAwsKey' -var 'secondary_node_count=2'`
In this example we are scaling artifactory cluster to 2 nodes.
Note: You can only scale nodes to number of artifactory licenses you have available for cluster.
**Note**: You can only scale nodes to number of artifactory licenses you have available for cluster.
8. SSH into Artifactory primary instance and write [inactiveServerCleaner](inactiveServerCleaner.groovy) plugin in '/var/opt/jfrog/artifactory/etc/plugins' directory.
9. Command to destroy cluster:
`terraform destroy -var 'key_name=myAwsKey'`
10. SSH into Artifactory primary instance and type [inactiveServerCleaner](inactiveServerCleaner.groovy) plugin in `'/var/opt/jfrog/artifactory/etc/plugins'` directory.
(Optional) To destroy the cluster, run the following commend: `terraform destroy -var 'key_name=myAwsKey'`
### Note:
1. This template only supports Artifactory version 5.8.x and above.
2. Turn off daily backups. Read Documentation provided [here](https://www.jfrog.com/confluence/display/RTF/Managing+Backups)
3. Use SSL Certificate with valid wild card to you artifactory as docker registry with subdomain method.
* This template only supports Artifactory version 5.8.x and above.
* Turn off daily backups. Read Documentation provided [here](https://www.jfrog.com/confluence/display/RTF/Managing+Backups).
**Note**: In this template as default S3 is default filestore and data is persisted in S3. If you keep daily backups on disk space (default 250Gb) will get occupied quickly.
* Use an SSL Certificate with a valid wildcard to your artifactory as docker registry with subdomain method.
### Steps to setup Artifactory as secure docker registry
considering you have SSL certificate for `*.jfrog.team`
Considering you have SSL certificate for `*.jfrog.team`
1. Pass your SSL Certificate in variable `ssl_certificate` as string
2. Pass your SSL Certificate Key in variable `ssl_certificate_key` as string
3. Set `certificate_domain` as `jfrog.team`
4. Set `artifactory_server_name` as `artifactory` if you want to access artifactory with `https://artifactory.jfrog.team`
5. Create DNS for example Route53 with entry `artifactory.jfrog.team` pointing to ELB value provided as output in CloudFormation Stack.
6. Create DNS for example Route53 with entry `*.jfrog.team` pointing to ELB value provided as output in CloudFormation Stack.
7. If you have virtual docker registry with name `docker-virtual` in artifactory. You can access it via `docker-virtual.jfrog.team`
e.g ```docker pull docker-virtual.jfrog.team/nginx```
5. Create DNS for example Route53 with entry `artifactory.jfrog.team` pointing to ELB value provided as output in Terraform Stack.
6. Create DNS for example Route53 with entry `*.jfrog.team pointing` to ELB value provided as output in Terraform Stack.
7. If you have virtual docker registry with name `docker-virtual` in artifactory. You can access it via `docker-virtual.jfrog.team` e.g `docker pull docker-virtual.jfrog.team/nginx`
### Steps to upgrade Artifactory Version
1. Change value of `artifactory_version` from old version to new Artifactory version you want to deploy.
for e.g. 5.8.1 to 5.8.2
Run command `terraform apply -var 'key_name=myAwsKey' -var 'secondary_node_count=2' -ver 'artifactory_version=5.8.2'`.
1. Change the value of `artifactory_version` from old version to new Artifactory version you want to deploy. for e.g. `5.8.1` to `5.8.2`.
2. You will see instances will get upgraded one by one. Depending on your cluster size it will take 20-30 minutes to update stack.
2. Run command `terraform apply -var 'key_name=myAwsKey' -var 'secondary_node_count=2' -ver 'artifactory_version=5.8.2'`.
You will see instances will get upgraded one by one. Depending on your cluster size it will take 20-30 minutes to update stack.
### Use Artifactory as backend
To to store state as an artifact in a given repository of Artifactory follow documentation provided at [https://www.terraform.io/docs/backends/types/artifactory.html](https://www.terraform.io/docs/backends/types/artifactory.html)
To to store state as an artifact in a given repository of Artifactory, see [https://www.terraform.io/docs/backends/types/artifactory.html]()