Skip to content

Commit

Permalink
feat: add customized deployment files
Browse files Browse the repository at this point in the history
- deployment/kubernetes/wave*.yaml.envsubst files will determine how we
  deploy razee into our release waves
- versions.mk will determine image version per wave
- all the tooling to cut releases will be brought in by a PR from the
  repo template

ref: REL-728
  • Loading branch information
Charles Thomas authored and charlesthomas committed Dec 17, 2021
1 parent 5dcfa57 commit 69c8510
Show file tree
Hide file tree
Showing 8 changed files with 1,868 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# MustacheTemplate
THIS IS NOT A RAZEE FORK

## ⚠️ WARNINGS ⚠️

- **THIS IS A PUBLIC REPO**
- **THIS IS NOT A RAZEE FORK**

This is effectively a tooling repo, enabling us to customize Razee's deployment
files to better suite our needs.
309 changes: 309 additions & 0 deletions deployment/kubernetes/wave0.yaml.envsubst
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
apiVersion: v1
kind: List
metadata:
name: mustachetemplate-controller-list
annotations:
razee.io/git-repo: "${GIT_URL}"
razee.io/commit-sha: "${GIT_SHA1}"
razee.io/build-tag: "${BUILD_TAG}"
razee.io/branch: "${GIT_BRANCH}"
type: array
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: mustachetemplate-controller
annotations:
razee.io/git-repo: "${GIT_URL}"
razee.io/commit-sha: "${GIT_SHA1}"
razee.io/build-tag: "${BUILD_TAG}"
razee.io/branch: "${GIT_BRANCH}"
labels:
razee/watch-resource: "lite"
spec:
replicas: 1
selector:
matchLabels:
app: mustachetemplate-controller
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: mustachetemplate-controller
razee/watch-resource: "lite"
name: mustachetemplate-controller
spec:
serviceAccountName: razeedeploy-sa
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- image: "quay.io/razee/mustachetemplate:${WAVE0_VERSION}"
resources:
limits:
memory: 200Mi
cpu: 100m
requests:
memory: 75Mi
cpu: 40m
env:
- name: USER_AGENT_NAME
value: razee-io/mustachetemplate
- name: USER_AGENT_VERSION
value: "${WAVE0_VERSION}"
- name: CRD_WATCH_TIMEOUT_SECONDS
valueFrom:
configMapKeyRef:
name: razeedeploy-overrides
key: CRD_WATCH_TIMEOUT_SECONDS
optional: true
imagePullPolicy: Always
name: mustachetemplate-controller
livenessProbe:
exec:
command:
- sh/liveness.sh
initialDelaySeconds: 30
periodSeconds: 150
timeoutSeconds: 30
failureThreshold: 1
volumeMounts:
- mountPath: /home/node/config
name: razeedeploy-config
volumes:
- name: razeedeploy-config
configMap:
name: razeedeploy-config
defaultMode: 400
optional: true
- apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
# name must match the spec fields below, and be in the form: <plural>.<group>
name: mustachetemplates.deploy.razee.io
annotations:
razee.io/git-repo: "${GIT_URL}"
razee.io/commit-sha: "${GIT_SHA1}"
razee.io/build-tag: "${BUILD_TAG}"
razee.io/branch: "${GIT_BRANCH}"
spec:
# group name to use for REST API: /apis/<group>/<version>
group: deploy.razee.io
# list of versions supported by this CustomResourceDefinition
versions:
- name: v1alpha1
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: false
schema:
# openAPIV3Schema is the schema for validating custom objects.
openAPIV3Schema:
type: object
required: [spec]
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
- name: v1alpha2
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: true
schema:
# openAPIV3Schema is the schema for validating custom objects.
openAPIV3Schema:
type: object
required: [spec]
properties:
spec:
type: object
allOf:
- anyOf:
- required: [templates]
- required: [strTemplates]
- anyOf:
- required: [envFrom]
- required: [env]
properties:
clusterAuth:
type: object
properties:
impersonateUser:
type: string
templateEngine:
type: string
pattern: "^mustache$|^handlebars$"
custom-tags:
type: array
maxItems: 2
minItems: 2
items:
type: string
maxLength: 3
minLength: 2
envFrom:
type: array
items:
type: object
oneOf:
- required: [configMapRef]
- required: [secretMapRef]
- required: [genericMapRef]
properties:
optional:
type: boolean
configMapRef:
type: object
required: [name]
properties:
name:
type: string
namespace:
type: string
secretMapRef:
type: object
required: [name]
properties:
name:
type: string
namespace:
type: string
genericMapRef:
type: object
required: [apiVersion, kind, name]
properties:
apiVersion:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
env:
type: array
items:
type: object
allOf:
- required: [name]
- # all array items should be oneOf ['value', 'valueFrom']
oneOf:
- required: [value]
# if 'value', neither 'optional' nor 'default' may be used
not:
anyOf:
- required: [default]
- required: [optional]
- required: [valueFrom]
# if 'valueFrom', you must define oneOf:
oneOf:
- # neither 'optional' nor 'default' is used
not:
anyOf:
- required: [default]
- required: [optional]
- # 'optional' is used by itself
required: [optional]
not:
required: [default]
- # 'optional' and 'default' are used together IFF optional == true
required: [optional, default]
properties:
optional:
enum: [true]
properties:
optional:
type: boolean
default:
x-kubernetes-int-or-string: true
name:
type: string
overrideStrategy:
type: string
pattern: "^merge$|^replace$"
value:
x-kubernetes-int-or-string: true
valueFrom:
type: object
oneOf:
- required: [configMapKeyRef]
- required: [secretKeyRef]
- required: [genericKeyRef]
properties:
configMapKeyRef:
type: object
required: [name, key]
properties:
name:
type: string
key:
type: string
namespace:
type: string
type:
type: string
enum: [number, boolean, json, jsonString, base64]
secretKeyRef:
type: object
required: [name, key]
properties:
name:
type: string
key:
type: string
namespace:
type: string
type:
type: string
enum: [number, boolean, json, jsonString, base64]
genericKeyRef:
type: object
required: [apiVersion, kind, name, key]
properties:
apiVersion:
type: string
kind:
type: string
name:
type: string
key:
type: string
namespace:
type: string
type:
type: string
enum: [number, boolean, json, jsonString, base64]
templates:
type: array
items:
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
strTemplates:
type: array
items:
type: string
status:
type: object
x-kubernetes-preserve-unknown-fields: true
# either Namespaced or Cluster
scope: Namespaced
names:
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
plural: mustachetemplates
# singular name to be used as an alias on the CLI and for display
singular: mustachetemplate
# kind is normally the CamelCased singular type. Your resource manifests use this.
kind: MustacheTemplate
# shortNames allow shorter string to match your resource on the CLI
shortNames:
- mtp
subresources:
# status enables the status subresource.
status: {}
Loading

0 comments on commit 69c8510

Please sign in to comment.