-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSteps for Python-RestAPI Pipeline
More file actions
98 lines (66 loc) · 3.6 KB
/
Steps for Python-RestAPI Pipeline
File metadata and controls
98 lines (66 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
### Implementation Steps
1. Jenkins Installation and Configuration - jenkins server1
- Deployed jenkins server as an azure vm via terraform that uses a remote-exec provisioner for automation / bootstrapping
- Generate ssh key pair on local machine ( done before deploying jenkins )
ssh-keygen -m PEM -t rsa -b 4096
Location of key pair: under C:\Users\The Cosmos\.ssh
To view these files:
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa
Login: Rahul using private key .ppk
===========================================================================================================================================================
2. Create ACR and AKS Cluster via terraform
=========================================================================================================================================================
3. HELM Installation and Configuration ( for jenkins user )
su - jenkins
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
Verify:
jenkins@jenkins-server1:~$ helm version
version.BuildInfo{Version:"v3.10.0", GitCommit:"ce66412a723e4d89555dc67217607c6579ffcb21", GitTreeState:"clean", GoVersion:"go1.18.6"}
> Configure HELM
jenkins@jenkins-server:~$ mkdir .kube
jenkins@jenkins-server:~$ cd .kube
jenkins@jenkins-server:~/.kube$ pwd
jenkins@jenkins-server:~/.kube$ vi config
jenkins@jenkins-server:~/.kube$ chmod 600 config
jenkins@jenkins-server:~/.kube$ helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
=========================================================================================================================================================
4. Creating a helm chart for python restapi
### Creating a helm chart called python-restapi-chart under /var/lib/jenkins ie home dir of jenkins user ( created by default post installation )
1. Create a folder structure
jenkins@jenkins-server1:~$ helm create test
jenkins@jenkins-server1:~$ cd test/
jenkins@jenkins-server1:~/test$ ls -l
total 16
-rw-r--r-- 1 jenkins jenkins 1140 Sep 26 20:27 Chart.yaml
drwxr-xr-x 2 jenkins jenkins 4096 Sep 26 20:27 charts
drwxr-xr-x 3 jenkins jenkins 4096 Sep 26 20:27 templates
-rw-r--r-- 1 jenkins jenkins 1871 Sep 26 20:27 values.yaml
jenkins@jenkins-server1:~/test$ cd templates/
jenkins@jenkins-server1:~/test/templates$ ls -l
total 32
-rw-r--r-- 1 jenkins jenkins 1735 Sep 26 20:27 NOTES.txt
-rw-r--r-- 1 jenkins jenkins 1752 Sep 26 20:27 _helpers.tpl
-rw-r--r-- 1 jenkins jenkins 1821 Sep 26 20:27 deployment.yaml
-rw-r--r-- 1 jenkins jenkins 907 Sep 26 20:27 hpa.yaml
-rw-r--r-- 1 jenkins jenkins 2073 Sep 26 20:27 ingress.yaml
-rw-r--r-- 1 jenkins jenkins 352 Sep 26 20:27 service.yaml
-rw-r--r-- 1 jenkins jenkins 314 Sep 26 20:27 serviceaccount.yaml
drwxr-xr-x 2 jenkins jenkins 4096 Sep 26 20:27 tests
2. Edit the name parameter in Chart.yaml to python-restapi-chart
jenkins@jenkins-server1:~/test$ cat Chart.yaml | grep name
name: python-restapi-chart
3. View helm chart
jenkins@jenkins-server1:~$ helm show chart test
apiVersion: v2
appVersion: 1.16.0
description: A Helm chart for Kubernetes
name: python-restapi-chart
type: application
version: 0.1.0
=========================================================================================================================================================
5. Follow word document to setup the pipelines
=========================================================================================================================================================