Deploying git server and prometheus metrics
This commit is contained in:
115
tasks/main.yml
115
tasks/main.yml
@@ -26,6 +26,30 @@
|
||||
requests:
|
||||
storage: 8Ti
|
||||
|
||||
- name: configmap for authorized_keys
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: keys
|
||||
namespace: www
|
||||
data:
|
||||
authorized_keys: "{{ lookup('template', 'authorized_keys.j2') }}"
|
||||
|
||||
- name: configmap for mailsync.py
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: mailsync
|
||||
namespace: www
|
||||
data:
|
||||
mailsync.py: "{{ lookup('file', 'mailsync.py') }}"
|
||||
|
||||
- name: cronjob
|
||||
k8s:
|
||||
definition:
|
||||
@@ -45,7 +69,7 @@
|
||||
image: python:3
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/python
|
||||
- python
|
||||
- /usr/src/mailsync.py
|
||||
env:
|
||||
- name: USERNAME
|
||||
@@ -59,11 +83,17 @@
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
restartPolicy: OnFailure
|
||||
- name: mailsync
|
||||
mountPath: /usr/src/mailsync.py
|
||||
subPath: mailsync.py
|
||||
restartPolicy: OnFailure
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: data
|
||||
- name: mailsync
|
||||
configMap:
|
||||
name: mailsync
|
||||
|
||||
- name: configmap for httpd.conf
|
||||
k8s:
|
||||
@@ -87,7 +117,7 @@
|
||||
name: httpd-gitweb
|
||||
namespace: www
|
||||
data:
|
||||
docker.motd: "{{ lookup('file', 'httpd-gitweb.conf') }}"
|
||||
httpd-gitweb.conf: "{{ lookup('file', 'httpd-gitweb.conf') }}"
|
||||
|
||||
- name: configmap for gitweb.conf
|
||||
k8s:
|
||||
@@ -99,7 +129,7 @@
|
||||
name: gitweb
|
||||
namespace: www
|
||||
data:
|
||||
docker.motd: "{{ lookup('file', 'gitweb.conf') }}"
|
||||
gitweb.conf: "{{ lookup('file', 'gitweb.conf') }}"
|
||||
|
||||
- name: deployment for gitweb
|
||||
k8s:
|
||||
@@ -121,7 +151,7 @@
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init
|
||||
image: bash
|
||||
image: debian:trixie
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
@@ -131,18 +161,19 @@
|
||||
mountPath: /data
|
||||
containers:
|
||||
- name: gitweb
|
||||
image: ericomeehan/gitweb
|
||||
imagePullPolicy: IfNotPresent
|
||||
image: ericomeehan/gitweb:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 9117
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountpath: /usr/local/apache2/htdocs
|
||||
mountPath: /usr/local/apache2/htdocs
|
||||
- name: httpd
|
||||
mountPath: /usr/local/apache2/conf/httpd.conf
|
||||
subPath: httpd.conf
|
||||
- name: httpd-gitweb
|
||||
mountPath: /usr/local/apache2/conf/httpd-gitweb.conf
|
||||
mountPath: /usr/local/apache2/conf/extra/httpd-gitweb.conf
|
||||
subPath: httpd-gitweb.conf
|
||||
- name: gitweb
|
||||
mountPath: /etc/gitweb.conf
|
||||
@@ -161,6 +192,22 @@
|
||||
configMap:
|
||||
name: gitweb
|
||||
|
||||
- name: service for prometheus
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: www
|
||||
spec:
|
||||
selector:
|
||||
app: gitweb
|
||||
ports:
|
||||
- port: 9117
|
||||
name: http
|
||||
type: ClusterIP
|
||||
|
||||
- name: service for gitweb
|
||||
k8s:
|
||||
definition:
|
||||
@@ -175,6 +222,7 @@
|
||||
ports:
|
||||
- port: 80
|
||||
name: http
|
||||
externalTrafficPolicy: Local
|
||||
type: LoadBalancer
|
||||
|
||||
- name: onionservice
|
||||
@@ -205,6 +253,8 @@
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: ca-issuer
|
||||
nginx.ingress.kubernetes.io/enable-cors: "true"
|
||||
nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"
|
||||
name: www
|
||||
namespace: www
|
||||
spec:
|
||||
@@ -225,61 +275,56 @@
|
||||
- eom.dev
|
||||
secretName: www
|
||||
|
||||
- name: deployment for ftp
|
||||
- name: deployment for gitserver
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ftp
|
||||
name: gitserver
|
||||
namespace: www
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ftp
|
||||
app: gitserver
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ftp
|
||||
app: gitserver
|
||||
spec:
|
||||
containers:
|
||||
- name: ftp
|
||||
image: bogem/ftp
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: FTP_USER
|
||||
value: "{{ www_ftp_user }}"
|
||||
- name: FTP_PASS
|
||||
value: "{{ www_ftp_password }}"
|
||||
- name: PASV_ADDRESS
|
||||
value: "{{ www_ftp_pasv_address }}"
|
||||
- name: gitserver
|
||||
image: ericomeehan/gitserver:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 20
|
||||
- containerPort: 21
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountpath: /home/vsftpd
|
||||
- containerPort: 22
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/git/data
|
||||
- name: keys
|
||||
mountPath: /auth
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: data
|
||||
- name: keys
|
||||
configMap:
|
||||
name: keys
|
||||
|
||||
- name: service for ftp
|
||||
- name: service for gitserver
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ftp
|
||||
name: gitserver
|
||||
namespace: www
|
||||
spec:
|
||||
selector:
|
||||
app: ftp
|
||||
app: gitserver
|
||||
ports:
|
||||
- port: 20
|
||||
name: ftpa
|
||||
- port: 21
|
||||
name: ftpb
|
||||
- port: 22
|
||||
name: gitserver
|
||||
type: LoadBalancer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user