Skip to content

Commit 578a844

Browse files
committed
init
0 parents  commit 578a844

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.rancher-pipeline.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
stages:
2+
- name: Publish image
3+
steps:
4+
- publishImageConfig:
5+
dockerfilePath: ./Dockerfile
6+
buildContext: .
7+
tag: ssh-access:${CICD_EXECUTION_SEQUENCE}
8+
- name: Deploy
9+
steps:
10+
- applyYamlConfig:
11+
path: ./deployment.yaml

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM aliazlan4/ssh-access
2+
COPY authorized_keys /root/.ssh/authorized_keys
3+
RUN chmod 700 /root/.ssh
4+
RUN chmod 600 /root/.ssh/authorized_keys
5+
EXPOSE 22

authorized_keys

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA07XYB26Jw0g3ZV/bTTAX8XgpxxFGtmieYHfJ4OCatVSRC8ChQzCf8TQdZS7xQZ3kme6zb69jiml+pgqQAROGogLJarzhbdzVMhSLXYEaC1WLt8sYhYkv88akkx9r1/OpM0PIG/xsc3RIFzmnBVKt6UYWhFtl8WEUzR8WAs/RQQWk+6UoEazzeKqqeWfstxT7fykCaJcLdhf4Ow0+PU/Z0tbKeR8+I6aoRtoR12W1mq06AdbXGVK/eOGPTj4rZvodIN/EB8R/HAqvPU4RpbmjQLainogBWoLX4xbciwYF+ig4ErHNxcnsM4pi+FGbXLZNZnhERQpfQyqnaCm2MWPGNQ==

deployment.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: ssh-access
5+
namespace: ssh-access
6+
spec:
7+
type: NodePort
8+
ports:
9+
- name: ssh-access
10+
nodePort: 30022
11+
port: 22
12+
protocol: TCP
13+
targetPort: 22
14+
selector:
15+
app: ssh-access
16+
---
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
name: ssh-access
21+
namespace: ssh-access
22+
labels:
23+
app: ssh-access
24+
spec:
25+
replicas: 1
26+
minReadySeconds: 5
27+
selector:
28+
matchLabels:
29+
app: ssh-access
30+
strategy:
31+
rollingUpdate:
32+
maxSurge: 1
33+
maxUnavailable: 0
34+
type: RollingUpdate
35+
template:
36+
metadata:
37+
labels:
38+
app: ssh-access
39+
spec:
40+
affinity:
41+
nodeAffinity:
42+
requiredDuringSchedulingIgnoredDuringExecution:
43+
nodeSelectorTerms:
44+
- matchExpressions:
45+
- key: type
46+
operator: In
47+
values:
48+
- api
49+
imagePullSecrets:
50+
- name: pipeline-docker-registry
51+
containers:
52+
- name: ssh-access
53+
image: ${CICD_IMAGE}:${CICD_EXECUTION_SEQUENCE}
54+
ports:
55+
- containerPort: 22

0 commit comments

Comments
 (0)