This procedure installs an AWS EKS cluster and helm (tiller).
Warning: the cost is about $ 0.40 per hour.
- AWS account
- AWS AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
- boot a new Ubuntu 18.04 development station
- login as ubuntu user
- become root
- download and run https://raw.githubusercontent.com/pgomersbach/terraform-eks/master/scripts/bootstrap_dev.sh
- exit root
- export AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION for example in ~/.bash_profile
cd ~/terraform-eks
terraform init
terraform plan
terraform apply # and wait about ten minutes
kubectl get nodes --watch
kubectl get pods -n kube-system
sudo usermod -aG docker $USER
exec sg docker newgrp `id -gn`
docker login --username=yourhubusername
docker build -t pgomersbach/my-jenkins-image:1.1 jenkins/
docker push pgomersbach/my-jenkins-image
kubectl create -f jenkins/jenkins-deployment.yaml
kubectl create -f jenkins/jenkins-service.yaml
kubectl create clusterrolebinding default-admin --clusterrole cluster-admin --serviceaccount=default:default
kubectl get service jenkins
kubectl delete -f jenkins/jenkins-deployment.yaml
kubectl delete -f jenkins/jenkins-service.yaml
kubectl create -f artifactory/postgres-configmap.yaml
kubectl create -f artifactory/postgres-storage.yaml
kubectl create -f artifactory/postgres-deployment.yaml
kubectl create -f artifactory/postgres-service.yaml
kubectl create -f artifactory/artifactory-configmap.yaml
kubectl create -f artifactory/artifactory-storage.yaml
kubectl create -f artifactory/artifactory-deployment.yaml
kubectl create -f artifactory/artifactory-service.yaml
kubectl create -f postgres/postgres-configmap.yaml
kubectl create -f postgres/postgres-storage.yaml
kubectl create -f postgres/postgres-deployment.yaml
kubectl create -f postgres/postgres-service.yaml
kubectl get configmap
kubectl get persistentvolumeclaims
kubectl get persistentvolumes
kubectl get deployments
kubectl get pods
kubectl get services
POD=`kubectl get pods -l app=postgres | grep Running | grep 1/1 | awk '{print $1}'`
kubectl exec -it $POD bash
su postgres
psql
create database pxdemo;
\l
\q
pgbench -i -s 50 pxdemo;
psql pxdemo
\dt
select count(*) from pgbench_accounts;
\q
exit
exit
POD=`kubectl get pods -l app=postgres | grep Running | grep 1/1 | awk '{print $1}'`
kubectl delete pod ${POD}
kubectl exec -it $POD bash
su postgres
psql pxdemo
\dt
select count(*) from pgbench_accounts;
\q
exit
exit
kubectl create -f helm/jenkins-namespace.yaml
kubectl create -f helm/jenkins-volume.yaml
kubectl get namespace
kubectl get pv
helm install stable/jenkins -f helm/jenkins-values.yaml -f helm/jenkins-jobs.yaml --wait --name jenkins-master --namespace jenkins-project --timeout 600
helm ls --all
kubectl get pods --namespace=jenkins-project
kubectl --namespace=jenkins-project describe pod xxx
JENKINS_USER=$(kubectl get secret --namespace jenkins-project jenkins-master -o jsonpath="{.data.jenkins-admin-user}" | base64 --decode)
JENKINS_PASS=$(kubectl get secret --namespace jenkins-project jenkins-master -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode)
JENKINS_IP=$(kubectl get svc --namespace jenkins-project jenkins-master --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
JENKINS_PORT=$(kubectl get svc --namespace jenkins-project jenkins-master --output jsonpath={.spec.ports[*].port})
echo "${JENKINS_USER} ${JENKINS_PASS} http://${JENKINS_IP}:${JENKINS_PORT}"
helm search artifactory
helm inspect values jfrog/artifactory
helm inspect values jfrog/artifactory > values.yaml
# edit values.yaml,
### todo
# change ClusterIP to LoadBalancer
# nginx: enabled: false
helm install jfrog/artifactory -f values.yaml --name my-artifactory --namespace jenkins-project
helm delete --purge artifactory
helm delete --purge jenkins-master
terraform destroy # and wait about ten minutes