Guest User

Untitled

a guest
Aug 23rd, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. This documentation is created as a guide to launch Accenture DevOps Platform Tools in an OpenShift cluster.
  2.  
  3. **Installation Variables Setup**
  4.  
  5. Create a shell executable file and enter the following information. This will set the variables that will be use across all container deployments in this Documentation. Change the values accordingly specially the passwords.
  6.  
  7. ```bash
  8. export INITIAL_ADMIN_USER=adop
  9. export INITIAL_ADMIN_PASSWORD_PLAIN=adop
  10. export INITIAL_ADMIN_PASSWORD_BASE64=$(echo ${INITIAL_ADMIN_PASSWORD_PLAIN} | base64)
  11. export JENKINS_PASSWORD_PLAIN=jenkins
  12. export JENKINS_PASSWORD_BASE64=$(echo ${JENKINS_PASSWORD_PLAIN} | base64)
  13. export GERRIT_PASSWORD_PLAIN=gerrit
  14. export GERRIT_PASSWORD_BASE64=$(echo ${GERRIT_PASSWORD_PLAIN} | base64) # we are not using gerrit in this guide
  15. export SONARQUBE_JDBC_USERNAME=sonar
  16. export SONARQUBE_JDBC_PASSWORD=sonar
  17. export SONARQUBE_MYSQL_ROOT_PASSWORD=sonar
  18. export GITLAB_POSTGRESQL_USER=gitlab_postgres
  19. export GITLAB_POSTGRESQL_PASSWORD=gitlab_postgres
  20. export GITLAB_POSTGRESQL_ADMIN_PASSWORD=gitlab_postgres
  21. export GITLAB_ROOT_PASSWORD=admin123
  22. export LDAP_SERVER="YOUR_LDAP_SERVER_IP"
  23. export LDAP_PORT="389"
  24. export SLAPD_DOMAIN=ldap.adop.com
  25. export SLAPD_FULL_DOMAIN="dc=ldap,dc=adop,dc=com"
  26. export SLAPD_PASSWORD="<YOUR_PASSWORD>"
  27. export SUB_DOMAIN="apps.<YOUR_EC2IP>.xip.io"
  28. export NFS_SERVER="<YOUR_NFS_SERVER_IP>"
  29. export SERVICE_ACCOUNT="adop"
  30. export GITLAB_SERVICE_ACCOUNT="gitlab"
  31. export NAMESPACE="adop"
  32. ```
  33.  
  34. Source the shell executable file using the following command:
  35.  
  36. ```bash
  37. source <YOUR_SH_FILE>
  38. ```
  39.  
  40. **Create an OpenShift project**
  41.  
  42. The project or namespace name will be $NAMESPACE. After this step, all deployments of docker containers should be done in this openshift project.
  43.  
  44. ```bash
  45. oc new-project $NAMESPACE
  46. oc project $NAMESPACE
  47. ```
  48.  
  49. **Create a Service Account**
  50.  
  51. Create Service Account Resource configuration file.
  52.  
  53. ```bash
  54. cat > serviceAccount.yml <<-EOF
  55. apiVersion: v1
  56. kind: ServiceAccount
  57. metadata:
  58. name: $SERVICE_ACCOUNT
  59. EOF
  60. ```
  61. Create the service account named `adop`
  62.  
  63. ```bash
  64. oc create -f serviceAccount.yml
  65. ```
  66.  
  67. Check the service account using `oc get sa`.
  68.  
  69. Add the privilege to run as `anyuid` to `$SERVICE_ACCOUNT`.
  70.  
  71. ```bash
  72. oc adm policy add-scc-to-user anyuid -z $SERVICE_ACCOUNT
  73. ```
  74.  
  75. ## NFS
  76.  
  77. All the persistent storage of docker containers will be stored on an NFS mounted devices. In this guide the directory that will be used is /openshift_nfs/ and NFS server is $NFS_SERVER.
  78.  
  79. Ensure that NFS is started.
  80.  
  81. ```bash
  82. systemctl start nfs
  83. ```
  84. Ensure that SELinux allows writing to exported directories.
  85.  
  86. ```bash
  87. setsebool -P virt_use_nfs 1
  88. setsebool -P virt_sandbox_use_nfs 1
  89. ```
  90. Ensure that the NFS server allows server traffic.
  91.  
  92. ```bash
  93. # for NFSv4 and NFSv3
  94. iptables -I INPUT 1 -p tcp --dport 2049 -j ACCEPT
  95. # for NFSv3 only
  96. iptables -I INPUT 1 -p tcp --dport 20048 -j ACCEPT
  97. iptables -I INPUT 1 -p tcp --dport 111 -j ACCEPT
  98. ```
Add Comment
Please, Sign In to add comment