Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Ingress - nginx - option to specify path to nginx.tmpl #872

Closed
ajohnstone opened this issue Apr 30, 2016 · 2 comments · Fixed by #766
Closed

Ingress - nginx - option to specify path to nginx.tmpl #872

ajohnstone opened this issue Apr 30, 2016 · 2 comments · Fixed by #766

Comments

@ajohnstone
Copy link
Contributor

ajohnstone commented Apr 30, 2016

The nginx.tmpl is stored in the root of the docker image. It would be ideal to place within a directory and/or specify the path to the nginx.tmpl

An example use case is to override the nginx.tmpl using a configmap.

apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-ingress-controller
  labels:
    k8s-app: nginx-ingress-lb
spec:
  replicas: 1
  selector:
    k8s-app: nginx-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: nginx-ingress-lb
        name: nginx-ingress-lb
    spec:
      terminationGracePeriodSeconds: 60      
      containers:
      - image: gcr.io/google_containers/nginx-ingress-controller:0.5
        name: nginx-ingress-lb
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /healthz
            port: 10249
            scheme: HTTP
          initialDelaySeconds: 30
          timeoutSeconds: 5
        # use downward API
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        ports:
        - containerPort: 80
          hostPort: 80
        - containerPort: 443
          hostPort: 4444
        args:
        - /nginx-ingress-controller
        - --default-backend-service=default/default-http-backend
        volumeMounts:
          - mountPath: /etc/nginx-template-tmpl
            name: nginx-template-volume
            readOnly: true
      volumes:
        - name: nginx-template-volume
          configMap:
            name: nginx
            items:
            - key: nginx.tmpl
              path: nginx.tmpl

Hard coded here.
https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/nginx/template.go#L46

@aledbf
Copy link
Contributor

aledbf commented Apr 30, 2016

@ajohnstone I will move the template to a directory to enable this

@aledbf
Copy link
Contributor

aledbf commented Apr 30, 2016

@ajohnstone done. Is in 766 this commit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants