-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: override to be able to force cronjob into service pod (#349)
- Loading branch information
1 parent
141e919
commit 0401a0a
Showing
8 changed files
with
218 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
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
16 changes: 16 additions & 0 deletions
16
internal/lagoon/test-resources/lagoon-yaml/test10/lagoon.yml
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,16 @@ | ||
--- | ||
docker-compose-yaml: docker-compose.yml | ||
|
||
project: content-example-com | ||
|
||
environments: | ||
main: | ||
cronjobs: | ||
- name: drush cron | ||
schedule: "*/30 * * * *" | ||
command: 'drush cron' | ||
service: cli | ||
inPod: true | ||
routes: | ||
- nginx: | ||
- a.example.com |
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,21 @@ | ||
docker-compose-yaml: internal/testdata/basic/docker-compose.yml | ||
|
||
environment_variables: | ||
git_sha: "true" | ||
|
||
environments: | ||
main: | ||
routes: | ||
- node: | ||
- example.com | ||
cronjobs: | ||
- name: drush cron | ||
schedule: "*/15 * * * *" | ||
command: drush cron | ||
service: node | ||
inPod: true # not required as the interval is suited to in pod already | ||
- name: drush cron2 | ||
schedule: "*/30 * * * *" | ||
command: drush cron | ||
service: node | ||
inPod: true |
92 changes: 92 additions & 0 deletions
92
internal/testdata/basic/service-templates/service8/deployment-node.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,92 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/instance: node | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
app.kubernetes.io/name: basic | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: node | ||
lagoon.sh/service-type: basic | ||
lagoon.sh/template: basic-0.1.0 | ||
name: node | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: node | ||
app.kubernetes.io/name: basic | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/configMapSha: abcdefg1234567890 | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/instance: node | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
app.kubernetes.io/name: basic | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: node | ||
lagoon.sh/service-type: basic | ||
lagoon.sh/template: basic-0.1.0 | ||
spec: | ||
containers: | ||
- env: | ||
- name: LAGOON_GIT_SHA | ||
value: abcdefg123456 | ||
- name: CRONJOBS | ||
value: | | ||
3,18,33,48 * * * * drush cron | ||
18,48 * * * * drush cron | ||
- name: SERVICE_NAME | ||
value: node | ||
envFrom: | ||
- configMapRef: | ||
name: lagoon-env | ||
image: harbor.example/example-project/main/node@sha256:b2001babafaa8128fe89aa8fd11832cade59931d14c3de5b3ca32e2a010fbaa8 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
initialDelaySeconds: 60 | ||
tcpSocket: | ||
port: 1234 | ||
timeoutSeconds: 10 | ||
name: basic | ||
ports: | ||
- containerPort: 1234 | ||
name: tcp-1234 | ||
protocol: TCP | ||
- containerPort: 8191 | ||
name: tcp-8191 | ||
protocol: TCP | ||
- containerPort: 9001 | ||
name: udp-9001 | ||
protocol: UDP | ||
readinessProbe: | ||
initialDelaySeconds: 1 | ||
tcpSocket: | ||
port: 1234 | ||
timeoutSeconds: 1 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 10Mi | ||
securityContext: {} | ||
enableServiceLinks: false | ||
imagePullSecrets: | ||
- name: lagoon-internal-registry-secret | ||
priorityClassName: lagoon-priority-production | ||
status: {} |
39 changes: 39 additions & 0 deletions
39
internal/testdata/basic/service-templates/service8/service-node.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,39 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/instance: node | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
app.kubernetes.io/name: basic | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: node | ||
lagoon.sh/service-type: basic | ||
lagoon.sh/template: basic-0.1.0 | ||
name: node | ||
spec: | ||
ports: | ||
- name: tcp-1234 | ||
port: 1234 | ||
protocol: TCP | ||
targetPort: tcp-1234 | ||
- name: tcp-8191 | ||
port: 8191 | ||
protocol: TCP | ||
targetPort: tcp-8191 | ||
- name: udp-9001 | ||
port: 9001 | ||
protocol: UDP | ||
targetPort: udp-9001 | ||
selector: | ||
app.kubernetes.io/instance: node | ||
app.kubernetes.io/name: basic | ||
status: | ||
loadBalancer: {} |