Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
46bb4b7
Swapping to argo application and kustomize
stephencshelton Aug 20, 2024
1e179e4
Initial stab at using kustomize
stephencshelton Aug 21, 2024
2cf5951
Fixing var references
stephencshelton Aug 21, 2024
923cad6
Changes to indentsg
stephencshelton Aug 21, 2024
934465b
Adding missing targets
stephencshelton Aug 21, 2024
fc6a5e4
More testing
stephencshelton Aug 21, 2024
42a800c
Fixing variable substitution
stephencshelton Aug 21, 2024
c858146
More testing
stephencshelton Aug 21, 2024
13f54cc
More testing
stephencshelton Aug 21, 2024
fb1ce03
Adding namespace to apply command
stephencshelton Aug 21, 2024
7d9c4b2
Not validating our application manifest
stephencshelton Aug 21, 2024
8540a02
It was KAS all along
stephencshelton Aug 22, 2024
e66aeaf
Removing components key
stephencshelton Aug 22, 2024
c1c97e1
Seeing if this helps
stephencshelton Aug 22, 2024
118f9f8
Starting simple and adding more
stephencshelton Aug 22, 2024
8d65c49
Updating to not use patchesStrategicMerge
stephencshelton Aug 22, 2024
4c24702
Swapping to use configmaps and pull environment from them instead
stephencshelton Aug 22, 2024
10314ee
More testing
stephencshelton Aug 22, 2024
e8f4c20
Swapping out container images in jobs as well, also removing duplicat…
stephencshelton Aug 23, 2024
c1a9a00
Updating application.yaml
stephencshelton Sep 11, 2024
a138fd8
Adding in missing service_providers.yml
stephencshelton Sep 12, 2024
ec04192
Adding missing DASHBOARD_URL
stephencshelton Sep 12, 2024
43577c5
Add in override for idp initContainer
stephencshelton Sep 16, 2024
a9190bf
Adding in missing environment vars for readonly filesystem
stephencshelton Sep 16, 2024
1dd4247
Lowering min/max replicas in HPA
stephencshelton Sep 16, 2024
b505979
Adding in missing redis urls
stephencshelton Sep 16, 2024
268c44a
Starting to cleanup some of the overrides
stephencshelton Sep 17, 2024
57e5284
Testing out more nameReference transformers
stephencshelton Sep 17, 2024
2561bbf
Adding in canary for idp override
stephencshelton Sep 17, 2024
e1fb1b1
Adding in pivcac ingress
stephencshelton Sep 20, 2024
c210883
Adding more image overrides
stephencshelton Sep 20, 2024
6f7ccd1
Adding missing environment var
stephencshelton Sep 24, 2024
01a45b2
More overrides
stephencshelton Sep 24, 2024
b3d3f8d
Updating reviewapp image for pivcac
stephencshelton Sep 24, 2024
4beaf57
Fix more pivcac references
stephencshelton Sep 24, 2024
f614e9b
Swapping from review to pivcac
stephencshelton Sep 25, 2024
1f8edf6
Seeing if this helps out
stephencshelton Sep 25, 2024
5f657eb
Removing canary
stephencshelton Oct 4, 2024
74a5333
Adding in pull policy overrides
stephencshelton Oct 4, 2024
e65224a
Adding in more missing imagepullpolicies
stephencshelton Oct 4, 2024
26843f5
Fixing CronJob imagepullpolicy reference
stephencshelton Oct 4, 2024
c49f479
Making sure rollouts is playing nice
stephencshelton Oct 7, 2024
ee3c289
Testing out some things
stephencshelton Oct 7, 2024
4c7b460
Seeing if this fixes the routing issue
stephencshelton Oct 7, 2024
a8352ad
Swapping to main now that the other is landed
stephencshelton Oct 9, 2024
01d8959
Adding echo statement to help find the application deployment in argo
stephencshelton Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 14 additions & 124 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ variables:
IDP_CI_SHA: 'sha256:5c4953f8efba18b7a6d6a9a961cb77ba7143059cbb2176499432b4275fbe67db'
PKI_IMAGE_TAG: 'main'
DASHBOARD_IMAGE_TAG: 'main'
APPLICATION_MANIFEST: dockerfiles/application.yaml

default:
image: '${ECR_REGISTRY}/idp/ci@${IDP_CI_SHA}'
Expand Down Expand Up @@ -433,129 +434,18 @@ trigger_devops:
- export SANITIZED_BRANCH_NAME=$(echo "$CI_COMMIT_REF_NAME" | tr '/' '-' | tr -c '[:alnum:]-_' '-' | sed 's/-*$//')
- echo "${CI_COMMIT_REF_NAME}"
- echo "${SANITIZED_BRANCH_NAME}"
- |-
export IDP_CONFIG=$(cat <<EOF
{
"kubernetesReviewApp": "true",
"postgres": {
"sslmode": "prefer",
"name": "idp",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-pg.review-apps"
},
"postgresWorker": {
"sslmode": "prefer",
"name": "idp",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-pg.review-apps"
},
"railsOffline": "true",
"redis": {
"throttleUrl": "redis://$CI_ENVIRONMENT_SLUG-login-chart-redis.review-apps:6379/1",
"url": "redis://$CI_ENVIRONMENT_SLUG-login-chart-redis.review-apps:6379"
},
"assetHost": "https://$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"domainName": "$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"loginDatacenter": "true",
"loginDomain": "identitysandbox.gov",
"loginEnv": "$CI_ENVIRONMENT_SLUG",
"loginHostRole": "idp",
"loginSkipRemoteConfig": "true",
"pivcacServiceUrl": "https://$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov/",
"pivcacVerifyTokenUrl": "https://$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov/",
"dashboardUrl": "https://$CI_ENVIRONMENT_SLUG-dashboard.reviewapps.identitysandbox.gov"
}
EOF
)
- |-
export WORKER_CONFIG=$(cat <<EOF
{
"kubernetesReviewApp": "true",
"postgres": {
"sslmode": "prefer",
"name": "idp",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-pg.review-apps"
},
"postgresWorker": {
"sslmode": "prefer",
"name": "idp",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-pg.review-apps"
},
"railsOffline": "true",
"redis": {
"throttleUrl": "redis://$CI_ENVIRONMENT_SLUG-login-chart-redis.review-apps:6379/1",
"url": "redis://$CI_ENVIRONMENT_SLUG-login-chart-redis.review-apps:6379"
},
"assetHost": "https://$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"domainName": "$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"loginDatacenter": "true",
"loginDomain": "identitysandbox.gov",
"loginEnv": "$CI_ENVIRONMENT_SLUG",
"loginHostRole": "worker",
"loginSkipRemoteConfig": "true",
"pivcacServiceUrl": "https://$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov/",
"pivcacVerifyTokenUrl": "https://$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov/"
}
EOF
)
- |-
export PIVCAC_CONFIG=$(cat <<EOF
{
"kubernetesReviewApp": "true",
"clientCertS3Bucket": "login-gov-pivcac-public-cert-reviewapps.894947205914-us-west-2",
"postgres": {
"sslmode": "prefer",
"name": "idp",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-pivcac-pg.review-apps"
},
"idpHost": "$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"domainName": "$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov"
}
EOF
)
- |-
export DASHBOARD_CONFIG=$(cat <<EOF
{
"kubernetesReviewApp": "true",
"postgres": {
"sslmode": "prefer",
"name": "dashboard",
"host": "$CI_ENVIRONMENT_SLUG-login-chart-dashboard-pg.review-apps"
},
"newrelic": {
"enabled": "false"
},
"samlSpIssuer": "https://$CI_ENVIRONMENT_SLUG-dashboard.reviewapps.identitysandbox.gov",
"idpUrl": "https://$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"idpSpUrl": "https://$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov",
"postLogoutUrl": "https://$CI_ENVIRONMENT_SLUG-dashboard.reviewapps.identitysandbox.gov",
"domainName": "$CI_ENVIRONMENT_SLUG-dashboard.reviewapps.identitysandbox.gov"
}
EOF
)
- git clone -b main --single-branch https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.login.gov/lg-public/identity-idp-helm-chart.git
- >-
helm upgrade --install --namespace review-apps
--debug
--set global.labels.branch="${SANITIZED_BRANCH_NAME}"
--set env="reviewapps-$CI_ENVIRONMENT_SLUG"
--set idp.image.repository="${ECR_REGISTRY}/identity-idp/review"
--set idp.image.tag="${CI_COMMIT_SHA}"
--set worker.image.repository="${ECR_REGISTRY}/identity-idp/review"
--set worker.image.tag="${CI_COMMIT_SHA}"
--set pivcac.image.repository="${ECR_REGISTRY}/identity-pivcac/review"
--set pivcac.image.tag="${PKI_IMAGE_TAG}"
--set pivcac.image.pullPolicy="Always"
--set dashboard.image.repository="${ECR_REGISTRY}/identity-dashboard/review"
--set dashboard.image.tag="${DASHBOARD_IMAGE_TAG}"
--set dashboard.image.pullPolicy="Always"
--set-json dashboard.config="$DASHBOARD_CONFIG"
--set-json dashboard.enabled=true
--set-json idp.config="$IDP_CONFIG"
--set-json worker.config="$WORKER_CONFIG"
--set-json pivcac.config="$PIVCAC_CONFIG"
--set-json idp.ingress.hosts="[{\"host\": \"$CI_ENVIRONMENT_SLUG.reviewapps.identitysandbox.gov\", \"paths\": [{\"path\": \"/\", \"pathType\": \"Prefix\"}]}]"
--set-json pivcac.ingress.hosts="[{\"host\": \"$CI_ENVIRONMENT_SLUG.pivcac.reviewapps.identitysandbox.gov\", \"paths\": [{\"path\": \"/\", \"pathType\": \"Prefix\"}]}]"
--set-json dashboard.ingress.hosts="[{\"host\": \"$CI_ENVIRONMENT_SLUG-dashboard.reviewapps.identitysandbox.gov\", \"paths\": [{\"path\": \"/\", \"pathType\": \"Prefix\"}]}]"
$CI_ENVIRONMENT_SLUG ./identity-idp-helm-chart
#TODO put in kustomize based deploy
# Dynamically populate review environment settings
- sed -i "s|{{ENVIRONMENT}}|${CI_ENVIRONMENT_SLUG}|g" ${APPLICATION_MANIFEST}
- sed -i "s|{{SANITIZED_BRANCH_NAME}}|${SANITIZED_BRANCH_NAME}|g" ${APPLICATION_MANIFEST}
- sed -i "s|{{IDP_CONTAINER_TAG}}|${CI_COMMIT_SHA}|g" ${APPLICATION_MANIFEST}
- sed -i "s|{{DASHBOARD_CONTAINER_TAG}}|${DASHBOARD_IMAGE_TAG}|g" ${APPLICATION_MANIFEST}
- sed -i "s|{{PIVCAC_CONTAINER_TAG}}|${PKI_IMAGE_TAG}|g" ${APPLICATION_MANIFEST}
- sed -i "s|{{ECR_REGISTRY}}|${ECR_REGISTRY}|g" ${APPLICATION_MANIFEST}
- cat ${APPLICATION_MANIFEST}
# Apply our ArgoCD Application
- kubectl apply -f ${APPLICATION_MANIFEST} -n argocd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a thing that's like "watch your app here" to link to argo? would that be useful? i know we probably can't easily hook it up to do argocd app wait like for the other envs as easily, because the argo api token is currently protected to only run on main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean nothing stopping us from adding that given we know the environment name, so we can generate the url based on that. Happy to add that if people think it would be good, would also like to throw the URL's as a comment on the MR eventually down the line so people don't have to go digging for them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright added a line to help folks find their application in ArgoCD and check the progress

- echo "View your applications deployment progress at https://argocd.reviewapp.identitysandbox.gov/applications/argocd/${CI_ENVIRONMENT_SLUG}?view=tree&resource="
- echo "DNS may take a while to propagate, so be patient if it doesn't show up right away"
- echo "To access the rails console, first run 'aws-vault exec sandbox-power -- aws eks update-kubeconfig --name reviewapp'"
- echo "Then run aws-vault exec sandbox-power -- kubectl exec -it service/$CI_ENVIRONMENT_SLUG-login-chart-idp -n review-apps -- /app/bin/rails console"
Expand Down Expand Up @@ -589,7 +479,7 @@ stop-review-app:
script:
- export CONTEXT=$(kubectl config get-contexts | grep reviewapp | awk '{print $1}' | head -1)
- kubectl config use-context "$CONTEXT"
- helm uninstall --namespace review-apps $CI_ENVIRONMENT_SLUG
- kubectl delete application $CI_ENVIRONMENT_SLUG -n argocd
stage: review
image:
name: dtzar/helm-kubectl:latest
Expand Down
Loading