Search This Blog

Tuesday 6 August 2019

Kubernetes basic installation and how to check cluster is running or not.

Kubernetes:
yum update -y

sestatus (status for selinux)
cat  /etc/sysconfig/selinux (disable selinux)
SELINUX = disable

systemctl disable firewalld (disable firewall)
yum remove chrony -y
yum install ntp -y
systemctl enable ntpd.service
systemctl start ntpd.service

/etc/hosts
master server(IP address)
node1 server (IP address)
node2 server (IP address)
validate the kubernetes master and nodes each other
ping master
ping node1
ping node2

On the Master Node following components will be installed
API Server         – It provides kubernetes API using Jason / Yaml over http, states of API objects are                                 stored in etcd
Scheduler          – It is a program on master node which performs the scheduling tasks like launching                                 containers in worker nodes based on resource availability
Controller Manager – Main Job of Controller manager is to monitor replication controllers and create                                     pods to maintain desired state.
etcd               – It is a Key value pair data base. It stores configuration data of cluster and cluster state.
Kubectl utility    – It is a command line utility which connects to API Server on port 6443. It is used                                 by administrators to create pods, services etc.

On Worker Nodes following components will be installed
Kubelet            – It is an agent which runs on every worker node, it connects to docker  and takes care                             of creating, starting, deleting containers.
Kube-Proxy     – It routes the traffic to appropriate containers based on ip address and port number                                 of the incoming request.
                            In other words we can say it is used for port translation.
Pod                  – Pod can be defined as a multi-tier or group of containers that are deployed on a                                    single worker node or docker host.


vim /etc/yum.repo.d/kubernetes
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
        https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
 
 
 
 yum install -y kubelet kubeadm  docker kubectl

 start docker kubelet
 systemctl start docker ;
 syatemctl enable docker;

 systemctl start kubelet;
 syatemctl enable kubelet;
 sysctl -p

kubadm init --pod-network-cidr=172.30.0.0/16

         After install it will show you to create folder just run those commands.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

 goto node1
 ssh to master
 docker images
 docker -ps

        To check cluster is running or not
kubectl get nodes
kubectl get pods (to check is any pods are running or not)
kubectl get pods --all-namespaces

goto gihub/flannel copy the link and paste it in master
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

kubectl get pods --all-namespaces
kubectl get nodes

Bugzilla to cloud jira using local jira server



                                                                APPROACH -1

                        BUGZILLA TO CLOUD JIRA MIGRATION

·         Take backup from cloud Jira

1.      Convert all the next-gen projects to classic projects (As Below Step).

Note: Make sure before taking backup convert all the projects to classic.

2.      Create a backup for Jira Cloud

3.      To create a backup for cloud: Goto > Jira settings > System

4.      Click on IMPORT AND EXPORT section, click Backup manager.

5.      Under Backup for cloud, select Create backup for cloud.

6.      Tick the Include additional files option if you want to include issue attachments, user avatars, and project logos in the export.

7.      After the backup is complete, select Download backup file.

Note: Before click on backup make sure convert all Next-gen projects to class

·         Convert all the next-gen projects to classic projects

1.      create a new project, while creating select classic option and Scrum (or) Kanban type (Select Create project > Classic project > Kanban).

2.      After creating classic project, Goto > settings > system > Import&Export > backup option in Jira then you can see all next-gen projects. here for every project it will show two options move issues & delete project.

3.      Click on move issues it will redirect to new page with multiple options.

4.      Select Move Issues option and hit Next.

5.      Now select the project and issue type then map the project to newly created classic project and map the issue type as the project. (On the Select Projects and Issue Types screen, you'll need to select where the issues from your old project will go. Select a destination project and issue type and hit Next. This is the issue type that each issue in your old project will become in the new project.)

6.      On the final screen, click Confirm.

7.      Things to keep in mind if you migrate from next gen to classic

a.      Reports: Reports data won't be saved. Even though your issues will be retained, data for your project's Velocity and Burnup reports won't transfer over and will be lost.

b.      Story points estimation: This data will be lost. This is because the custom field that Jira uses to store estimates in classic projects (Story points) is different to the custom field used in next-gen projects (Story point estimate).

8. Things to keep in mind if you migrate from classic to next-gen

a.      Next-gen projects and classic projects are technically quite different, so a few things can break when you migrate from a classic software project to a next-gen software project. Here's what we know so far:

b.      Active sprints: Sprints in progress in your classic project won't move to your next-gen project. Issues that were in the active sprint in your classic project will be in the backlog of your next-gen project.

c.       Epic links: Links between epics and other issues (Story, Bugs, Tasks, etc...) in your classic project won't exist in your next-gen project. The issues themselves will still exist, but the links between them won't.

d.      Custom fields: These must be recreated in your new next-gen project.

e.      Story points estimation: This data will be lost. however, you'll be able to start using story points estimation by enabling the Estimation feature in your next-gen project.

f.        Reports: Data for your project's Velocity report won't be saved. The Velocity report will show that no points were completed in past sprints.

g.      Report history: All reporting history is lost in this migration process. The Burnup report and Velocity report won't be migrated.

9.      After the backup is complete, select Download backup file.

10.  This is the structure of backup.zip file

                                                JIRA-backup.zip file

·         activeobjects.xml

·         entities.xml

·         data

a.      attachments

b.      avatars

·         logos

Note: For instances with large backups (2GB or larger), we recommend importing any attachments separately. To do this:

·         Unzip your Jira Cloud backup file.

·         Move data and logos folder into a safe place.

·         Recompress the backup folder with the activeobjects.xml and entities.xml files only.

·         Restore to local Jira server

1.      Choose > Settings > System.

2.      Select Import & Export > Restore System to open the Restore Jira applications data from Backup page.

3.      Copy the backup.zip file to Jira path (/var/Atlassian/application-data/Jira/import).

4.      Now on the filename just give backup filename that you saved or copied to that Jira path.

5.      Mention the license key of local Jira server (Goto > settings > select Applications > select Versions&Licence).

6.      Copy the license key and disable the outgoing mail option and click restore.

7.      If you are unzip the backup file and just restore the both .xml files then place the Attachments, Avatars and Logos to the directory where Jira can access them.
            8.      All the Attachments, Logos and Avatars you can directly copy those folders to below  

                   mentioned paths.

9.      PATHS: (Make sure that Jira has read and write permissions to this directory and its subdirectories.)
/var/Atlassian/application-data/Jira/data
/var/Atlassian/application-data/Jira/data/attachments
/var/Atlassian/application-data/Jira/data/avatars
/var/Atlassian/application-data/Jira/Logos

10.  Once everything is done restart local Jira and MySQL.

11. Log into your new Jira Server instance and change the password

12. Log in to your new Jira product, using the following credentials:

                                                              i.      Username: sysadmin

                                                             ii.      Password: sysadmin

13. Change the password immediately after logging in.

·         Import all the Bugzilla projects to local Jira using Bugzilla plugin

14.  Log in to JIRA

15.  Choose > settings > System > Select Import & Export > External System Import to open the Import external projects page.

16.  Select Bugzilla Plugin to open the Bugzilla Import Wizard.

17.  On the Bugzilla Import Wizard: Setup page, complete the following fields/options:
Bugzilla URL:
Specify credentials:
Database type:
Hostname:
Port:
Database:
Username:
Password:

18.  Click the Next button to proceed to the Setup project mappings step of the Bugzilla Import Wizard.

19.  On the Setup project mappings page, select which Bugzilla projects you wish to import into JIRA.

20.  Select the project from Bugzilla to import in Jira (here you can create new project name or choose existing project name).

21.  Click Next to map the custom fields and then map their values and click next.

22.  Once mapping is done click on Begin Import.

23.  After import, if you face any error just click on Download a detailed log then you can all the process and you can easily figure out the error.

·         Take the backup of local Jira server

24.  So, now all the  Jira cloud data and Bugzilla data are in local Jira server.

25.  Goto > settings > systems > import-export > backup.

26.  It will show you the filename option:

27.  Just mention filename (give any new name) it will create that file in Export directory.

28.  If you Goto this path (/var/Atlassian/application-data/Jira/export) you can see the backup file.




Now, backup file is ready then get attachments, avatars, logs from local Jira path  related folders then zip all the folders make as one zip file then upload that file to restore in  cloud Jira.


·         Restore backup file to cloud Jira

29.  Login to cloud Jira and choose > settings > system > import-export > restore.

30.  Download the final backup file from local Jira and upload to cloud jira to start restoring.

 Troubleshoot process for the errors while we faced in migration:

Ø  If you are facing this error while the process of uploading the backup file.

Ø  Rename the file with out any spaces or special characters then try again.




Ø  Java Heap Space Error:



Guidance:

1.      40,000 issues will import at a time by using space of 1GB.

2.      So, STO having around 1,40,000 issues. We increased the java heap space to around 8GB so that we can import all the projects at one go.

To increase heap space memory in Linux installations:

1.      In your <JIRA application installation directory>/bin (or <Tomcat Installation Directory>/bin for JIRA WAR installations), open the setenv.sh file.

2.      Find the sections JVM_MINIMUM_MEMORY= 

 JVM_MAXIMUM_MEMORY=