sample

mail@pastecode.io avatar
unknown
yaml
2 years ago
1.5 kB
26
Indexable
Never
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myads-api
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myads-api
  template:
    metadata:
      labels:
        app: myads-api
    spec:
      containers:
      - name: myads-api
        image: myads-api:8.9.7
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
          name: "http"
        resources:
          limits:
            memory: 2Gi
            cpu: "2"
          requests:
            memory: 250Mi
            cpu: "0.1"
---
apiVersion: v1
kind: Service
metadata:
  labels:
  name: myads-api
  namespace: default
spec:
  selector:
    app: myads-api
  ports:
  - name: web
    protocol: TCP
    port: 80
    targetPort: 80
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: myads-api
  namespace: default
spec:
  ingressClassName: nginx
  rules:
  - host: myadscmspapp1
    http:
      paths:
      - path: /
        backend:
          serviceName: myads-api
          servicePort: 80
  - host: skooner
    http:
      paths:
      - path: /
        backend:
          serviceName: myads-api
          servicePort: 80
  
---
  apiVersion: autoscaling/v1
  kind: HorizontalPodAutoscaler
  metadata:
    name: myads-api
    namespace: default
  spec:
    scaleTargetRef:
      apiVersion: apps/v1
      kind: Deployment
      name: myads-api
    minReplicas: 2
    maxReplicas: 4
    targetCPUUtilizationPercentage: 50