Skip to content
Snippets Groups Projects
Verified Commit f310aed7 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

feat(blog): Move to new kustomize-optimised config

parent 98689b55
No related branches found
No related tags found
No related merge requests found
...@@ -3,18 +3,13 @@ apiVersion: apps/v1 ...@@ -3,18 +3,13 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: blog name: blog
labels:
app.kubernetes.io/name: blog
spec: spec:
replicas: 2 replicas: 2
selector: selector:
matchLabels: matchLabels: {}
app.kubernetes.io/name: blog
template: template:
metadata:
labels:
app.kubernetes.io/name: blog
spec: spec:
serviceAccountName: blog
automountServiceAccountToken: false automountServiceAccountToken: false
containers: containers:
- name: blog - name: blog
...@@ -58,8 +53,7 @@ spec: ...@@ -58,8 +53,7 @@ spec:
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule whenUnsatisfiable: DoNotSchedule
labelSelector: labelSelector:
matchLabels: matchLabels: {}
app.kubernetes.io/name: blog
matchLabelKeys: matchLabelKeys:
- pod-template-hash - pod-template-hash
--- ---
...@@ -67,12 +61,9 @@ apiVersion: v1 ...@@ -67,12 +61,9 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: blog name: blog
labels:
app.kubernetes.io/name: blog
spec: spec:
type: LoadBalancer type: ClusterIP
selector: selector: {}
app.kubernetes.io/name: blog
ports: ports:
- name: http - name: http
protocol: TCP protocol: TCP
...@@ -86,5 +77,4 @@ metadata: ...@@ -86,5 +77,4 @@ metadata:
spec: spec:
minAvailable: 1 minAvailable: 1
selector: selector:
matchLabels: matchLabels: {}
app.kubernetes.io/name: blog
...@@ -3,8 +3,6 @@ kind: Certificate ...@@ -3,8 +3,6 @@ kind: Certificate
metadata: metadata:
name: blog-tls name: blog-tls
namespace: blog namespace: blog
labels:
app.kubernetes.io/name: blog
spec: spec:
dnsNames: dnsNames:
- ENC[AES256_GCM,data:e3PPdTF5o9u8HB8EFiPCC5AQTA==,iv:oJUqFVCwqxOPEedcVaKVnG7JBvq87Lb6OptXxX+oFFE=,tag:AW+DOX0gd3dmxkTV3PmtaA==,type:str] - ENC[AES256_GCM,data:e3PPdTF5o9u8HB8EFiPCC5AQTA==,iv:oJUqFVCwqxOPEedcVaKVnG7JBvq87Lb6OptXxX+oFFE=,tag:AW+DOX0gd3dmxkTV3PmtaA==,type:str]
......
...@@ -3,8 +3,6 @@ kind: Ingress ...@@ -3,8 +3,6 @@ kind: Ingress
metadata: metadata:
name: blog name: blog
namespace: blog namespace: blog
labels:
app.kubernetes.io/name: blog
annotations: annotations:
forecastle.stakater.com/expose: "true" forecastle.stakater.com/expose: "true"
forecastle.stakater.com/appName: Blog forecastle.stakater.com/appName: Blog
......
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: blog namespace: blog
commonLabels:
app.kubernetes.io/name: blog
resources: resources:
- namespace.yaml - namespace.yaml
- certificate.yaml - certificate.yaml
- blog.yaml - blog.yaml
- ingress.yaml - ingress.yaml
- slo.yaml - slo.yaml
- serviceaccount.yaml
- ../../../shared/networkpolicies/deny-by-default-ingress.yaml - ../../../shared/networkpolicies/deny-by-default-ingress.yaml
- ../../../shared/networkpolicies/deny-by-default-egress.yaml - ../../../shared/networkpolicies/deny-by-default-egress.yaml
- ../../../shared/networkpolicies/allow-from-ingress.yaml - ../../../shared/networkpolicies/allow-from-ingress.yaml
- ../../../shared/resourcequotas/default.yaml - ../../../shared/resourcequotas/default.yaml
patchesStrategicMerge:
- networkpolicy.yaml components:
\ No newline at end of file - ../../../shared/components/namespace-restricted
\ No newline at end of file
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: blog name: blog
labels: \ No newline at end of file
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/warn: restricted
pod-security.kubernetes.io/audit-version: v1.27
pod-security.kubernetes.io/enforce-version: v1.26
pod-security.kubernetes.io/warn-version: v1.27
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: flux-reconciler
namespace: blog
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: flux-reconciler
namespace: blog
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- kind: ServiceAccount
name: flux-reconciler
namespace: blog
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-ingress
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: blog
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: blog
automountServiceAccountToken: false
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patches:
- path: namespace.yaml
target:
kind: Namespace
\ No newline at end of file
- op: add
path: /metadata/labels
value: {}
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1audit
value: restricted
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1enforce
value: restricted
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1warn
value: restricted
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1audit-version
value: v1.28
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1enforce-version
value: v1.28
- op: add
path: /metadata/labels/pod-security.kubernetes.io~1warn-version
value: v1.28
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment