Skip to content

Instantly share code, notes, and snippets.

@phineas0fog phineas0fog/k8s.md Secret
Created Aug 16, 2018

Embed
What would you like to do?

Voila les fichiers que j'ai utilisé

nginx-service-nodeport.yaml

apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
spec:
  type: NodePort
  ports:
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP
  - name: https
    port: 443
    targetPort: 443
    protocol: TCP
  externalIPs:
    - 192.168.1.221
    - 192.168.1.222
  selector:
    app: ingress-nginx

Fichier avec le dep de mon app, service etc

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: domaine-fr
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: domaine-fr
    spec:
      containers:
        - name: domaine-fr
          image: mon_image

---
apiVersion: v1
kind: Service
metadata:
  name: domaine-fr-service
  labels:
    app: domaine-fr
spec:
  ports:
    - protocol: TCP
      port: 80
  type: NodePort
  selector:
    app: domaine-fr

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/tls-acme: "true"
    kubernetes.io/ingress.class: nginx
  name: domaine-fr-ingress
spec:
  tls:
  - hosts:
    - domaine.fr
    secretName: domaine-fr-tls
  rules:
  - host: domaine.fr
    http:
      paths:
        - path: /
          backend:
            serviceName: domaine-fr-service
            servicePort: 80

---
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
  name: domaine-fr
  namespace: default
spec:
  secretName: domaine-fr-tls
  issuerRef:
    name: letsencrypt-prod-cluster-issuer
    kind: ClusterIssuer
  commonName: domaine.fr
  acme:
    config:
    - http01: {}
      domains:
      - domaine.fr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.