Kubernetes

Содержание
  1. Тестовый пример

Тестовый пример

Можно использовать для тестов

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
   app: nginx
spec:
 replicas: 3
 selector:
   matchLabels:
    app: nginx
 template:
   metadata:
    labels:
      app: nginx
   spec:
    containers:
     - name: nginx
       image: nginx:stable
       ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
 name: nginx
spec:
 selector: 
  app: nginx
 ports:
  - protocol: TCP
    port: 80
    targetPort: 80
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
 name: nginx
 annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: dev.example.com
    http:
       paths:
       - path: /
         backend:
           serviceName: nginx
           servicePort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: monitoring
  namespace: monitoring
  annotations:
    ingress.kubernetes.io/rewrite-target: "/"
spec:
  rules:
  - host: dev-rnd.usetech.local
    http:
      paths:
      - backend:
          serviceName: prometheus-k8s
          servicePort: 9090
        path: /prometheus
      - backend:
          serviceName: alertmanager-main
          servicePort: 9093
        path: /alertmanager
      - backend:
          serviceName: grafana
          servicePort: 3000
        path: /grafana
Поделиться
Отправить