efk-operator

command module
v0.0.0-...-df6deb5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

efk-operator

Prerequisite

Step 0. kustomize 및 적용

  • 목적 : yaml 파일 생성 및 적용을 위한 kustomize 실행
  • 순서 :
    $ kustomize build config/default/ | kubectl apply -f -
    
  • 비고 :

Flow

  1. 유저가 fluentbitconfiguration 리소스를 생성
  2. efk-operator가 이를 감지하고 그에 해당하는 configmap 생성
  3. injection 하고싶은 리소스에 아래와 같이 두 가지 label을 추가
  • log-collector: enbaled
  • tmax.io/log-collector-configuration: {생성된 configmap 이름}
  1. 해당 리소스 생성시, hypercloud-api-server의 webhook 의해 sidecar injection 됨

예시

  • fluentbitconfiguration
    apiVersion: config.tmax.io/v1alpha1
    kind: FluentBitConfiguration
    metadata:
      name: fbc-test
      namespace: kube-logging
    spec:
      inputPlugins:
      - path: /test/log/
        pattern: "*.log"
        tag: testtag
      filterPlugins:
      - parserName: parser
        regex: .*
        tag: testtag
      outputPlugins:
      - indexName: testtag_prefix
        tag: testtag
    
  • injection for pod
    apiVersion: v1
    kind: Pod
    metadata:
      name: counter
      namespace: kube-logging
      labels:
        log-collector: enabled
        tmax.io/log-collector-configuration: fbc-test
    spec:
      containers:
      - name: count
        image: busybox
        imagePullPolicy: IfNotPresent
        args: [/bin/sh, -c, 'i=0; while true; do echo "$(date)" && sleep 10; i=$(i+1)); done']
        env:
        - name: FLUENT_ELASTICSEARCH_HOST
          value: "elasticsearch.kube-logging.svc.cluster.local"
        - name: FLUENT_ELASTICSEARCH_PORT
          value: "9200"
        - name: FLUENT_ELASTICSEARCH_SCHEME
          value: "http" 
    
  • injection for deployment
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: counter-deploy
      namespace: kube-logging
      labels:
        log-collector: enabled
        tmax.io/log-collector-configuration: fbc-test
    spec:
      replicas: 1
      selector:
        matchLabels:
          kube-logging: injection-test
      template:
        metadata:
          name: counter
          namespace: kube-logging
          labels:
            kube-logging: injection-test
        spec:
          containers:
          - name: count
            image: busybox
            imagePullPolicy: IfNotPresent
            args: [/bin/sh, -c, 'i=0; while true; do echo "$(date)" && sleep 10; i=$((i+1)); done']
            env:
            - name: FLUENT_ELASTICSEARCH_HOST
              value: "elasticsearch.kube-logging.svc.cluster.local"
            - name: FLUENT_ELASTICSEARCH_PORT
              value: "9200"
            - name: FLUENT_ELASTICSEARCH_SCHEME
              value: "http"
    

참고

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group +kubebuilder:object:generate=true +groupName=config.tmax.io
Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group +kubebuilder:object:generate=true +groupName=config.tmax.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL