feat(init): 仓库重新初始化
这个提交包含在:
@@ -1 +1,9 @@
|
||||
### apps
|
||||
|
||||
### 调试
|
||||
```shell
|
||||
kubectl run -i --tty --rm --restart=Never \
|
||||
--overrides='{"apiVersion": "v1", "spec": {"nodeSelector": {"kubernetes.io/hostname": "homea"}}}' \
|
||||
--image=nicolaka/netshoot:latest \
|
||||
debug -- sh
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: cnpg-cluster-sh
|
||||
namespace: infra-data
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- preference:
|
||||
matchExpressions:
|
||||
- key: topology.kubernetes.io/region
|
||||
operator: In
|
||||
values:
|
||||
- cn-sh
|
||||
weight: 1
|
||||
instances: 1
|
||||
enableSuperuserAccess: true
|
||||
storage:
|
||||
size: 10Gi
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: cloudnative-pg
|
||||
namespace: infra-data
|
||||
spec:
|
||||
repo: https://cloudnative-pg.github.io/charts
|
||||
chart: cloudnative-pg
|
||||
targetNamespace: infra-data
|
||||
version: 0.21.4
|
||||
valuesContent: |-
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cnpg-cluster-sh-lb
|
||||
namespace: infra-data
|
||||
spec:
|
||||
selector:
|
||||
cnpg.io/cluster: cnpg-cluster-sh
|
||||
role: primary
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 65432
|
||||
targetPort: 5432
|
||||
type: LoadBalancer
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-data
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgresql-ha-pgpool-script
|
||||
namespace: infra-data
|
||||
data:
|
||||
latency_test.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
install_packages ping
|
||||
|
||||
# 读取环境变量
|
||||
nodes=$PGPOOL_BACKEND_NODES
|
||||
|
||||
echo $nodes
|
||||
@@ -0,0 +1,85 @@
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: postgresql-ha
|
||||
namespace: infra-data
|
||||
spec:
|
||||
chart: oci://registry-1.docker.io/bitnamicharts/postgresql-ha
|
||||
targetNamespace: infra-data
|
||||
version: 14.0.12
|
||||
valuesContent: |-
|
||||
diagnosticMode:
|
||||
enabled: false
|
||||
postgresql:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgresql-ha
|
||||
app.kubernetes.io/component: postgresql
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgresql-ha
|
||||
app.kubernetes.io/component: postgresql
|
||||
topologyKey: topology.kubernetes.io/region
|
||||
weight: 1
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
image:
|
||||
debug: true
|
||||
username: rohow
|
||||
password: L#GRtTR2QuL@20pm6+c~
|
||||
postgresPassword: L#GRtTR2QuL@20pm6+c~
|
||||
repmgrPassword: yAn0l2eiLw
|
||||
pgpool:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgresql-ha
|
||||
app.kubernetes.io/component: pgpool
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgresql-ha
|
||||
app.kubernetes.io/component: pgpool
|
||||
topologyKey: topology.kubernetes.io/region
|
||||
weight: 1
|
||||
podAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgresql-ha
|
||||
app.kubernetes.io/component: pgpool
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
replicaCount: 1
|
||||
containerSecurityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
runAsNonRoot: false
|
||||
readOnlyRootFilesystem: false
|
||||
privileged: true
|
||||
allowPrivilegeEscalation: true
|
||||
image:
|
||||
debug: true
|
||||
adminPassword: wc8FVC55JX
|
||||
volumePermissions:
|
||||
enabled: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgresql-ha
|
||||
name: postgresql-ha-lb
|
||||
namespace: infra-data
|
||||
spec:
|
||||
selector:
|
||||
@@ -1,11 +1,12 @@
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: redis
|
||||
name: redis-cluster-sh
|
||||
namespace: infra-data
|
||||
spec:
|
||||
chart: oci://registry-1.docker.io/bitnamicharts/redis
|
||||
targetNamespace: infra-data
|
||||
version: 19.1.0
|
||||
valuesContent: |-
|
||||
global:
|
||||
redis:
|
||||
+14
-12
@@ -3,16 +3,18 @@ apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: cert-manager-webhook-dnspod
|
||||
namespace: infra-cert
|
||||
namespace: infra-devops
|
||||
spec:
|
||||
chart: oci://registry-1.docker.io/imroc/cert-manager-webhook-dnspod
|
||||
targetNamespace: infra-cert
|
||||
targetNamespace: infra-devops
|
||||
version: 1.4.5
|
||||
valuesContent: |-
|
||||
namespace: infra-cert
|
||||
namespace: infra-devops
|
||||
certManager:
|
||||
namespace: infra-cert
|
||||
namespace: infra-devops
|
||||
groupName: cert.dev.cm
|
||||
clusterIssuer:
|
||||
# 此处需在部署后修改clusterIssuer
|
||||
# cnameStrategy: Follow
|
||||
staging: false
|
||||
email: [email protected]
|
||||
@@ -22,12 +24,12 @@ spec:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
@@ -4,51 +4,51 @@ apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: cert-manager
|
||||
namespace: infra-cert
|
||||
namespace: infra-devops
|
||||
spec:
|
||||
repo: https://charts.jetstack.io
|
||||
chart: cert-manager
|
||||
targetNamespace: infra-cert
|
||||
targetNamespace: infra-devops
|
||||
version: v1.14.4
|
||||
valuesContent: |-
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
webhook:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
cainjector:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
@@ -7,13 +7,35 @@ spec:
|
||||
repo: https://dl.gitea.com/charts
|
||||
chart: gitea
|
||||
targetNamespace: infra-devops
|
||||
version: 10.1.4
|
||||
valuesContent: |-
|
||||
affinity:
|
||||
podAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: cnpg-cluster-sh
|
||||
role: primary
|
||||
app.kubernetes.io/name: redis
|
||||
app.kubernetes.io/component: master
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- preference:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- homea
|
||||
weight: 1
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
postgresql-ha:
|
||||
enabled: false
|
||||
image:
|
||||
tag: 1.21.11
|
||||
tag: 1.22.0
|
||||
gitea:
|
||||
config:
|
||||
APP_NAME: Git.dev.cm
|
||||
@@ -23,19 +45,20 @@ spec:
|
||||
ROOT_URL: https://git.dev.cm/
|
||||
database:
|
||||
DB_TYPE: postgres
|
||||
HOST: postgresql-ha-pgpool.infra-data:5432
|
||||
HOST: cnpg-cluster-sh-rw.infra-data:5432
|
||||
NAME: gitea
|
||||
USER: rohow
|
||||
PASSWD: L#GRtTR2QuL@20pm6+c~
|
||||
USER: app
|
||||
PASSWD: 6UeWq0EEQaP47eMjAt3hmmquGY3e6bqDanCeSKWDmLtLCuMe1TH0UGTKuaw2LfIO
|
||||
SSL_MODE: disable
|
||||
session:
|
||||
PROVIDER: redis
|
||||
PROVIDER_CONFIG: redis://:[email protected]:6379/0
|
||||
PROVIDER_CONFIG: redis://:ribiPwYQNU6GWxCYR0Nj@redis-cluster-sh-master.infra-data:6379/0
|
||||
cache:
|
||||
ADAPTER: redis
|
||||
HOST: redis://:[email protected]:6379/0?pool_size=100&idle_timeout=180s
|
||||
HOST: redis://:ribiPwYQNU6GWxCYR0Nj@redis-cluster-sh-master.infra-data:6379/0?pool_size=100&idle_timeout=180s
|
||||
queue:
|
||||
TYPE: redis
|
||||
CONN_STR: redis://:[email protected]:6379/0
|
||||
CONN_STR: redis://:ribiPwYQNU6GWxCYR0Nj@redis-cluster-sh-master.infra-data:6379/0
|
||||
repository:
|
||||
DEFAULT_REPO_UNITS: repo.code,repo.releases,repo.issues,repo.pulls
|
||||
service:
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-devops
|
||||
@@ -0,0 +1,4 @@
|
||||
### path core中服务的节点亲和性 使他们只运行在master节点上
|
||||
```shell
|
||||
kubectl patch -n kube-system deployment coredns --patch-file=apps/kube/patch-affinity.yaml
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: coredns-custom
|
||||
namespace: kube-system
|
||||
data:
|
||||
local.override: |
|
||||
# 腾讯云内网DNS会将HINFO解析请求返回本机 造成循环 此处直接屏蔽处理
|
||||
template ANY HINFO . {
|
||||
rcode NXDOMAIN
|
||||
}
|
||||
# 不解析IPV6
|
||||
template ANY AAAA {
|
||||
rcode NXDOMAIN
|
||||
}
|
||||
|
||||
local.server: |
|
||||
#
|
||||
@@ -0,0 +1,213 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: node-local-dns
|
||||
namespace: kube-system
|
||||
labels:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kube-dns-upstream
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
kubernetes.io/name: "KubeDNSUpstream"
|
||||
spec:
|
||||
ports:
|
||||
- name: dns
|
||||
port: 53
|
||||
protocol: UDP
|
||||
targetPort: 53
|
||||
- name: dns-tcp
|
||||
port: 53
|
||||
protocol: TCP
|
||||
targetPort: 53
|
||||
selector:
|
||||
k8s-app: kube-dns
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: node-local-dns
|
||||
namespace: kube-system
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
data:
|
||||
Corefile: |
|
||||
# 腾讯云内网DNS会将HINFO解析请求返回本机 造成循环 此处直接屏蔽处理
|
||||
(disableHINFO) {
|
||||
template ANY HINFO . {
|
||||
rcode NXDOMAIN
|
||||
}
|
||||
}
|
||||
cluster.local:53 {
|
||||
errors
|
||||
cache {
|
||||
success 9984 30
|
||||
denial 9984 5
|
||||
}
|
||||
reload
|
||||
loop
|
||||
bind 169.254.20.10 10.43.0.10
|
||||
forward . __PILLAR__CLUSTER__DNS__ {
|
||||
force_tcp
|
||||
}
|
||||
prometheus :9253
|
||||
health 169.254.20.10:8080
|
||||
import disableHINFO
|
||||
}
|
||||
in-addr.arpa:53 {
|
||||
errors
|
||||
cache 30
|
||||
reload
|
||||
loop
|
||||
bind 169.254.20.10 10.43.0.10
|
||||
forward . __PILLAR__CLUSTER__DNS__ {
|
||||
force_tcp
|
||||
}
|
||||
prometheus :9253
|
||||
import disableHINFO
|
||||
}
|
||||
ip6.arpa:53 {
|
||||
errors
|
||||
cache 30
|
||||
reload
|
||||
loop
|
||||
bind 169.254.20.10 10.43.0.10
|
||||
forward . __PILLAR__CLUSTER__DNS__ {
|
||||
force_tcp
|
||||
}
|
||||
prometheus :9253
|
||||
import disableHINFO
|
||||
}
|
||||
.:53 {
|
||||
errors
|
||||
cache 30
|
||||
reload
|
||||
loop
|
||||
bind 169.254.20.10 10.43.0.10
|
||||
forward . __PILLAR__UPSTREAM__SERVERS__
|
||||
prometheus :9253
|
||||
import disableHINFO
|
||||
}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: node-local-dns
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: node-local-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
spec:
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 10%
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: node-local-dns
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: node-local-dns
|
||||
annotations:
|
||||
prometheus.io/port: "9253"
|
||||
prometheus.io/scrape: "true"
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: svccontroller.k3s.cattle.io/enablelb
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
priorityClassName: system-node-critical
|
||||
serviceAccountName: node-local-dns
|
||||
hostNetwork: true
|
||||
dnsPolicy: Default # Don't use cluster DNS.
|
||||
tolerations:
|
||||
- key: "CriticalAddonsOnly"
|
||||
operator: "Exists"
|
||||
- effect: "NoExecute"
|
||||
operator: "Exists"
|
||||
- effect: "NoSchedule"
|
||||
operator: "Exists"
|
||||
containers:
|
||||
- name: node-cache
|
||||
image: registry.k8s.io/dns/k8s-dns-node-cache:1.22.28
|
||||
resources:
|
||||
requests:
|
||||
cpu: 25m
|
||||
memory: 5Mi
|
||||
args: [ "-localip", "169.254.20.10,10.43.0.10", "-conf", "/etc/Corefile", "-upstreamsvc", "kube-dns-upstream" ]
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 53
|
||||
name: dns
|
||||
protocol: UDP
|
||||
- containerPort: 53
|
||||
name: dns-tcp
|
||||
protocol: TCP
|
||||
- containerPort: 9253
|
||||
name: metrics
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
host: 169.254.20.10
|
||||
path: /health
|
||||
port: 8080
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 5
|
||||
volumeMounts:
|
||||
- mountPath: /run/xtables.lock
|
||||
name: xtables-lock
|
||||
readOnly: false
|
||||
- name: config-volume
|
||||
mountPath: /etc/coredns
|
||||
- name: kube-dns-config
|
||||
mountPath: /etc/kube-dns
|
||||
volumes:
|
||||
- name: xtables-lock
|
||||
hostPath:
|
||||
path: /run/xtables.lock
|
||||
type: FileOrCreate
|
||||
- name: kube-dns-config
|
||||
configMap:
|
||||
name: kube-dns
|
||||
optional: true
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: node-local-dns
|
||||
items:
|
||||
- key: Corefile
|
||||
path: Corefile.base
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/port: "9253"
|
||||
prometheus.io/scrape: "true"
|
||||
labels:
|
||||
k8s-app: node-local-dns
|
||||
name: node-local-dns
|
||||
namespace: kube-system
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: metrics
|
||||
port: 9253
|
||||
targetPort: 9253
|
||||
selector:
|
||||
k8s-app: node-local-dns
|
||||
@@ -0,0 +1,13 @@
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/master
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
|
||||
@@ -7,6 +7,7 @@ spec:
|
||||
repo: https://crowdsecurity.github.io/helm-charts
|
||||
chart: crowdsec
|
||||
targetNamespace: infra-monitor
|
||||
version: 0.10.0
|
||||
valuesContent: |-
|
||||
container_runtime: containerd
|
||||
image:
|
||||
@@ -27,16 +28,16 @@ spec:
|
||||
program: nginx
|
||||
poll_without_inotify: true
|
||||
env:
|
||||
- name: COLLECTIONS
|
||||
value: "crowdsecurity/nginx"
|
||||
- name: COLLECTIONS
|
||||
value: "crowdsecurity/nginx"
|
||||
lapi:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
- preference:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- alihka
|
||||
- alihka
|
||||
weight: 1
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-monitor
|
||||
@@ -1,29 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: apps
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-net
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-data
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-cert
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-devops
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-monitor
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: dev-cm-crt
|
||||
namespace: infra-net
|
||||
spec:
|
||||
secretName: dev-cm-crt
|
||||
issuerRef:
|
||||
name: dnspod
|
||||
kind: ClusterIssuer
|
||||
group: cert-manager.io
|
||||
dnsNames:
|
||||
- "dev.cm"
|
||||
- "*.dev.cm"
|
||||
- "*.node.dev.cm"
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: fillcode-com-crt
|
||||
namespace: infra-net
|
||||
spec:
|
||||
secretName: fillcode-com-crt
|
||||
issuerRef:
|
||||
name: dnspod
|
||||
kind: ClusterIssuer
|
||||
group: cert-manager.io
|
||||
dnsNames:
|
||||
- "fillcode.com"
|
||||
- "*.fillcode.com"
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: infra-net
|
||||
@@ -0,0 +1,77 @@
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: ingress-nginx
|
||||
namespace: infra-net
|
||||
spec:
|
||||
repo: https://kubernetes.github.io/ingress-nginx
|
||||
chart: ingress-nginx
|
||||
version: 4.10.0
|
||||
targetNamespace: infra-net
|
||||
valuesContent: |-
|
||||
fullnameOverride: ingress-nginx
|
||||
controller:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: svccontroller.k3s.cattle.io/enablelb
|
||||
operator: In
|
||||
values:
|
||||
- "true"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
kind: DaemonSet
|
||||
dnsPolicy: None
|
||||
dnsConfig:
|
||||
nameservers:
|
||||
- 169.254.20.10
|
||||
- 10.43.0.10
|
||||
hostNetwork: true
|
||||
hostPort:
|
||||
enabled: true
|
||||
service:
|
||||
enabled: false
|
||||
publishService:
|
||||
enabled: false
|
||||
config:
|
||||
use-forwarded-headers: "true"
|
||||
allow-snippet-annotations: "true"
|
||||
http-snippet: |
|
||||
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
|
||||
proxy_cache_key $scheme$proxy_host$request_uri;
|
||||
proxy_cache_lock on;
|
||||
proxy_cache_use_stale updating;
|
||||
server-snippet : |
|
||||
resolver 169.254.20.10 10.43.0.10 ipv6=off;
|
||||
# crowdsec插件配置
|
||||
plugins: "crowdsec"
|
||||
lua-shared-dicts: "crowdsec_cache: 50m"
|
||||
extraArgs:
|
||||
default-ssl-certificate: "infra-net/dev-cm-crt"
|
||||
# crowdsec插件配置
|
||||
extraVolumes:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
emptyDir: {}
|
||||
extraInitContainers:
|
||||
- name: init-clone-crowdsec-bouncer
|
||||
image: devcm/lua-bouncer-plugin
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: API_URL
|
||||
value: "http://crowdsec-service.infra-monitor.svc.cluster.local:8080"
|
||||
- name: API_KEY
|
||||
value: "lkFoJuR7ZPFeaN97wM04EVTUH+icqiSEgXPBXteaMsE"
|
||||
- name: BOUNCER_CONFIG
|
||||
value: "/crowdsec/crowdsec-bouncer.conf"
|
||||
command: ['sh', '-c', "bash /docker_start.sh; mkdir -p /lua_plugins/crowdsec/; cp -R /crowdsec/* /lua_plugins/crowdsec/"]
|
||||
volumeMounts:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
mountPath: /lua_plugins
|
||||
extraVolumeMounts:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
mountPath: /etc/nginx/lua/plugins/crowdsec
|
||||
subPath: crowdsec
|
||||
@@ -1,39 +0,0 @@
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: postgresql-ha
|
||||
namespace: infra-data
|
||||
spec:
|
||||
chart: oci://registry-1.docker.io/bitnamicharts/postgresql-ha
|
||||
targetNamespace: infra-data
|
||||
valuesContent: |-
|
||||
postgresql:
|
||||
image:
|
||||
debug: false
|
||||
username: rohow
|
||||
password: L#GRtTR2QuL@20pm6+c~
|
||||
postgresPassword: L#GRtTR2QuL@20pm6+c~
|
||||
repmgrPassword: yAn0l2eiLw
|
||||
nodeAffinityPreset:
|
||||
type: "hard"
|
||||
key: "topology.kubernetes.io/region"
|
||||
values:
|
||||
- "cn-sh"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
pgpool:
|
||||
image:
|
||||
debug: false
|
||||
adminPassword: wc8FVC55JX
|
||||
nodeAffinityPreset:
|
||||
type: "hard"
|
||||
key: "topology.kubernetes.io/region"
|
||||
values:
|
||||
- "cn-sh"
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
|
||||
在新议题中引用
屏蔽一个用户