Coder Social home page Coder Social logo

Comments (10)

kahootali avatar kahootali commented on July 26, 2024 1

Is Reloader running globally? If not, make sure the deployments are running in same namespace as that of reloader. And secondly, make sure both the deployments have the reloader annotation.

from reloader.

loknathsingh avatar loknathsingh commented on July 26, 2024 1

@kahootali Thank you and your team.
It working fine as per our Requirment.

from reloader.

kahootali avatar kahootali commented on July 26, 2024

@loknathsingh can you please share the k8s version and reloader version, you are using? And can you kindly format the Deployment and Configmap template above.

from reloader.

loknathsingh avatar loknathsingh commented on July 26, 2024

k8s version :v1.11.3

from reloader.

loknathsingh avatar loknathsingh commented on July 26, 2024

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
annotations:
configmap.reloader.stakater.com/reload: "nginx-configmap"
spec:
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:

  • name: nginx
    image: nginx
    ports:
  • containerPort: 80
    volumeMounts:
  • name: nginx-config1
    mountPath: /etc/nginx/conf.d/default.conf
    subPath: default.conf
    volumes:
  • name: nginx-config1
    configMap:
    name: nginx-configmap

from reloader.

kahootali avatar kahootali commented on July 26, 2024

@loknathsingh I have tested it with following config, it is working fine.

apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
  annotations:
    configmap.reloader.stakater.com/reload: "nginx-configmap"
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
  annotations:
    configmap.reloader.stakater.com/reload: "nginx-configmap"
  spec:
    selector:
      matchLabels:
      app: nginx
    replicas: 3
    template:
      metadata:
        labels:
          app: nginx
        spec:
          containers:
            name: nginx
            image: nginx
            ports:
              containerPort: 80
            volumeMounts:
              name: nginx-config1
              mountPath: /etc/nginx/conf.d/default.conf
              subPath: default.conf
    volumes:
      name: nginx-config1
      configMap:
        name: nginx-configmap
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-configmap
  namespace: default
data:
  default.conf: |
    upstream backend {
      server 172.27.15.8:8081;
      server 192.0.0.1 backup;
      }
    server {
        location / {
            proxy_pass http://backend;
        }
    }

from reloader.

kahootali avatar kahootali commented on July 26, 2024

@loknathsingh kindly try again and let us know, I am closing the issue for now, feel free to open again if you face any issue

from reloader.

loknathsingh avatar loknathsingh commented on July 26, 2024

@kahootali our requirement is to Restart pods when we make any changes in configmap using reloader.
and we are getting this but in only one deployment. not in other...
I am sharing logs of that.............
time="2019-01-24T08:26:13Z" level=info msg="Changes detected in nginx-configmap of type 'CONFIGMAP' in namespace: default"
time="2019-01-24T08:26:14Z" level=info msg="Updated nginx-deployment of type Deployment in namespace: default "
time="2019-01-24T08:38:40Z" level=info msg="Changes detected in filebeat-config-map of type 'CONFIGMAP' in namespace: default"
time="2019-01-24T08:38:40Z" level=info msg="Updated ddddm-filebeat of type Deployment in namespace: default "
time="2019-01-24T08:43:36Z" level=info msg="Changes detected in filebeat-config-map of type 'CONFIGMAP' in namespace: default"
time="2019-01-24T08:43:36Z" level=info msg="Updated ddm-filebeat of type Deployment in namespace: default "
time="2019-01-24T09:31:44Z" level=info msg="Changes detected in serviceconfig-config-map of type 'CONFIGMAP' in namespace: default

from reloader.

kahootali avatar kahootali commented on July 26, 2024

What do you mean by

we are getting this but in only one deployment. not in other...

In logs above, it shows that it has updated nginx-deployment as well as ddddm-filebeat.

from reloader.

loknathsingh avatar loknathsingh commented on July 26, 2024

@kahootali i am having around 15 deployment.yaml file and 23 configmap.yaml. so when we make any changes in a filebeat-configmap file then that changes get updated in Deployment file and filebeat pods Get restarted. but when we when we are making any changes in another configmap file of other service. then the pod related to that service should Restart but..its not happing...
so I would like to know that is there any solutio to restart The Pods whenever we make any changes in configmap.

from reloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.