-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Kustomize base and UAT overlays.
- Loading branch information
Showing
10 changed files
with
175 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mapproxy.yaml | ||
.env | ||
config.yaml | ||
.python-version | ||
__pycache__/ |
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 @@ | ||
# MapProxy Kubernetes Kustomize overlay configuration | ||
|
||
Declarative management of MapProxy Kubernetes resources using Kustomize. | ||
|
||
# How to use | ||
|
||
Within an overlay directory, create a `config.yaml` file to configure the | ||
proxied tile layers. | ||
|
||
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 sss --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,51 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mapproxy-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
spec: | ||
containers: | ||
- name: mapproxy | ||
env: | ||
- name: TZ | ||
value: "Australia/Perth" | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "4096Mi" | ||
cpu: "1000m" | ||
livenessProbe: | ||
httpGet: | ||
path: /demo/ | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 5 | ||
periodSeconds: 3 | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
timeoutSeconds: 3 | ||
readinessProbe: | ||
httpGet: | ||
path: /demo/ | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 5 | ||
periodSeconds: 3 | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
timeoutSeconds: 3 | ||
securityContext: | ||
runAsNonRoot: true | ||
privileged: false | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: false | ||
restartPolicy: Always |
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,3 @@ | ||
resources: | ||
- deployment.yaml | ||
- service.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: mapproxy-clusterip | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: wsgi | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 |
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,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mapproxy-deployment | ||
labels: | ||
app: mapproxy-uat | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mapproxy-uat | ||
template: | ||
metadata: | ||
labels: | ||
app: mapproxy-uat | ||
spec: | ||
containers: | ||
- name: mapproxy | ||
image: ghcr.io/dbca-wa/mapproxy | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- mountPath: /app/config | ||
name: mapproxy-configmap | ||
volumes: | ||
- configMap: | ||
name: mapproxy-configmap-uat | ||
defaultMode: 292 | ||
optional: false | ||
name: mapproxy-configmap |
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: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: mapproxy-ingress | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: mapproxy-uat.dbca.wa.gov.au | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: mapproxy-clusterip-uat | ||
port: | ||
number: 8080 |
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,18 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
nameSuffix: -uat | ||
resources: | ||
- ../../base | ||
- ingress.yaml | ||
- pdb.yaml | ||
labels: | ||
- includeSelectors: true | ||
pairs: | ||
variant: uat | ||
patches: | ||
- path: deployment_patch.yaml | ||
- path: service_patch.yaml | ||
configMapGenerator: | ||
- name: mapproxy-configmap | ||
files: | ||
- config.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,10 @@ | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: mapproxy-pdb | ||
spec: | ||
minAvailable: 1 | ||
selector: | ||
matchLabels: | ||
app: mapproxy-uat | ||
variant: uat |
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,9 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mapproxy-clusterip | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: mapproxy-uat | ||
variant: uat |