Table of Contents |
---|
...
Auto Continuous Deployment via Jenkins and Kibana
Requirements
Release | Kubernetes | Helm | Kubectl | Docker |
---|---|---|---|---|
Amsterdam | 1.7.x | 2.3.x | 1.7.x | 1.12.x |
Beijing/master | 1.8.x | 2.7.x | 1.8.x | 17.03-ce |
HD | 120G EBS | ||
CPU | 8-32 vCPU | ||
RAM | 64G |
Option 0: Deploy OOM Kubernetes to a spot VM
...
Code Block |
---|
obrien:obrienlabs amdocs$ ssh ubuntu@dev.onap.info ubuntu@ip-172-31-52-161:~$$ sudo apt install python-pip ubuntu@ip-172-31-52-161:~$$ pip install awscli --upgrade --user ubuntu@ip-172-31-52-161:~$$ aws --version aws-cli/1.14.41 Python/2.7.12 Linux/4.4.0-1041-aws botocore/1.8.45 |
Configurure Access Keys for your Account
Code Block |
---|
ubuntu@ip-172-31-52-161:~$ aws$aws configure AWS Access Key ID [None]: AK....Q AWS Secret Access Key [None]: Dl....l Default region name [None]: us-east-1 Default output format [None]: json ubuntu@ip-172-31-52-161:~$ aws$aws ec2 describe-regions --output table || ec2.ca-central-1.amazonaws.com | ca-central-1 || .... |
...
Allocate an EIP static public IP (one-time)
https://docs.aws.amazon.com/cli/latest/reference/ec2/allocate-address.html
Code Block |
---|
$aws ec2 allocate-address
{ "PublicIp": "35.172..", "Domain": "vpc", "AllocationId": "eipalloc-2f743..."} |
Create a Route53 Record Set - Type A (one-time)
...
Code Block |
---|
# request the usually cheapest $0.13 spot 64G EBS instance at AWS aws ec2 request-spot-instances --spot-price "0.25" --instance-count 1 --type "one-time" --launch-specification file://aws_ec2_spot_cli.json # don't pass in the the following - it will be generated for the EBS volume "SnapshotId": "snap-0cfc17b071e696816" launch specification json { "ImageId": "ami-c0c964ba", "InstanceType": "r4.2xlarge", "KeyName": "obrien_systems_aws_20141115", "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeType": "gp2", "VolumeSize": 120 } } ], "SecurityGroupIds": [ "sg-322c4842" ] } # results { "SpotInstanceRequests": [ { "Status": { "Message": "Your Spot request has been submitted for review, and is pending evaluation.", "Code": "pending-evaluation", |
...
Code Block |
---|
aws ec2 describe-spot-instance-requests --spot-instance-request-id sir-1tyr5etg "InstanceId": "i-02a653592cb748e2702a653592cb748e2x", |
Associate EIP with EC2 Instance
Can be done separately as long as it is in the first 30 sec during initialization and before rancher starts on the instance.
Code Block |
---|
aws$aws ec2 associate-address --instance-id i-02a653592cb748e2702a653592cb748e2x --allocation-id eipalloc-375c1d02375c1d0x { "AssociationId": "eipassoc-a4b5a293a4b5a29x" } |
Reboot EC2 Instance to apply DNS change to Rancher in AMI
Code Block |
---|
aws$aws ec2 reboot-instances --instance-ids i-02a653592cb748e2702a653592cb748e2x |
Kubernetes Installation via CloudFormation
...
Stop Spot Instance
Code Block |
---|
obrienbiometrics:aws michaelobrien$$ aws ec2 terminate-instances --instance-ids i-0040425ac8c0d8f630040425ac8c0d8f6x { "TerminatingInstances": [ { "InstanceId": "i-0040425ac8c0d8f63", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] } |
Verify Instance stopped
Video on Installing and Running the ONAP Demos#ONAPDeploymentVideos
...
I have created an AMI on Amazon AWS under the following ID that has a reference 20170825 tag of ONAP 1.0 running on top of Rancher
ami-b8f3f3c3 : onap-oom-k8s-10
...