Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do-not-merge] feat: kustomize proof-of-concept #63

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 0 additions & 172 deletions hokusai/production.yml.j2

This file was deleted.

3 changes: 3 additions & 0 deletions hokusai/production/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- kustomized
- unkustomized.yml
artsyjian marked this conversation as resolved.
Show resolved Hide resolved
40 changes: 40 additions & 0 deletions hokusai/production/kustomized/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
bases:
- https://github.com/artsy/artsy-hokusai-templates//kustomize/base?ref=artsyjian/kustomize
artsyjian marked this conversation as resolved.
Show resolved Hide resolved

patchesStrategicMerge:
- patch.yml
artsyjian marked this conversation as resolved.
Show resolved Hide resolved

namePrefix: hokusai-sandbox-
artsyjian marked this conversation as resolved.
Show resolved Hide resolved

images:
- name: artsyapp-ecr-repo
newName: 012345678901.dkr.ecr.us-east-1.amazonaws.com/hokusai-sandbox
newTag: production
artsyjian marked this conversation as resolved.
Show resolved Hide resolved

patchesJson6902:
- target:
kind: Deployment
name: web
patch: |-
- op: replace
path: /spec/template/spec/containers/0/name
value: hokusai-sandbox-web
- op: replace
path: /spec/template/spec/containers/0/envFrom/0/configMapRef/name
value: hokusai-sandbox-environment
- target:
kind: Ingress
name: artsyapp
patch: |-
- op: replace
path: /metadata/name
value: hokusai-sandbox
- op: replace
path: /spec/rules/0/host
value: hokusai-sandbox.artsy.net
- op: replace
path: /spec/rules/0/http/paths/0/backend/serviceName
value: hokusai-sandbox-web-internal

artsyjian marked this conversation as resolved.
Show resolved Hide resolved
transformers:
- transform.yml
8 changes: 8 additions & 0 deletions hokusai/production/kustomized/patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: web
spec:
minReplicas: 2
maxReplicas: 3
artsyjian marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 27 additions & 0 deletions hokusai/production/kustomized/transform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: builtin
kind: LabelTransformer
metadata:
name: app-label
labels:
app: hokusai-sandbox
fieldSpecs:
- path: metadata/labels
- path: spec/selector/matchLabels
kind: Deployment
- path: spec/template/metadata/labels
kind: Deployment
- path: spec/selector
kind: Service
---
apiVersion: builtin
kind: LabelTransformer
metadata:
name: version-label
labels:
app.kubernetes.io/version: production
fieldSpecs:
- path: metadata/labels
kind: Deployment
- path: spec/template/metadata/labels
kind: Deployment
artsyjian marked this conversation as resolved.
Show resolved Hide resolved
31 changes: 31 additions & 0 deletions hokusai/production/unkustomized.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
artsyjian marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hokusai-sandbox-cron
spec:
schedule: 23 09 * * MON
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: hokusai-sandbox-cron
image: 012345678901.dkr.ecr.us-east-1.amazonaws.com/hokusai-sandbox:production
imagePullPolicy: Always
envFrom:
- configMapRef:
name: hokusai-sandbox-environment
args:
- hostname
restartPolicy: Never
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: tier
operator: In
values:
- background
Loading