Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save haysclark/bc2c3e4dd5e4122bc468e2258d7a55c8 to your computer and use it in GitHub Desktop.

Select an option

Save haysclark/bc2c3e4dd5e4122bc468e2258d7a55c8 to your computer and use it in GitHub Desktop.

Revisions

  1. haysclark revised this gist Mar 8, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion preview_values.yaml.gotoml
    Original file line number Diff line number Diff line change
    @@ -9,10 +9,11 @@ image:

    deploymentAnnotations:
    osiris.dm.gg/enableScaling: "true"
    osiris.dm.gg/metricsCheckInterval: "120"
    podAnnotations:
    osiris.dm.gg/collectMetrics: "true"
    service:
    annotations:
    osiris.dm.gg/manageEndpoints: "true"
    osiris.dm.gg/deployment: '{{"{{ template \"fullname\" . }}"}}'
    fabric8.io/exposeHostNameAs: osiris.deislabs.io/ingressHostname
    osiris.dm.gg/loadBalancerHostname: '{{"{{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}"}}'
  2. haysclark revised this gist Mar 4, 2022. No changes.
  3. haysclark created this gist Mar 4, 2022.
    85 changes: 85 additions & 0 deletions charts_PROJECT-NAME_templates_deployment.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    {{- if .Values.knativeDeploy }}
    {{- else }}
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: {{ template "fullname" . }}
    labels:
    draft: {{ default "draft-app" .Values.draft }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    {{- if .Values.deploymentLabels }}
    {{ toYaml .Values.deploymentLabels | indent 4 }}
    {{- end }}
    {{- if .Values.deploymentAnnotations }}
    {{- with .Values.deploymentAnnotations }}
    annotations:
    {{ tpl (toYaml .) $ | trim | indent 4 }}
    {{- end }}
    {{- end }}
    spec:
    selector:
    matchLabels:
    app: {{ template "fullname" . }}
    {{- if .Values.hpa.enabled }}
    {{- else }}
    replicas: {{ .Values.replicaCount }}
    {{- end }}
    template:
    metadata:
    labels:
    draft: {{ default "draft-app" .Values.draft }}
    app: {{ template "fullname" . }}
    {{- if .Values.podsLabels }}
    {{ toYaml .Values.podsLabels | indent 6 }}
    {{- end }}
    {{- if .Values.podAnnotations }}
    annotations:
    {{ toYaml .Values.podAnnotations | indent 8 }}
    {{- end }}
    spec:
    {{- if .Values.serviceAccount.enabled }}
    {{- if .Values.serviceAccount.name }}
    serviceAccountName: {{ .Values.serviceAccount.name }}
    {{- else }}
    serviceAccountName: {{ template "fullname" . }}
    {{- end }}
    {{- end }}
    containers:
    - name: {{ .Chart.Name }}
    image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
    imagePullPolicy: {{ .Values.image.pullPolicy }}
    env:
    - name: VERSION
    value: {{ .Chart.Version }}
    {{- range $pkey, $pval := .Values.env }}
    - name: {{ $pkey }}
    value: {{ quote $pval }}
    {{- end }}
    envFrom:
    {{ toYaml .Values.envFrom | indent 10 }}
    ports:
    - name: http
    containerPort: {{ .Values.service.internalPort }}
    livenessProbe:
    httpGet:
    path: {{ .Values.livenessProbe.probePath | default .Values.probePath }}
    port: {{ .Values.service.internalPort }}
    initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
    periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
    successThreshold: {{ .Values.livenessProbe.successThreshold }}
    timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
    readinessProbe:
    httpGet:
    path: {{ .Values.readinessProbe.probePath | default .Values.probePath }}
    port: {{ .Values.service.internalPort }}
    periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
    successThreshold: {{ .Values.readinessProbe.successThreshold }}
    timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
    resources:
    {{ toYaml .Values.resources | indent 12 }}
    terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
    imagePullSecrets:
    {{- range $pval := .Values.jx.imagePullSecrets }}
    - name: {{ quote $pval }}
    {{- end }}
    {{- end }}
    31 changes: 31 additions & 0 deletions charts_PROJECT-NAME_templates_service.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    {{- if or .Values.knativeDeploy .Values.canary.enabled }}
    {{- else }}
    apiVersion: v1
    kind: Service
    metadata:
    {{- if .Values.service.name }}
    name: {{ .Values.service.name }}
    {{- else }}
    name: {{ template "fullname" . }}
    {{- end }}
    labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    {{- if .Values.service.labels }}
    {{ toYaml .Values.service.labels | indent 4 }}
    {{- end }}
    {{- if .Values.service.annotations }}
    {{- with .Values.service.annotations }}
    annotations:
    {{ tpl (toYaml .) $ | trim | indent 4 }}
    {{- end }}
    {{- end }}
    spec:
    type: {{ .Values.service.type }}
    ports:
    - port: {{ .Values.service.externalPort }}
    targetPort: {{ .Values.service.internalPort }}
    protocol: TCP
    name: http
    selector:
    app: {{ template "fullname" . }}
    {{- end }}
    18 changes: 18 additions & 0 deletions preview_values.yaml.gotoml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    jxRequirements:
    ingress:
    namespaceSubDomain: "-pr{{ requiredEnv "PULL_NUMBER" }}."

    image:
    repository: "{{ requiredEnv "DOCKER_REGISTRY" }}/{{ requiredEnv "DOCKER_REGISTRY_ORG" }}/{{ requiredEnv "APP_NAME" }}"
    tag: "{{ requiredEnv "VERSION" }}"
    pullPolicy: "Always"

    deploymentAnnotations:
    osiris.dm.gg/enableScaling: "true"
    podAnnotations:
    osiris.dm.gg/collectMetrics: "true"
    service:
    annotations:
    osiris.dm.gg/manageEndpoints: "true"
    osiris.dm.gg/deployment: '{{"{{ template \"fullname\" . }}"}}'
    fabric8.io/exposeHostNameAs: osiris.deislabs.io/ingressHostname