-
Notifications
You must be signed in to change notification settings - Fork 0
/
allscript
195 lines (195 loc) · 4.49 KB
/
allscript
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
kubectl create ns jenkins
touch pv.yaml
chmod 777 pv.yaml
echo "apiVersion: v1
kind: PersistentVolume
metadata:
name: pvvol1
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
nfs:
server: 35.231.233.210
path: "/var/nfs/general" " >> pv.yaml
touch pvc.yaml
chmod 777 pvc.yaml
echo "apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvcvol1
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 500Mi" >> pvc.yaml
touch jenkins-deployment.yaml
chmod 777 jenkins-deployment.yaml
echo "apiVersion: extensions/v1beta1 # for versions before 1.7.0 use apps/v1beta1
kind: Deployment
metadata:
name: jenkins-vol2
namespace: jenkins
spec:
replicas: 1
selector:
matchLabels:
app: jenkinsvol1
template:
metadata:
labels:
app: jenkinsvol1
spec:
containers:
- name: jenkins
image: frameworkdevops/framework_1.0:jenkins
ports:
- name: http-port
containerPort: 8080
- name: jnlp-port
containerPort: 8080
volumeMounts:
- name: jenkins-persistent-storage
mountPath: /bitnami
volumes:
- name: jenkins-persistent-storage
persistentVolumeClaim:
claimName: newjenkinsv2" >> jenkins-deployment.yaml
touch jenkins-service.yaml
chmod 777 jenkins-service.yaml
echo "apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
nodePort: 30000
selector:
app: jenkins" >> jenkins-service.yaml
kubectl create -f pv.yaml --namespace=jenkins
kubectl create -f pvc.yaml --namespace=jenkins
kubectl create -f jenkins-deployment.yaml --namespace=jenkins
kubectl create -f jenkins-service.yaml --namespace=jenkins
kubectl create ns sonarqube
touch sonarqube-deployment.yaml
chmod 777 sonarqube-deployment.yaml
echo "apiVersion: extensions/v1beta1 # for versions before 1.7.0 use apps/v1beta1
kind: Deployment
metadata:
name: sonarqube-deployment
spec:
replicas: 1
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
spec:
containers:
- name: sonarqube
image: sonarqube:latest
ports:
- containerPort: 9000" >> sonarqube-deployment.yaml
touch sonarqube-service.yaml
chmod 777 sonarqube-service.yaml
echo "apiVersion: v1
kind: Service
metadata:
name: sonarqube
spec:
type: NodePort
ports:
- port: 9000
targetPort: 9000
nodePort: 30010
selector:
app: sonarqube" >> sonarqube-service.yaml
kubectl create -f sonarqube-deployment.yaml --namespace=sonarqube
kubectl create -f sonarqube-service.yaml --namespace=sonarqube
kubectl create ns tomcat
touch tomcat-deployment.yaml
chmod 777 tomcat-deployment.yaml
echo "apiVersion: extensions/v1beta1 # for versions before 1.7.0 use apps/v1beta1
kind: Deployment
metadata:
name: tomcat-deployment
spec:
replicas: 1
selector:
matchLabels:
app: tomcat
template:
metadata:
labels:
app: tomcat
spec:
containers:
- name: tomcat
image: frameworkdevops/framework_1.0:tomcat
ports:
- containerPort: 8080" >> tomcat-deployment.yaml
touch tomcat-service.yaml
chmod 777 tomcat-service.yaml
echo "apiVersion: v1
kind: Service
metadata:
name: tomcat
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
nodePort: 30500
selector:
app: tomcat" >> tomcat-service.yaml
kubectl create -f tomcat-deployment.yaml --namespace=tomcat
kubectl create -f tomcat-service.yaml --namespace=tomcat
kubectl create ns nexus
touch nexus-deployment.yaml
chmod 777 nexus-deployment.yaml
echo "apiVersion: extensions/v1beta1 # for versions before 1.7.0 use apps/v1beta1
kind: Deployment
metadata:
name: nexus-deployment
spec:
replicas: 1
selector:
matchLabels:
app: nexus
template:
metadata:
labels:
app: nexus
spec:
containers:
- name: nexus
image: sonatype/nexus3
ports:
- containerPort: 8081" >> nexus-deployment.yaml
touch nexus-service.yaml
chmod 777 nexus-service.yaml
echo "apiVersion: v1
kind: Service
metadata:
name: nexus
spec:
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 32000
selector:
app: nexus" >> nexus-service.yaml
kubectl create -f nexus-deployment.yaml --namespace=nexus
kubectl create -f nexus-service.yaml --namespace=nexus