summaryrefslogtreecommitdiff
path: root/kubernetes/server.yml
blob: b7598bfd551091c24f88f41d836dff29f8a070cf (plain)
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
apiVersion: apps/v1
kind: Deployment
metadata:
  name: seven-wonders
  namespace: seven-wonders
spec:
  selector:
    matchLabels:
      app: seven-wonders
  replicas: 1
  template:
    metadata:
      labels:
        app: seven-wonders
    spec:
      containers:
        - name: seven-wonders-server
          env:
            # Profile "prod" is used in particular to enable sending logs to Loki
            - name: SPRING_PROFILES_ACTIVE
              value: prod
            - name: LOKI_USERNAME
              valueFrom:
                secretKeyRef:
                  name: loki-credentials
                  key: username
            - name: LOKI_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: loki-credentials
                  key: api-key
          image: hildan/seven-wonders-server:latest
          ports:
            - containerPort: 80

---
apiVersion: v1
kind: Service
metadata:
  name: seven-wonders
  namespace: seven-wonders
  labels:
    app: seven-wonders
spec:
  ports:
    - name: 80-80
      port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: seven-wonders
  type: ClusterIP

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: seven-wonders-ingress
  namespace: seven-wonders
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  rules:
    - host: "seven-wonders.hildan.org"
      http:
        paths:
          - path: "/"
            pathType: Prefix
            backend:
              service:
                name: seven-wonders
                port:
                  number: 80
bgstack15