2024-07-28 17:58:25 +00:00
|
|
|
---
|
2023-09-15 07:24:36 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: inventory
|
|
|
|
namespace: hackerspace
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
revisionHistoryLimit: 0
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app.kubernetes.io/name: inventory
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: inventory
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- image: harbor.k-space.ee/k-space/inventory-app:latest
|
|
|
|
imagePullPolicy: Always
|
|
|
|
env:
|
|
|
|
- name: ENVIRONMENT_TYPE
|
|
|
|
value: PROD
|
|
|
|
- name: PYTHONUNBUFFERED
|
|
|
|
value: "1"
|
|
|
|
- name: INVENTORY_ASSETS_BASE_URL
|
|
|
|
value: https://minio-cluster-shared.k-space.ee/inventory-5b342be1-60a1-4290-8061-e0b8fc17d40d/
|
|
|
|
- name: OIDC_USERS_NAMESPACE
|
2024-07-28 17:58:25 +00:00
|
|
|
value: passmower
|
2023-09-15 07:24:36 +00:00
|
|
|
- name: SECRET_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: SECRET_KEY
|
|
|
|
name: inventory-secrets
|
|
|
|
- name: INVENTORY_API_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: INVENTORY_API_KEY
|
|
|
|
name: inventory-api-key
|
|
|
|
- name: SLACK_DOORLOG_CALLBACK
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: SLACK_DOORLOG_CALLBACK
|
|
|
|
name: slack-secrets
|
|
|
|
- name: SLACK_VERIFICATION_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: SLACK_VERIFICATION_TOKEN
|
|
|
|
name: slack-secrets
|
|
|
|
envFrom:
|
|
|
|
- secretRef:
|
|
|
|
name: miniobucket-inventory-owner-secrets
|
|
|
|
- secretRef:
|
|
|
|
name: oidc-client-inventory-app-owner-secrets
|
2024-07-17 20:58:38 +00:00
|
|
|
- secretRef:
|
|
|
|
name: inventory-mongodb
|
2023-09-15 07:24:36 +00:00
|
|
|
name: inventory
|
|
|
|
ports:
|
|
|
|
- containerPort: 5000
|
|
|
|
name: http
|
|
|
|
protocol: TCP
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: "1"
|
|
|
|
memory: 500Mi
|
|
|
|
requests:
|
|
|
|
cpu: 100m
|
|
|
|
memory: 200Mi
|
|
|
|
securityContext:
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
runAsNonRoot: true
|
|
|
|
runAsUser: 1000
|
|
|
|
terminationMessagePath: /dev/termination-log
|
|
|
|
terminationMessagePolicy: File
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /tmp
|
|
|
|
name: tmp
|
|
|
|
dnsPolicy: ClusterFirst
|
|
|
|
restartPolicy: Always
|
|
|
|
schedulerName: default-scheduler
|
|
|
|
serviceAccount: inventory
|
|
|
|
serviceAccountName: inventory
|
|
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
volumes:
|
|
|
|
- name: tmp
|
2024-07-28 17:58:25 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: inventory-app
|
|
|
|
labels:
|
|
|
|
app: inventory-app
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
app: inventory-app
|
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: 5000
|
|
|
|
---
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: inventory-app
|
|
|
|
annotations:
|
|
|
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
|
|
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
|
|
|
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
|
|
|
|
spec:
|
|
|
|
ingressClassName: shared
|
|
|
|
rules:
|
|
|
|
- host: inventory.k-space.ee
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- pathType: Prefix
|
|
|
|
path: "/"
|
|
|
|
backend:
|
|
|
|
service:
|
|
|
|
name: inventory-app
|
|
|
|
port:
|
|
|
|
number: 5000
|
|
|
|
tls:
|
|
|
|
- hosts:
|
2024-08-02 22:40:32 +00:00
|
|
|
- "*.k-space.ee"
|
2024-07-28 17:58:25 +00:00
|
|
|
---
|
|
|
|
apiVersion: codemowers.cloud/v1beta1
|
|
|
|
kind: OIDCClient
|
|
|
|
metadata:
|
|
|
|
name: inventory-app
|
|
|
|
spec:
|
|
|
|
uri: 'https://inventory.k-space.ee'
|
|
|
|
redirectUris:
|
|
|
|
- 'https://inventory.k-space.ee/login-callback'
|
|
|
|
grantTypes:
|
|
|
|
- 'authorization_code'
|
|
|
|
responseTypes:
|
|
|
|
- 'code'
|
|
|
|
availableScopes:
|
|
|
|
- 'openid'
|
|
|
|
- 'profile'
|
|
|
|
tokenEndpointAuthMethod: 'client_secret_basic'
|
|
|
|
pkce: false
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
name: inventory
|
|
|
|
rules:
|
|
|
|
- verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
apiGroups:
|
|
|
|
- codemowers.cloud
|
|
|
|
resources:
|
|
|
|
- oidcusers
|
|
|
|
- oidcusers/status
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
|
|
|
name: inventory
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: inventory
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: inventory
|
|
|
|
namespace: hackerspace
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: inventory
|