Bringing up Nginx server with update its config and getting “default.conf is not a file or does not exist”

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

​ I am trying to deploy an nginx server in Kubernetes. I am just trying to get a server up and look at it through a loadbalancer while also being able to modify the nginx config. Using the below configuration I can not get the nginx webserver pod to start. $ kubectl get pods NAME READY STATUS RESTARTS AGE nginx-696c84fd7b-dr9hv 0/1 Error 3 55s looking at the pod log I get the following: $ kubectl logs nginx-696c84fd7b-dr9hv /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: /etc/nginx/conf.d/default.conf is not a file or does not exist, exiting /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2020/06/30 22:52:03 [emerg] 1#1: no “events” section in configuration nginx: [emerg] no “events” section in configuration I assume I am doing something wrong with the config. Do I need to change it to overwrite the or create the default.conf? FYI – This is coming up in an AWS EKS cluster. Here is the entire yaml I am launching using “kubectl create -f nginx_deployment.yaml”: apiVersion: v1 kind: ConfigMap metadata: name: nginx-conf data: nginx.conf: | http { server { location / { return 200 ‘Eureka!!’; add_header Content-Type text/plain; } } } — apiVersion: apps/v1beta1 kind: Deployment metadata: name: nginx spec: replicas: 1 template: metadata: labels: app: nginx spec: containers: – name: nginx image: nginx ports: – containerPort: 80 volumeMounts: – mountPath: /etc/nginx # mount nginx-conf volumn to /etc/nginx readOnly: true name: nginx-conf volumes: – name: nginx-conf configMap: name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx items: – key: nginx.conf path: nginx.conf – name: log emptyDir: {} — apiVersion: v1 kind: Service metadata: name: nginx spec: type: LoadBalancer ports: – port: 80 targetPort: 80 selector: app: nginx submitted by /u/ernievd [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

Containerize and orchestrating application

Wed Jul 1 , 2020
Spread the love          Does anyone here containerize and orchestrate applications via Kubernetes on the side? For the past several years, I have been working to do just that for my employer, but it recently occurred to me that I might be able to consult or contract for other companies who want […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM