--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nginx-alpine-ingress annotations: cert-manager.io/cluster-issuer: "cm-cf" kubernetes.io/ingress.class: "traefik" spec: rules: - host: as.107421.xyz http: paths: - path: / pathType: Prefix backend: service: name: nginx-alpine-svc port: number: 8080 tls: - hosts: - as.107421.xyz secretName: as.107421.xyz-tls --- kind: Service apiVersion: v1 metadata: name: nginx-alpine-svc namespace: default spec: selector: app: nginx-alpine-test type: NodePort ports: - port: 8080 nodePort: 19500 targetPort: 80 name: web-http --- kind: Deployment apiVersion: apps/v1 metadata: name: nginx-alpine-test namespace: default spec: selector: matchLabels: app: nginx-alpine-test replicas: 1 template: metadata: labels: app: nginx-alpine-test spec: nodeSelector: location: tokyo containers: - name: nginx-apline image: nginx:alpine imagePullPolicy: IfNotPresent ports: - containerPort: 80 name: web-http env: - name: Pod_Name valueFrom: fieldRef: fieldPath: metadata.name - name: Pod_IP valueFrom: fieldRef: fieldPath: status.podIP - name: MY_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName command: - /bin/sh - -c args: - echo "

Pod Name is =${Pod_Name}

" >/usr/share/nginx/html/index.html; echo "

Pod IP is = ${Pod_IP}

" >>/usr/share/nginx/html/index.html; echo "

The Pod IP Adrress is = ${Pod_IP}

" >>/usr/share/nginx/html/index.html; echo "

Pod is running in Node = ${MY_NODE_NAME}

" >>/usr/share/nginx/html/index.html; echo "

Nginx version is = ${NGINX_VERSION}

">>/usr/share/nginx/html/index.html; nginx -g "daemon off;"; volumes: - name: nginx-index-html emptyDir: {}