Rancher中创建配置映射

       Rancher中ConfigMap使用实例

        Rancher中ConfigMap使用实例

       默认不是以配置文件的方式存储  而是把每一个配置项当成一个独立的文件来存储

       把所有的配置项目存到一个配置文件中

        Rancher中ConfigMap使用实例

         Rancher中ConfigMap使用实例

            Rancher中ConfigMap使用实例

            把整个文件作为一个配置映射到容器中

把properties或者其他程序的配置文件映射到容器里

   1.创建一个configmap资源

       configmap的key自定义一个名称  value就是整个配置文件的内容

        Rancher中ConfigMap使用实例

     2.把configmap资源以卷的形式挂载到容器指定的目录下

        Rancher中ConfigMap使用实例

        挂载到容器的绝对路径是 /kafka/config2/kafka.properties 

     3.启动应用的时候指定配置文件路径

       ENTRYPOINT ["/bin/bash","/kafka/bin/kafka-server-start.sh","/kafka/config2/kafka.properties"]

       Rancher中ConfigMap使用实例

  配置文件中如何指定监听的IP地址

      1.如果是主机的IP 则直接填写主机的IP即可  因为宿主机的IP地址一般很少变化

      2.如果把配置文件映射到容器中 由于容器每次重启后自身的IP就会发生变化  无法指定一个具体的IP地址 这个时候可以用0.0.0.0这个IP来代表所有的IP地址

      Rancher中ConfigMap使用实例

    启动容器成功并且通过外部IP可以访问服务

   容器中启动flink

            flink会启动两个子进程  1.jobmanager   2.taskmanager

         Rancher中ConfigMap使用实例

 

         Rancher中ConfigMap使用实例

         Rancher中ConfigMap使用实例

          Rancher中ConfigMap使用实例

          Rancher中ConfigMap使用实例

          Rancher中ConfigMap使用实例

    主机和容器之间进行目录映射

        Rancher中ConfigMap使用实例

 ConfigMap动态注入配置

        Rancher中ConfigMap使用实例      

相关文章:

  • 2022-03-08
  • 2021-07-20
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-08-07
  • 2021-06-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
相关资源
相似解决方案