Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add k8s configuration example #19

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# examples/k8s

k8s example shows simple configuration into kubernetes cluster.
99 changes: 99 additions & 0 deletions examples/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: relay
labels:
app.kubernetes.io/name: relay
app.kubernetes.io/app: relay
app.kubernetes.io/app-kind: smtp-server
spec:
replicas: 3
strategy:
type: RollingUpdate
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/name: relay
app.kubernetes.io/app: relay
app.kubernetes.io/app-kind: smtp-server
template:
metadata:
labels:
app.kubernetes.io/name: relay
app.kubernetes.io/app: relay
app.kubernetes.io/app-kind: smtp-server
spec:
terminationGracePeriodSeconds: 30
containers:
- name: relay
image: ghcr.io/teran/relay:v0.2.0
env:
- name: LOG_LEVEL
value: trace
- name: ADDR
value: :25
- name: ENABLE_TLS
value: "false"
# - name: TLS_ADDR
# value: :465
# - name: TLS_CERTIFICATE
# valueFrom:
# secretKeyRef:
# name: relay
# key: tls_certificate
# - name: TLS_KEY
# valueFrom:
# secretKeyRef:
# name: relay
# key: tls_key
- name: ALLOW_INSECURE_AUTH
value: "true"
- name: DOMAIN
value: "example.org"
- name: DRIVER
value: printer
# - name: DRIVER
# value: mailgun
# - name: MAILGUN_API_KEY
# valueFrom:
# secretKeyRef:
# name: relay
# key: mailgun_api_key
# - name: MAILGUN_URL
# valueFrom:
# secretKeyRef:
# name: relay
# key: mailgun_url
- name: METRICS_ADDR
value: :8081
imagePullPolicy: IfNotPresent
ports:
- name: smtp
containerPort: 25
protocol: TCP
# - name: smtps
# containerPort: 465
# protocol: TCP
- name: metrics
containerPort: 8081
protocol: TCP
readinessProbe:
httpGet:
path: /metrics
port: metrics
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /metrics
port: metrics
timeoutSeconds: 1
resources:
requests:
memory: 128Mi
cpu: 10m
limits:
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
22 changes: 22 additions & 0 deletions examples/k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: v1
kind: Service
metadata:
name: relay
labels:
app.kubernetes.io/name: relay
app.kubernetes.io/app: relay
app.kubernetes.io/app-kind: smtp-server
spec:
ports:
- name: smtp
port: 25
protocol: TCP
# - name: smtps
# port: 465
# protocol: TCP
selector:
app.kubernetes.io/name: relay
app.kubernetes.io/app: relay
app.kubernetes.io/app-kind: smtp-server
type: ClusterIP
Loading