configMap簡單理解 + operator的理解


1.簡單例子-configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: demo-wpp-configmap
data:
  mysql_host: "106.14.13.62"

2.包含配置文件的configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  labels:
    k8s-app: filebeat
data:
  filebeat.yml: |-
    filebeat.prospectors:
    - type: log
      paths:
        - /logdata/*.log
      tail_files: true
      fields:
        pod_name: '${pod_name}'
        POD_IP: '${POD_IP}'
    output.file:
      path: "/tmp/filebeat"
      filename: filebeat
      codec.format:
        string: '%{[@timestamp]} %{[message]} pod_name %{[fields][pod_name]} %{[fields][POD_IP]}'

3.作為volume掛載使用    

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx-configmap
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx-configmap
    spec:
      containers:
      - name: nginx-configmap
        image: nginx
        ports:
        - containerPort: 80
        volumeMounts:     
        - name: config-volume4
          mountPath: /tmp/config4
      volumes:
      - name: config-volume4
        configMap:
          name: test-config4
————————————————
https://blog.csdn.net/liukuan73/article/details/79492374
-------------------------------------------------------------
把configmap當作一個卷

 

 
         

 https://blog.csdn.net/engchina/article/details/88531358


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM