gf-k8s/sshct.yaml
Andrey Kartashov 4041acfa21 Initial commit
2018-01-08 18:03:36 +07:00

93 lines
1.5 KiB
YAML

---
apiVersion: v1
kind: Secret
metadata:
name: sshct
type: Opaque
data:
password: OGJKYWtURER3amQ3SG4=
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: sshcthome
labels:
type: local
name: sshcthome
spec:
storageClassName: manual
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /data/home
# mkdir -p /data/home/me
# chown 1000.1000 /data/home/me
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: sshcthome
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
selector:
matchLabels:
name: sshcthome
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: sshct
labels:
app: sshct
spec:
replicas: 1
selector:
matchLabels:
app: sshct
template:
metadata:
labels:
app: sshct
spec:
volumes:
- name: sshcthome
persistentVolumeClaim:
claimName: sshcthome
containers:
- name: sshct
image: sshct
imagePullPolicy: IfNotPresent
env:
- name: CTUSERPWD
valueFrom:
secretKeyRef:
name: sshct
key: password
ports:
- containerPort: 22
name: ssh
volumeMounts:
- mountPath: /home
name: sshcthome
---
kind: Service
apiVersion: v1
metadata:
name: sshct
spec:
selector:
app: sshct
ports:
- name: ssh
protocol: TCP
port: 22
targetPort: ssh
nodePort: 30810
type: NodePort