-
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.
- Loading branch information
Showing
14 changed files
with
281 additions
and
14 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,113 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: "{{ .Values.appname }}-cronicle" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cronicle | ||
template: | ||
metadata: | ||
labels: | ||
app: cronicle | ||
spec: | ||
serviceAccountName: {{ .Values.appname }}-cronicle-sa | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 3000 | ||
fsGroup: 2000 | ||
containers: | ||
- name: "{{ .Values.appname }}-cronicle-container" | ||
image: "{{ .Values.cronicle.repository }}:{{ .Values.cronicle.tag }}" | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
chown -R 1000:3000 /opt /opt/cronicle /opt/cronicle/data /opt/cronicle/lib /opt/cronicle/node_modules /opt/cronicle/logs /opt/cronicle/plugins /opt/cronicle/bin/shell-plugin.js && \ | ||
/opt/cronicle/bin/control.sh setup && /opt/cronicle/bin/control.sh start | ||
env: | ||
- name: POSTGRES_STRING | ||
valueFrom: | ||
secretKeyRef: | ||
name: kexa-secret | ||
key: postgres-connection-string | ||
securityContext: | ||
runAsUser: 0 | ||
volumeMounts: | ||
- name: kexa-config-volume | ||
mountPath: /app/config/default.json | ||
subPath: default.json | ||
readOnly: false | ||
- name: kexa-env-volume | ||
mountPath: /app/.env | ||
subPath: .env | ||
readOnly: false | ||
- name: writable-app-volume | ||
mountPath: /app/config | ||
readOnly: false | ||
- name: tmpconfig | ||
mountPath: /app/shared | ||
readOnly: false | ||
- name: localtime | ||
mountPath: /etc/localtime | ||
readOnly: false | ||
- name: timezone | ||
mountPath: /etc/timezone | ||
readOnly: false | ||
- name: data | ||
mountPath: /opt/cronicle/data | ||
readOnly: false | ||
- name: logs | ||
mountPath: /opt/cronicle/logs | ||
readOnly: false | ||
- name: plugins | ||
mountPath: /opt/cronicle/plugins | ||
readOnly: false | ||
- name: docker-socket | ||
mountPath: /var/run/docker.sock | ||
readOnly: false | ||
{{- if .Values.kubernetesAddon.enabled }} | ||
- name: kubeconfig-volume | ||
mountPath: "/app/{{ .Values.kubernetesAddon.mountPath }}" | ||
readOnly: false | ||
{{- end }} | ||
resources: | ||
limits: | ||
cpu: "1000m" | ||
memory: "2048Mi" | ||
requests: | ||
cpu: "500m" | ||
memory: "1024Mi" | ||
restartPolicy: Always | ||
volumes: | ||
- name: kexa-config-volume | ||
secret: | ||
secretName: kexa-configuration-secret | ||
- name: kexa-env-volume | ||
secret: | ||
secretName: kexa-environment-secret | ||
- name: writable-app-volume | ||
emptyDir: {} | ||
- name: tmpconfig | ||
emptyDir: {} | ||
- name: localtime | ||
hostPath: | ||
path: /etc/localtime | ||
- name: timezone | ||
hostPath: | ||
path: /etc/timezone | ||
- name: docker-socket | ||
hostPath: | ||
path: /var/run/guest-services/docker.sock | ||
- name: data | ||
emptyDir: {} | ||
- name: logs | ||
emptyDir: {} | ||
- name: plugins | ||
emptyDir: {} | ||
{{- if .Values.kubernetesAddon.enabled }} | ||
- name: kubeconfig-volume | ||
secret: | ||
secretName: kubeconfig-secret | ||
{{- end }} |
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: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
namespace: {{ .Values.namespace }} | ||
name: {{ .Values.appname }}-cronicle-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["pods/log"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["batch"] | ||
resources: ["jobs"] | ||
verbs: ["get", "create", "delete", "watch"] | ||
- apiGroups: ["batch"] | ||
resources: ["cronjobs"] | ||
verbs: ["get", "watch"] |
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,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ .Values.appname }}-cronicle-role-binding | ||
namespace: {{ .Values.namespace }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Values.appname }}-cronicle-sa | ||
namespace: {{ .Values.namespace }} | ||
roleRef: | ||
kind: Role | ||
name: {{ .Values.appname }}-cronicle-role | ||
apiGroup: rbac.authorization.k8s.io |
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Values.appname }}-cronicle-sa | ||
namespace: {{ .Values.namespace }} |
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: "{{ .Values.appname }}-cronicle-svc" | ||
spec: | ||
selector: | ||
app: cronicle | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 3012 |
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 was deleted.
Oops, something went wrong.
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,8 +1,21 @@ | ||
FROM soulteary/cronicle | ||
|
||
RUN apk update && \ | ||
apk add docker-cli | ||
apk add docker-cli curl | ||
|
||
RUN adduser cronicle docker | ||
RUN adduser -S cronicle docker | ||
|
||
|
||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
RUN chmod +x ./kubectl | ||
RUN mv ./kubectl /usr/local/bin | ||
|
||
# RUN chown -R 1000:3000 /opt || true && \ | ||
# chmod -R u+rwx,g+rwx /opt || true | ||
|
||
# RUN chown -R 1000:3000 / || true && \ | ||
# chmod -R u+rwx,g+rwx / || true | ||
|
||
# RUN chmod +wrx /opt/cronicle/bin/shell-plugin.js | ||
|
||
ENV DOCKER_CLI_VERSION=23.0.3 |
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,19 @@ | ||
{ | ||
"azure":[ | ||
{ | ||
"description": "organization 4urcloud", | ||
"prefix": "AZUREPROJ1_", | ||
"rules": [ | ||
"azureBenchmarkRules" | ||
] | ||
} | ||
], | ||
"save": [ | ||
{ | ||
"type": "postgres", | ||
"name": "Clever Cloud Postgresql", | ||
"urlName": "postgres_connect", | ||
"description": "Database to save the data (clever-cloud)" | ||
} | ||
] | ||
} |
File renamed without changes.
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,54 @@ | ||
#!/bin/sh | ||
|
||
# Enter your shell script code here | ||
|
||
DATE_STAMP=`date "+%Y-%m-%d"` | ||
|
||
YOUR_RELEASE_NAME="kexa-helm" | ||
|
||
|
||
|
||
JOB_NAME="kexa-job-run-$DATE_STAMP" | ||
|
||
kubectl delete job $JOB_NAME | ||
|
||
kubectl create job --from=cronjob/$YOUR_RELEASE_NAME-job $JOB_NAME | ||
|
||
# wait for pod to start before following logs | ||
|
||
while true; do | ||
STATUS=$(kubectl get job $JOB_NAME -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}') | ||
|
||
if [ "$STATUS" = "Pending" ]; then | ||
echo "Waiting for job to start..." | ||
sleep 2 | ||
else | ||
break | ||
fi | ||
|
||
done | ||
|
||
|
||
kubectl logs -f job/$JOB_NAME | ||
|
||
|
||
while true; do | ||
STATUS=$(kubectl get job $JOB_NAME -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}') | ||
|
||
if [ "$STATUS" = "True" ]; then | ||
echo "Job completed successfully." | ||
break | ||
fi | ||
|
||
FAILED_STATUS=$(kubectl get job $JOB_NAME -o jsonpath='{.status.conditions[?(@.type=="Failed")].status}') | ||
if [ "$FAILED_STATUS" = "True" ]; then | ||
echo "Job failed." | ||
exit 1 | ||
fi | ||
|
||
sleep 5 | ||
done | ||
|
||
kubectl delete job $JOB_NAME | ||
|
||
exit 0 |