Commit 31ad6b27 authored by Konstantinos Togias's avatar Konstantinos Togias
Browse files

Run container deployment units and type helm failures in the kubernetes adapter

- The adapter declares the container runtime kind. A container deployment
  unit runs its image from a small chart shipped with the adapter: a
  Deployment, plus a Service for the ports of its compute intent (NodePort
  when a port is external, ClusterIP otherwise).
- Terminating a release helm does not know raises ResourceNotFound.
- A missing helm binary raises DomainExecutionFailed instead of
  FileNotFoundError.
- helm upgrade uses --atomic, like helm install.

Original-Author: Igli <kociaj4@gmail.com>
Reviewed-Commit: b3977281a0167852c3a25940969fcc9ffd2264ba
parent ce70c158
Loading
Loading
Loading
Loading
+1 −1
Changes for pyproject.toml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -68,4 +68,4 @@ markers = [
]

[tool.setuptools.package-data]
openop_tfsdk = ["py.typed"]
openop_tfsdk = ["py.typed", "contract/adapters/charts/container/**/*.yaml"]
+5 −0
Changes for src/openop_tfsdk/contract/adapters/charts/container/Chart.yaml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
apiVersion: v2
name: container
description: Runs one container image as a Deployment, with a Service for its ports.
type: application
version: 0.1.0
+27 −0
Changes for src/openop_tfsdk/contract/adapters/charts/container/templates/deployment.yaml: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
  labels:
    app: {{ .Release.Name }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Release.Name }}
          image: {{ required "image is required" .Values.image | quote }}
          {{- with .Values.ports }}
          ports:
            {{- range . }}
            - name: {{ .name }}
              containerPort: {{ .port }}
              protocol: {{ .protocol }}
            {{- end }}
          {{- end }}
+19 −0
Changes for src/openop_tfsdk/contract/adapters/charts/container/templates/service.yaml: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
{{- if .Values.ports }}
apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
  labels:
    app: {{ .Release.Name }}
spec:
  type: {{ .Values.serviceType }}
  selector:
    app: {{ .Release.Name }}
  ports:
    {{- range .Values.ports }}
    - name: {{ .name }}
      port: {{ .port }}
      targetPort: {{ .port }}
      protocol: {{ .protocol }}
    {{- end }}
{{- end }}
+5 −0
Changes for src/openop_tfsdk/contract/adapters/charts/container/values.yaml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Set by the kubernetes adapter for a deployment unit of runtime type "container".
image: ""
# Each port: {name, port, protocol}.
ports: []
serviceType: ClusterIP
Loading