moving repository to gitea
This commit is contained in:
28057
k8s/argocd/install.yaml
Normal file
28057
k8s/argocd/install.yaml
Normal file
File diff suppressed because it is too large
Load Diff
27
k8s/argocd/kustomization.yaml
Normal file
27
k8s/argocd/kustomization.yaml
Normal 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
|
||||
49
k8s/production/base/deploy.yaml
Normal file
49
k8s/production/base/deploy.yaml
Normal 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
|
||||
4
k8s/production/base/kustomization.yaml
Normal file
4
k8s/production/base/kustomization.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- deploy.yaml
|
||||
7
k8s/production/kustomization.yaml
Normal file
7
k8s/production/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: production-environment
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- base
|
||||
- ../shared
|
||||
4
k8s/production/namespace.yaml
Normal file
4
k8s/production/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: production-environment
|
||||
2
k8s/secret/.gitignore
vendored
Normal file
2
k8s/secret/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
8
k8s/shared/kustomization.yaml
Normal file
8
k8s/shared/kustomization.yaml
Normal 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
|
||||
35
k8s/shared/postgres-deployment.yaml
Normal file
35
k8s/shared/postgres-deployment.yaml
Normal 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
|
||||
10
k8s/shared/postgres-pvc.yaml
Normal file
10
k8s/shared/postgres-pvc.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
9
k8s/shared/postgres-secret.yaml
Normal file
9
k8s/shared/postgres-secret.yaml
Normal 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
|
||||
15
k8s/shared/postgres-service.yaml
Normal file
15
k8s/shared/postgres-service.yaml
Normal 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
7
k8s/shared/regcred.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: regcred
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5pbnRlcm5hbC51aWEubm8iOiB7CgkJCSJhdXRoIjogImRtbHNhbUZ5WWpwbmJIQmhkQzAzVW5kU1pITkhaa1JTTXpoWldtcGFRMmsxZUE9PSIKCQl9Cgl9Cn0=
|
||||
49
k8s/staging/base/deploy.yaml
Normal file
49
k8s/staging/base/deploy.yaml
Normal 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
|
||||
4
k8s/staging/base/kustomization.yaml
Normal file
4
k8s/staging/base/kustomization.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- deploy.yaml
|
||||
7
k8s/staging/kustomization.yaml
Normal file
7
k8s/staging/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: staging-environment
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- base
|
||||
- ../shared
|
||||
4
k8s/staging/namespace.yaml
Normal file
4
k8s/staging/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: staging-environment
|
||||
42
k8s/webapp/base/deploy.yaml
Normal file
42
k8s/webapp/base/deploy.yaml
Normal 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
|
||||
|
||||
3
k8s/webapp/base/kustomization.yaml
Normal file
3
k8s/webapp/base/kustomization.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
resources:
|
||||
- deploy.yaml
|
||||
|
||||
5
k8s/webapp/kustomization.yaml
Normal file
5
k8s/webapp/kustomization.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- base
|
||||
- ../shared
|
||||
22
k8s/webapp/webapp-app.yaml
Normal file
22
k8s/webapp/webapp-app.yaml
Normal 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
|
||||
Reference in New Issue
Block a user