Skip to content

Instantly share code, notes, and snippets.

@gintsgints
Last active October 19, 2019 07:33
Show Gist options
  • Save gintsgints/222c6244bca23a8f2392a647a0d88076 to your computer and use it in GitHub Desktop.
Save gintsgints/222c6244bca23a8f2392a647a0d88076 to your computer and use it in GitHub Desktop.

Deployment -> Service -> Ingress

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: attachment
  name: server
spec:
  replicas: 1
  strategy: 
    type: Recreate
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: attachment
      annotations:
        commit: "{{ $.Values.commit }}"
    spec:
      imagePullSecrets:
        - name: onlinereg
      containers:
      - env:
        - name: API_HOST
          value: localhost
        - name: API_PORT
          value: "3001"
        - name: NODE_ENV
          value: {{ $.Values.nodeEnv }}
        - name: SECRET
          value: my_app_great_secret
        - name: FILE_STORAGE 
          value: "/storage"
        - name: TYPEORM_CONNECTION
          value: postgres
        - name: TYPEORM_DATABASE
          value: postgres
        - name: TYPEORM_HOST
          value: {{ template "helm.fullname" . }}-attach-db
        - name: TYPEORM_LOGGING
          value: "true"
        - name: TYPEORM_MIGRATIONS
          value: src/migrations/*.js
        image: {{ $.Values.image.name }}:{{ $.Values.tag }}
        name: attachment
        ports:
        - containerPort: 3001
        resources: {}
      restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: attachment
  name: {{ template "helm.fullname" . }}
spec:
  ports:
  - name: "3001"
    port: 3001
    targetPort: 3001
  selector:
    io.kompose.service: attachment
status:
  loadBalancer: {}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: attachments
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
    - host: attachments.dev.balcia.com
      http:
        paths:
          - path: /
            backend:
              serviceName: attachments-nuxt-attach
              servicePort: 3001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment