feat(whoami): add simple whoami-app for testing

This commit is contained in:
Vegard Hagen
2024-08-17 23:34:33 +02:00
parent 5c0c3366b2
commit 653d3e946c
7 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: dev
namespace: argocd
labels:
dev.stonegarden: application
spec:
generators:
- git:
repoURL: https://github.com/vehagn/homelab
revision: HEAD
directories:
- path: k8s/apps/dev/*
template:
metadata:
name: '{{ path.basename }}'
labels:
dev.stonegarden: application
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: dev
source:
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
path: '{{ path }}'
destination:
name: in-cluster
namespace: argocd
syncPolicy:
automated:
selfHeal: true
prune: true

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd
commonLabels:
dev.stonegarden: app-management
app.kubernetes.io/managed-by: argocd
resources:
- project.yaml
- application-set.yaml

16
k8s/apps/dev/project.yaml Normal file
View File

@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: dev
namespace: argocd
spec:
sourceRepos:
- 'https://github.com/vehagn/homelab'
destinations:
- namespace: 'argocd'
server: '*'
- namespace: 'whoami'
server: '*'
clusterResourceWhitelist:
- group: '*'
kind: '*'

View File

@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: whoami
labels:
app: whoami
spec:
replicas: 3
selector:
matchLabels:
app: whoami
template:
metadata:
namespace: whoami
labels:
app: whoami
spec:
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
fsGroup: 999
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: whoami
image: ghcr.io/traefik/whoami:latest
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ "ALL" ]
ports:
- name: http
containerPort: 80
resources:
requests:
cpu: 50m
memory: 12Mi
limits:
cpu: 1000m
memory: 24Mi

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ns.yaml
- svc.yaml
- deployment.yaml

View File

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

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: whoami
annotations:
io.cilium/lb-ipam-ips: 192.168.1.223
spec:
type: LoadBalancer
selector:
app: whoami
ports:
- name: web
port: 80
targetPort: http