Update
This commit is contained in:
2
k8s/doctl-kubernetes.sh
Normal file
2
k8s/doctl-kubernetes.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
doctl kubernetes cluster create mind-cluster --region=nyc3 --auto-upgrade=true --node-pool="name=mind;size=s-4vcpu-8gb-amd;count=1;auto-scale=true;min-nodes=1;max-nodes=6" --vpc-uuid="07c765e8-961b-4ee6-90da-b1380a001f8c"
|
||||
|
||||
8
k8s/fluentd/1 - cluster-role.yaml
Normal file
8
k8s/fluentd/1 - cluster-role.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: fluentd-cluster-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods", "namespaces"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
12
k8s/fluentd/2 - cluster-role-binding.yaml
Normal file
12
k8s/fluentd/2 - cluster-role-binding.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: fluentd-cluster-role-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: fluentd-cluster-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: kube-system
|
||||
46
k8s/fluentd/3 - config-map.yaml
Normal file
46
k8s/fluentd/3 - config-map.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: fluent-conf
|
||||
namespace: kube-system
|
||||
data:
|
||||
fluent.conf: |
|
||||
<source>
|
||||
@type tail
|
||||
path /var/log/containers/*.log
|
||||
pos_file /var/log/containers.log.pos
|
||||
tag kubernetes.*
|
||||
format /^(?<time>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z) (?<stream>stdout|stderr) (?<log>.*)$/
|
||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||
read_from_head true
|
||||
keep_time_key true
|
||||
exclude_path ["/var/log/containers/fluentd-*.log"]
|
||||
</source>
|
||||
|
||||
<filter kubernetes.**>
|
||||
@type record_transformer
|
||||
enable_ruby true
|
||||
<record>
|
||||
log ${record["log"].gsub(/\\+/, "").gsub(/^F /, "")} # Elimina escapes y el prefijo "F "
|
||||
</record>
|
||||
</filter>
|
||||
|
||||
<filter kubernetes.**>
|
||||
@type kubernetes_metadata
|
||||
#@type stdout
|
||||
</filter>
|
||||
|
||||
<match kubernetes.**>
|
||||
@type remote_syslog
|
||||
host nblsrv.mind.brm.co
|
||||
port 5513
|
||||
protocol udp
|
||||
tls false
|
||||
tls_verify false
|
||||
<buffer>
|
||||
@type memory
|
||||
flush_interval 10s
|
||||
chunk_limit_size 1MB
|
||||
queue_limit_length 1024
|
||||
</buffer>
|
||||
</match>
|
||||
57
k8s/fluentd/3 - deployment-fluentd.yaml
Normal file
57
k8s/fluentd/3 - deployment-fluentd.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: fluentd
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: fluentd-logging
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
name: fluentd
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: fluentd
|
||||
spec:
|
||||
containers:
|
||||
- name: fluentd
|
||||
image: fluent/fluentd-kubernetes-daemonset:v1-debian-syslog
|
||||
env:
|
||||
- name: FLUENT_SYSLOG_HOST
|
||||
value: "nblsrv.mind.brm.co" # Dirección del servidor syslog
|
||||
- name: FLUENT_SYSLOG_PORT
|
||||
value: "516" # Puerto del servidor syslog
|
||||
- name: FLUENT_SYSLOG_PROTOCOL
|
||||
value: "tcp" # Protocolo (tcp, udp o tls)
|
||||
- name: FLUENT_SYSLOG_TLS
|
||||
value: "false" # Habilitar TLS (true/false)
|
||||
#- name: FLUENT_SYSLOG_TLS_VERIFY
|
||||
# value: "false" # Verificar certificado TLS (true/false)
|
||||
# - name: FLUENT_SYSLOG_TLS_CERT_PATH
|
||||
# value: "/path/to/cert.pem" # Ruta al certificado TLS (opcional)
|
||||
# - name: FLUENT_SYSLOG_TLS_KEY_PATH
|
||||
# value: "/path/to/key.pem" # Ruta a la clave privada TLS (opcional)
|
||||
# - name: FLUENT_SYSLOG_TLS_CA_PATH
|
||||
# value: "/path/to/ca.pem" # Ruta al certificado de la CA (opcional)
|
||||
volumeMounts:
|
||||
- name: varlog
|
||||
mountPath: /var/log
|
||||
- name: varlibdockercontainers
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
- name: fluent-conf
|
||||
mountPath: /fluentd/etc/fluent.conf
|
||||
subPath: fluent.conf
|
||||
imagePullSecrets:
|
||||
- name: ofront-gitlab-img
|
||||
volumes:
|
||||
- name: varlog
|
||||
hostPath:
|
||||
path: /var/log
|
||||
- name: varlibdockercontainers
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
- name: fluent-conf
|
||||
configMap:
|
||||
name: fluent-conf
|
||||
2
k8s/ingress-nginx/ingress-nginx.sh
Normal file
2
k8s/ingress-nginx/ingress-nginx.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
kubectl create ns ingress-nginx
|
||||
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx -f nginx-values.yaml
|
||||
13
k8s/ingress-nginx/nginx-values.yaml
Normal file
13
k8s/ingress-nginx/nginx-values.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
controller:
|
||||
allowSnippetAnnotations: "true"
|
||||
replicaCount: 2
|
||||
config:
|
||||
use-forwarded-headers: true
|
||||
resources:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 150Mi
|
||||
service:
|
||||
annotations:
|
||||
service.beta.kubernetes.io/do-loadbalancer-name: "bop.local"
|
||||
service.beta.kubernetes.io/do-loadbalancer-network: "INTERNAL"
|
||||
Reference in New Issue
Block a user