Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat: Reimplement service with go-sdk (#88)
Browse files Browse the repository at this point in the history
* feat: Reimplement service with go-sdk

Signed-off-by: TannerGabriel <[email protected]>

* Change go-utils version to 0.18 release

Signed-off-by: TannerGabriel <[email protected]>

* Comment exported variables

Signed-off-by: TannerGabriel <[email protected]>
  • Loading branch information
TannerGabriel authored Aug 3, 2022
1 parent 3971367 commit 17e0529
Show file tree
Hide file tree
Showing 7 changed files with 341 additions and 1,083 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Future versions of this service may support additional integrations with other c
| 0.13.x | keptncontrib/argo-service:0.9.3 |
| 0.14.x | keptncontrib/argo-service:0.9.4 |
| 0.17.x | keptncontrib/argo-service:0.9.5 |

| 0.18.x | keptncontrib/argo-service:0.9.6 |

## Argo Rollout Support Explained

Expand Down
129 changes: 42 additions & 87 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,97 +32,52 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
livenessProbe:
httpGet:
path: /health
port: 8080
readinessProbe:
httpGet:
path: /ready
port: 8080
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- containerPort: 80
env:
- name: env
value: 'production'
- name: PUBSUB_TOPIC
value: {{ ((.Values).subscription).pubsubTopic | default "sh.keptn.>" }}
- name: K8S_DEPLOYMENT_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/name'']'
- name: K8S_DEPLOYMENT_VERSION
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/version'']'
- name: K8S_DEPLOYMENT_COMPONENT
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/component'']'
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
{{- if .Values.remoteControlPlane.enabled }}
- name: KEPTN_API_ENDPOINT
value: "{{ .Values.remoteControlPlane.api.protocol }}://{{ .Values.remoteControlPlane.api.hostname }}/api"
- name: KEPTN_API_TOKEN
value: "{{ .Values.remoteControlPlane.api.token }}"
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
- name: distributor
image: "{{ .Values.distributor.image.repository }}:{{ .Values.distributor.image.tag | default .Chart.AppVersion }}"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 0
periodSeconds: 5
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
imagePullPolicy: {{ .Values.distributor.image.pullPolicy }}
ports:
- containerPort: 8080
resources:
requests:
memory: "16Mi"
cpu: "25m"
limits:
memory: "32Mi"
cpu: "100m"
env:
- name: PUBSUB_URL
value: 'nats://keptn-nats'
- name: PUBSUB_TOPIC
value: 'sh.keptn.event.release.triggered,sh.keptn.event.rollback.triggered,sh.keptn.event.test.triggered'
- name: PUBSUB_RECIPIENT
value: '127.0.0.1'
- name: STAGE_FILTER
value: "{{ .Values.distributor.stageFilter }}"
- name: PROJECT_FILTER
value: "{{ .Values.distributor.projectFilter }}"
- name: SERVICE_FILTER
value: "{{ .Values.distributor.serviceFilter }}"
- name: DISTRIBUTOR_VERSION
value: {{ .Values.distributor.image.tag | default .Chart.AppVersion }}
- name: VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/version']
- name: LOCATION
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: K8S_DEPLOYMENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/name']
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- if .Values.remoteControlPlane.enabled }}
- name: KEPTN_API_ENDPOINT
value: "{{ .Values.remoteControlPlane.api.protocol }}://{{ .Values.remoteControlPlane.api.hostname }}/api"
- name: KEPTN_API_TOKEN
value: "{{ .Values.remoteControlPlane.api.token }}"
- name: HTTP_SSL_VERIFY
{{- $apiValidateTls := .Values.remoteControlPlane.api.apiValidateTls | ternary "true" "false" }}
value: "{{ $apiValidateTls }}"
{{- end }}
- name: PUBSUB_GROUP
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/name']

{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
14 changes: 4 additions & 10 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

distributor:
stageFilter: "" # Sets the stage this helm service belongs to
serviceFilter: "" # Sets the service this helm service belongs to
projectFilter: "" # Sets the project this helm service belongs to
image:
repository: docker.io/keptn/distributor # Container Image Name
pullPolicy: IfNotPresent # Kubernetes Image Pull Policy
tag: "0.17.0" # Container Tag
subscription:
pubsubTopic: "sh.keptn.>" # Sets the events the service subscribes to

remoteControlPlane:
enabled: false # Enables remote execution plane mode
api:
protocol: "https" # Used Protocol (http, https)
hostname: "" # Hostname of the control plane cluster (and Port)
protocol: "http" # Used Protocol (http, https)
hostname: "api-gateway-nginx.keptn" # Hostname of the control plane cluster (and Port)
apiValidateTls: true # Defines if the control plane certificate should be validated
token: "" # Keptn API Token

Expand Down
Loading

0 comments on commit 17e0529

Please sign in to comment.