-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Optionally support Red Hat Cert Manager
Signed-off-by: Denilson Nastacio <[email protected]>
- Loading branch information
Showing
18 changed files
with
129 additions
and
24 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
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
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
56 changes: 56 additions & 0 deletions
56
config/argocd-cloudpaks/cp4d/templates/0000-presync-adjust-prereq-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,56 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: cp4d-adjust-prereq-config | ||
annotations: | ||
argocd.argoproj.io/hook: PreSync | ||
namespace: openshift-gitops | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: config | ||
image: quay.io/openshift/origin-cli:latest | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: ARGOCD_APP_NAME | ||
value: cp4d-app | ||
- name: ARGOCD_NAMESPACE | ||
value: "{{.Values.metadata.argocd_namespace}}" | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
set -eo pipefail | ||
set -x | ||
red_hat_cert_manager=$(oc get configmap argocd-cp4d-config \ | ||
--namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.red_hat_cert_manager}') | ||
echo "INFO: Install Argo CLI." | ||
# Install it from cluster, not from Internet, so airgap scenarios still work | ||
argo_route="${ARGOCD_NAMESPACE}-server" | ||
argo_secret="${ARGOCD_NAMESPACE}-cluster" | ||
export HOME=/tmp | ||
argo_cmd="${HOME}/argocd" | ||
result=0 | ||
argo_url=$(oc get route ${argo_route} -n ${ARGOCD_NAMESPACE} -ojsonpath='{.spec.host}') \ | ||
&& curl -skL "${argo_url}/download/argocd-linux-amd64" -o "${argo_cmd}" \ | ||
&& chmod 755 "${argo_cmd}" \ | ||
&& argo_pwd=$(oc get secret ${argo_secret} -n ${ARGOCD_NAMESPACE} -ojsonpath='{.data.admin\.password}' | base64 -d ; echo ) \ | ||
&& "${argo_cmd}" login "${argo_url}" --username admin --password "${argo_pwd}" --insecure \ | ||
&& "${argo_cmd}" app set "${ARGOCD_APP_NAME}" \ | ||
--helm-set-string red_hat_cert_manager="${red_hat_cert_manager}" \ | ||
&& echo "INFO: ${ARGOCD_APP_NAME} successfully updated settings." \ | ||
|| result=1 | ||
echo "INFO: Application ${ARGOCD_APP_NAME} current parameters:" | ||
"${argo_cmd}" app get "${ARGOCD_APP_NAME}" --show-params | ||
exit ${result} | ||
restartPolicy: Never | ||
serviceAccountName: {{.Values.serviceaccount.argocd_application_controller}} | ||
backoffLimit: 2 |
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
15 changes: 15 additions & 0 deletions
15
config/cloudpaks/cp-shared/operators/templates/0100-rh-cert-manager-operator-group.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,15 @@ | ||
{{- $red_hat_cert_manager := .Values.red_hat_cert_manager | toString }} | ||
{{- if eq ( default "false" $red_hat_cert_manager ) "true" }} | ||
--- | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "100" | ||
name: cert-manager-operator | ||
namespace: cert-manager-operator | ||
spec: | ||
targetNamespaces: | ||
- cert-manager-operator | ||
upgradeStrategy: Default | ||
{{- end }} |
17 changes: 17 additions & 0 deletions
17
config/cloudpaks/cp-shared/operators/templates/0110-rh-cert-manager-subscription.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,17 @@ | ||
{{- $red_hat_cert_manager := .Values.red_hat_cert_manager | toString }} | ||
{{- if eq ( default "false" $red_hat_cert_manager ) "true" }} | ||
--- | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "110" | ||
name: openshift-cert-manager-operator | ||
namespace: cert-manager-operator | ||
spec: | ||
channel: stable-v1 | ||
installPlanApproval: Automatic | ||
name: openshift-cert-manager-operator | ||
source: redhat-operators | ||
sourceNamespace: openshift-marketplace | ||
{{- 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
red_hat_cert_manager: false | ||
metadata: | ||
argocd_namespace: openshift-gitops | ||
serviceaccount: | ||
|
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