-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cleanup dockerfile (no need for argocd, update cli-v2) * added `installer.skipValidation` * run pre-install only once, keep failed pod for 5m * updated chart version to `0.2.10-alpha`
- Loading branch information
Showing
9 changed files
with
105 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
43 changes: 43 additions & 0 deletions
43
charts/gitops-runtime/templates/hooks/pre-install/rbac.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,43 @@ | ||
{{- if not .Values.installer.skipValidation }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: validate-values-cr | ||
annotations: | ||
helm.sh/hook: pre-install,pre-upgrade | ||
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed | ||
helm.sh/hook-weight: "-10" | ||
rules: | ||
- apiGroups: | ||
- "*" | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: validate-values-crb | ||
annotations: | ||
helm.sh/hook: pre-install,pre-upgrade | ||
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed | ||
helm.sh/hook-weight: "-10" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: validate-values-cr | ||
subjects: | ||
- kind: ServiceAccount | ||
name: validate-values-sa | ||
namespace: {{ .Release.Namespace }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: validate-values-sa | ||
annotations: | ||
helm.sh/hook: pre-install,pre-upgrade | ||
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed | ||
helm.sh/hook-weight: "-10" | ||
{{- end }} |
32 changes: 32 additions & 0 deletions
32
charts/gitops-runtime/templates/hooks/pre-install/validate-values.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,32 @@ | ||
{{- if not .Values.installer.skipValidation }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: validate-values | ||
annotations: | ||
helm.sh/hook: pre-install,pre-upgrade | ||
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation | ||
spec: | ||
backoffLimit: 0 | ||
ttlSecondsAfterFinished: 300 | ||
template: | ||
spec: | ||
serviceAccount: validate-values-sa | ||
restartPolicy: Never | ||
containers: | ||
- name: validate-values | ||
image: "{{ .Values.installer.image.repository }}:{{ .Values.installer.image.tag | default .Chart.Version }}" | ||
imagePullPolicy: {{ .Values.installer.image.pullPolicy }} | ||
env: | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: VERSION | ||
value: {{ .Chart.Version }} | ||
command: ["sh", "-c"] | ||
args: | ||
- | | ||
echo {{ .Values | toYaml | quote }} > values.yaml | ||
cf helm validate --values values.yaml --namespace ${NAMESPACE} --version ${VERSION} --hook --log-level debug | ||
{{- 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
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
FROM --platform=$BUILDPLATFORM debian:bullseye-slim | ||
RUN apt-get update -y && apt-get install curl -y | ||
ARG CF_CLI_VERSION=v0.1.25 | ||
ARG KUBECTL_VERSION=v1.26.0 | ||
|
||
ARG CF_CLI_VERSION=v0.1.48 | ||
ARG KUBECTL_VERSION=v1.27.2 | ||
ARG TARGETARCH | ||
|
||
RUN apt-get update && apt-get install curl -y | ||
RUN curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/${CF_CLI_VERSION}/cf-linux-${TARGETARCH}.tar.gz | tar zx && mv ./cf-linux-${TARGETARCH} /usr/local/bin/cf | ||
RUN curl -LO https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl && chmod +x kubectl && mv ./kubectl /usr/local/bin/kubectl | ||
USER 1000 | ||
|
||
RUN adduser --shell /bin/bash codefresh | ||
USER codefresh | ||
WORKDIR /home/codefresh |