Commit a11c0851 authored by Mike Roy's avatar Mike Roy Committed by Michel Roy
Browse files

add user sandbox swagger

parent 2f6a6013
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
{{- if .Values.altIngress.enabled -}}
{{- $serviceName := include "meep-sandbox-ctrl.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $servicePort := .Values.altService.port -}}
{{- $path := .Values.altIngress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
@@ -26,7 +26,7 @@ spec:
          {{- range $path := .paths }}
          - path: {{ $path }}
            backend:
              serviceName: {{ $serviceName }}
              serviceName: {{ $serviceName }}-alt
              servicePort: {{ $servicePort }}
          {{- end -}}
      {{- if .name }}
+24 −0
Original line number Diff line number Diff line
{{- if .Values.altService.enabled}}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "meep-sandbox-ctrl.fullname" . }}-alt
  labels:
    app: {{ template "meep-sandbox-ctrl.name" . }}
    chart: {{ template "meep-sandbox-ctrl.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
    meepOrigin: {{ .Values.meepOrigin }}
spec:
  type: {{ .Values.altService.type }}
  selector:
    app: {{ template "meep-sandbox-ctrl.name" . }}
    release: {{ .Release.Name }}
    meepOrigin: {{ .Values.meepOrigin }}
  ports:
    - port: {{ .Values.altService.port }}
      targetPort: {{ .Values.deployment.altPort }}
      {{- if .Values.altService.nodePort }}
      nodePort: {{ .Values.altService.nodePort }}
      {{- end }}
{{- end}}
+26 −5
Original line number Diff line number Diff line
@@ -22,12 +22,20 @@ spec:
        meepOrigin: {{ .Values.meepOrigin }}
    spec:
      serviceAccountName: {{ .Values.serviceAccount }}
      {{- if .Values.codecov.enabled}}
      volumes:
      {{- if .Values.codecov.enabled}}
        - name: codecov-storage
          persistentVolumeClaim:
            claimName: meep-sandbox-ctrl-codecov-pvc
      {{- end}}
      {{- if .Values.user.swagger.enabled}}
        - name: user-swagger
          hostPath:
            # directory location on host
            path: {{ .Values.user.swagger.location }}
            # this field is optional
            type: DirectoryOrCreate
      {{- end}}
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@@ -44,14 +52,27 @@ spec:
            - name: {{ $key }}
              value: {{ $value }}
            {{- end }}
          {{- if .Values.codecov.enabled}}
            {{- if .Values.user.swagger.enabled}}
            - name: USER_SWAGGER
              value: {{ .Values.user.swagger.mountpath }}
            - name: USER_SWAGGER_SANDBOX
              value: {{ .Values.user.swagger.servepath }}
            {{- end }}
            {{- if .Values.altService.enabled}}
            - name: ALT_SERVICE_PORT
              value: "{{ .Values.deployment.altPort }}"
            {{- end}}
          volumeMounts:
          {{- if .Values.codecov.enabled}}
            - name: codecov-storage
              mountPath: /codecov
          {{- end}}
          {{- if .Values.user.swagger.enabled}}
            - name: user-swagger
              mountPath: {{ .Values.user.swagger.mountpath }}
          {{- end}}
      terminationGracePeriodSeconds: 5
      {{- if .Values.affinity }}
      affinity:
{{ toYaml .Values.affinity | indent 8 }}
      {{- end }}
+14 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ deployment:
  replicas: 1
  port: 80
  protocol: TCP
  altPort: 8080


affinity:
  nodeAffinity:
@@ -29,6 +31,12 @@ service:
  type: ClusterIP
  port: 80

# secondary server
altService:
  enabled: {{ .AltServer }}
  type: ClusterIP
  port: 8080

ingress:
  enabled: true
  # Used to create an Ingress record.
@@ -76,6 +84,12 @@ altIngress:
    #   hosts:
    #     - chart-example.local

user:
  swagger:
    enabled: {{ .UserSwagger }}
    location: {{ .UserSwaggerDir }}
    mountpath: "/user-swagger"
    servepath: "/user-swagger-sandbox"
codecov:
  enabled: false

+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ image:
    MEEP_SANDBOX_PODS: ""
    MEEP_HOST_URL: "http://www.example.com"
    MEEP_ALT_SERVER: "false"
    MEEP_USER_SWAGGER: "false"
    MEEP_USER_SWAGGER_DIR: "/path/to/user/swagger"

service:
  type: ClusterIP
Loading