add infra consul
This commit is contained in:
93
kubernetes/infrastructure/consul/app/pvc.yaml
Normal file
93
kubernetes/infrastructure/consul/app/pvc.yaml
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: consul-data-pv
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
type: local
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
capacity:
|
||||||
|
storage: 10Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
local:
|
||||||
|
path: "/mnt/nfs/AppData/consul/data"
|
||||||
|
claimRef:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
name: consul-data-pvc
|
||||||
|
namespace: consul
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi5-cluster-node-3
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: consul-data-pvc
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
name: consul-data-pvc
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: consul-config-pv
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
type: local
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
capacity:
|
||||||
|
storage: 10Mi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
local:
|
||||||
|
path: "/mnt/nfs/AppData/consul/config"
|
||||||
|
claimRef:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
name: consul-config-pvc
|
||||||
|
namespace: consul
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi5-cluster-node-3
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: consul-config-pvc
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
name: consul-config-pvc
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Mi
|
||||||
16
kubernetes/infrastructure/consul/app/service.yaml
Normal file
16
kubernetes/infrastructure/consul/app/service.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
protocol: TCP
|
||||||
|
port: 8500
|
||||||
|
targetPort: 8500
|
||||||
|
selector:
|
||||||
|
app: consul
|
||||||
|
type: ClusterIP
|
||||||
44
kubernetes/infrastructure/consul/app/statefulset.yaml
Normal file
44
kubernetes/infrastructure/consul/app/statefulset.yaml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: consul
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: consul
|
||||||
|
image: 'swr.cn-south-1.myhuaweicloud.com/starsl.cn/consul:latest'
|
||||||
|
args:
|
||||||
|
- agent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8500
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Australia/Sydney
|
||||||
|
volumeMounts:
|
||||||
|
- name: consul-data
|
||||||
|
mountPath: /consul/data
|
||||||
|
- name: consul-config
|
||||||
|
mountPath: /consul/config
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- name: consul-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: consul-data-pvc
|
||||||
|
- name: consul-config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: consul-config-pvc
|
||||||
|
serviceName: consul
|
||||||
18
kubernetes/infrastructure/consul/consul.yaml
Normal file
18
kubernetes/infrastructure/consul/consul.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
path: ./kubernetes/infrastructure/consul/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: flux-system
|
||||||
|
dependsOn:
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
@@ -3,6 +3,7 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./cert-manager/cert-manager.yaml
|
- ./cert-manager/cert-manager.yaml
|
||||||
# - ./cilium/cilium.yaml
|
# - ./cilium/cilium.yaml
|
||||||
|
- ./consul/consul.yaml
|
||||||
- ./minio/minio.yaml
|
- ./minio/minio.yaml
|
||||||
- ./ingress-nginx/ingress-nginx.yaml
|
- ./ingress-nginx/ingress-nginx.yaml
|
||||||
- ./ingress-nginx/ingress-nginx-config.yaml
|
- ./ingress-nginx/ingress-nginx-config.yaml
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
Reference in New Issue
Block a user