moving repository to gitea

This commit is contained in:
2026-07-26 10:07:10 +02:00
parent 94687f5fc1
commit aaca513e23
59 changed files with 29784 additions and 0 deletions

28057
k8s/argocd/install.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- install.yaml
namespace: argocd
patches:
- target:
kind: Service
name: argocd-server
patch: |-
apiVersion: v1
kind: Service
metadata:
name: argocd-server
spec:
type: NodePort
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
nodePort: 30080
- name: https
port: 443
protocol: TCP
targetPort: 8080
nodePort: 30443

View File

@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
labels:
app: webapp
spec:
replicas: 1
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
image: registry.internal.uia.no/ikt206-g-26v-devops/group30/exam:$CI_COMMIT_SHORT_SHA
imagePullPolicy: Always
ports:
- containerPort: 8000
name: http
env:
- name: FLASK_APP
value: app.py
- name: ENVIRONMENT
value: production
- name: DATABASE_URL
value: postgresql://postgres:postgres@db:5432/postgres
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: webapp
labels:
app: webapp
spec:
type: NodePort
ports:
- port: 8081
targetPort: http
nodePort: 30081
protocol: TCP
name: http
selector:
app: webapp

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deploy.yaml

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: production-environment
resources:
- namespace.yaml
- base
- ../shared

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: production-environment

2
k8s/secret/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- regcred.yaml
- postgres-secret.yaml
- postgres-pvc.yaml
- postgres-deployment.yaml
- postgres-service.yaml

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:14
ports:
- containerPort: 5432
name: postgres
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
envFrom:
- secretRef:
name: postgres-secret
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: postgres-pvc

View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: postgres-secret
type: Opaque
stringData:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: db
labels:
app: postgres
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
protocol: TCP
name: postgres
selector:
app: postgres

7
k8s/shared/regcred.yaml Normal file
View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: regcred
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5pbnRlcm5hbC51aWEubm8iOiB7CgkJCSJhdXRoIjogImRtbHNhbUZ5WWpwbmJIQmhkQzAzVW5kU1pITkhaa1JTTXpoWldtcGFRMmsxZUE9PSIKCQl9Cgl9Cn0=

View File

@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
labels:
app: webapp
spec:
replicas: 1
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
image: registry.internal.uia.no/ikt206-g-26v-devops/group30/exam:$CI_COMMIT_SHORT_SHA
imagePullPolicy: Always
ports:
- containerPort: 8000
name: http
env:
- name: FLASK_APP
value: app.py
- name: ENVIRONMENT
value: staging
- name: DATABASE_URL
value: postgresql://postgres:postgres@db:5432/postgres
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: webapp
labels:
app: webapp
spec:
type: NodePort
ports:
- port: 8080
targetPort: http
nodePort: 30082
protocol: TCP
name: http
selector:
app: webapp

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deploy.yaml

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: staging-environment
resources:
- namespace.yaml
- base
- ../shared

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: staging-environment

View File

@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
labels:
app: webapp
spec:
replicas: 1
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
image: registry.internal.uia.no/ikt206-g-26v-devops/group30/exam
imagePullPolicy: Always
ports:
- containerPort: 8000
name: http
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: webapp
labels:
app: webapp
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: http
protocol: TCP
name: http
selector:
app: webapp

View File

@@ -0,0 +1,3 @@
resources:
- deploy.yaml

View File

@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- base
- ../shared

View File

@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: beetroot
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: registry.internal.uia.no/ikt206-g-26v-devops/group30/exam
targetRevision: main
path: k8s/webapp/base
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true