feat(env): Add development environment

When working on the development cluster, setup a kustomize environment to enable or disable services dynamicly, and include some dev specific variables (LoadBalancerIP, domain name etc.)
This commit is contained in:
Tanguy Herbron 2023-01-03 01:09:08 +01:00
parent 5a9e64aea3
commit 8297d43b12
5 changed files with 42 additions and 27 deletions

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
dev:
kubectl apply -k environments/dev --prune=true --all

View File

@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml
- ../../metallb
- ../../res
- https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml
- ../../longhorn
- ../../traefik
patchesStrategicMerge:
- ../../environments/dev/traefik-internal-service.yaml

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: traefik-internal
namespace: default
spec:
loadBalancerIP: 10.10.0.42

View File

@ -2,5 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ovh-config.yaml
- flat-sc.yaml - flat-sc.yaml
- redundant-sc.yaml - redundant-sc.yaml

View File

@ -1,30 +1,22 @@
---
# Source: traefik/templates/service.yaml
apiVersion: v1 apiVersion: v1
kind: List kind: Service
metadata: metadata:
name: traefik-internal name: traefik-internal
items: namespace: default
- apiVersion: v1 labels:
kind: Service app.kubernetes.io/name: traefik-inter
metadata: app.kubernetes.io/instance: traefik-inter
name: traefik-internal spec:
labels: type: LoadBalancer
app.kubernetes.io/name: traefik-inter selector:
app.kubernetes.io/instance: traefik-inter app.kubernetes.io/name: traefik-inter
annotations: app.kubernetes.io/instance: traefik-inter
spec: ports:
type: LoadBalancer - port: 80
loadBalancerIP: 10.10.0.28 name: web
selector: targetPort: "web"
app.kubernetes.io/name: traefik-inter protocol: TCP
app.kubernetes.io/instance: traefik-inter - port: 443
ports: name: websecure
- port: 80 targetPort: "websecure"
name: web protocol: TCP
targetPort: "web"
protocol: TCP
- port: 443
name: websecure
targetPort: "websecure"
protocol: TCP