hai,
i’m new here for kubernetes, so i’ve a question or need solution for this task… how can i deploy nginx and php-fpm with independent service? because i’ve an issue like this one :
root@development:/opt/docker/docker-cucunguk# kubectl logs nginx-7988c74546-gk54v
2018/10/02 15:22:58 [emerg] 1#1: host not found in upstream “php” in /etc/nginx/conf.d/adminer.conf:17
nginx: [emerg] host not found in upstream “php” in /etc/nginx/conf.d/adminer.conf:17
here my yaml of nginx and php .
NGINX
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: nginx
spec:
containers:
- name: cucunguk-nginx
image: images.registry.codigo.id/cucunguk_nginx:0.1
ports:
- containerPort: 80
- containerPort: 443
volumeMounts:
- mountPath: /opt/www
name: project
workingDir: /opt/www
restartPolicy: Always
imagePullSecrets:
- name: regsecret
volumes:
- name: project
persistentVolumeClaim:
claimName: project
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
ports:
- name: “80”
port: 80
protocol: “TCP”
targetPort: 80- name: “443”
port: 443
protocol: “TCP”
targetPort: 443
selector:
io.kompose.service: nginx
PHP
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
io.kompose.service: php
name: php
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: php
spec:
containers:
- name: cucunguk-php
image: images.registry.codigo.id/cucunguk_php:0.1
ports:
- containerPort: 9000
volumeMounts:
- mountPath: /opt/www
name: project
workingDir: /opt/www
restartPolicy: Always
volumes:
- name: project
persistentVolumeClaim:
claimName: project
imagePullSecrets:
- name: regsecret
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
io.kompose.service: php
name: php
spec:
ports:
- name: “9000”
port: 9000
protocol: “TCP”
targetPort: 9000
selector:
io.kompose.service: php
thanks