-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from ropable/master
Kustomize resource definitions, update Apache 2.0 license text
- Loading branch information
Showing
22 changed files
with
632 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Penguins Observations System Kubernetes Kustomize overlay configuration | ||
|
||
Declarative management of Penguins Observations System objects using Kustomize. | ||
|
||
# How to use | ||
|
||
Within an overlay directory, create a `.env` file to contain required secret | ||
values in the format KEY=value (i.e. `overlays/uat/.env`). | ||
|
||
Review the built resource output using `kustomize`: | ||
|
||
```bash | ||
kustomize build kustomize/overlays/uat/ | less | ||
``` | ||
|
||
Run `kubectl` with the `-k` flag to generate resources for a given overlay: | ||
|
||
```bash | ||
kubectl apply -k kustomize/overlays/uat --namespace penguins --dry-run=client | ||
``` | ||
|
||
# References: | ||
|
||
* https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/ | ||
* https://github.com/kubernetes-sigs/kustomize | ||
* https://github.com/kubernetes-sigs/kustomize/tree/master/examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: penguins-import-cronjob | ||
labels: | ||
app: penguins-import-cronjob | ||
spec: | ||
schedule: "" | ||
concurrencyPolicy: Forbid | ||
jobTemplate: | ||
spec: | ||
parallelism: 1 | ||
activeDeadlineSeconds: 600 | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: penguins-import-cronjob | ||
image: ghcr.io/dbca-wa/penguins | ||
command: ["python"] | ||
args: ["--version"] | ||
env: | ||
- name: TZ | ||
value: "Australia/Perth" | ||
securityContext: | ||
#runAsNonRoot: true | ||
privileged: false | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: tmpfs-ram | ||
volumes: | ||
- name: tmpfs-ram | ||
emptyDir: | ||
medium: "Memory" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: penguins-deployment | ||
labels: | ||
app: penguins-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: penguins-deployment | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: penguins-deployment | ||
spec: | ||
containers: | ||
- name: penguins | ||
image: ghcr.io/dbca-wa/penguins | ||
imagePullPolicy: Always | ||
env: | ||
- name: ALLOWED_DOMAINS | ||
value: ".dbca.wa.gov.au" | ||
- name: TZ | ||
value: "Australia/Perth" | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "4096Mi" | ||
cpu: "1000m" | ||
startupProbe: | ||
tcpSocket: | ||
port: 8080 | ||
initialDelaySeconds: 0 | ||
periodSeconds: 3 | ||
timeoutSeconds: 1 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
livenessProbe: | ||
tcpSocket: | ||
port: 8080 | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
securityContext: | ||
runAsNonRoot: false | ||
privileged: false | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: tmpfs-ram | ||
volumes: | ||
- name: tmpfs-ram | ||
emptyDir: | ||
medium: "Memory" | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: penguins-deployment-hpa | ||
spec: | ||
minReplicas: 1 | ||
maxReplicas: 3 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metrics: | ||
- resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 250 | ||
type: Resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- deployment.yaml | ||
- deployment_hpa.yaml | ||
- service.yaml | ||
- cronjob_import.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: penguins-clusterip | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: wsgi | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 |
Oops, something went wrong.