Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inital smoke test #37

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ jobs:

- name: Test building the docker image
run: uds run dev-build

uds_core_integration:
runs-on: ubuntu-latest
name: Test integration of uds-identity-config and uds-core
permissions:
pull-requests: read
contents: read

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@fc12e3a773580020a1d63e254525eab0f8b99fc8
UnicornChance marked this conversation as resolved.
Show resolved Hide resolved

- name: Test building the docker image
run: uds run uds-core-integration-test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This repo builds the UDS Identity (Keycloak) Config image used by UDS Identity.
| cacert | Get the CA cert value for the Istio Gateway |
| debug-istio-traffic | Debug Istio traffic on keycloak |
| regenerate-test-pki | Generate a PKI cert for testing |
| uds-core-integration-test | Create cluster and deploy uds-core identity using local uds-identity-config image |

## Customizing UDS Identity Config

Expand Down
12 changes: 10 additions & 2 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ tasks:
- name: build-and-publish
description: "Build and publish the multi-arch image"
actions:
- cmd: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ${IMAGE_NAME}:${VERSION} src
- cmd: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ${IMAGE_NAME}:${VERSION} --no-cache src

- name: dev-build
description: "Build the image locally for dev"
actions:
- cmd: docker build src -t uds-core-config:keycloak
- cmd: docker build src -t uds-core-config:keycloak --no-cache

- name: dev-update-image
description: "Build the image and import locally into k3d"
Expand Down Expand Up @@ -59,3 +59,11 @@ tasks:
openssl req -new -key test.pem -out test.csr -config csr.conf -subj "/C=US/ST=Colorado/L=Colorado Springs/O=Defense Unicorns/CN=uds.dev"
openssl x509 -req -in test.csr -CA ca.crt -CAkey ca.pem -CAcreateserial -out test.cer -days 365 -extensions v3_ext -extfile csr.conf
zip src/authorized_certs ca.crt ca.pem test.cer test.csr test.pem

- name: uds-core-integration-test
description: "UDS Core integration test"
actions:
- cmd: uds deploy ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-istio-dev:0.16.1 --confirm
- task: dev-build
- cmd: git clone https://github.com/defenseunicorns/uds-core.git
UnicornChance marked this conversation as resolved.
Show resolved Hide resolved
- cmd: uds zarf package create . --confirm && uds zarf package deploy zarf-package-identity-* --confirm
8 changes: 8 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
image:
repository: quay.io/keycloak/keycloak
tag: "23.0.4"

configImage: uds-core-config:keycloak

podSecurityContext:
fsGroup: 1000
54 changes: 54 additions & 0 deletions zarf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
kind: ZarfPackageConfig
metadata:
name: identity-config
description: Identity Config

variables:
- name: DOMAIN
description: "Cluster domain"
default: "uds.dev"

components:
- name: keycloak
required: true
charts:
- name: keycloak
namespace: keycloak
version: 23.0.4
localPath: ./uds-core/src/keycloak/chart
valuesFiles:
- "values.yaml"
images:
- quay.io/keycloak/keycloak:23.0.4
- uds-core-config:keycloak
actions:
onDeploy:
after:
- description: Validate Identity Deployment
maxTotalSeconds: 300
wait:
cluster:
kind: Packages
name: keycloak
namespace: keycloak
condition: "'{.status.phase}'=Ready"
- description: Validate Keycloak Container
maxTotalSeconds: 300
wait:
cluster:
kind: Pods
name: keycloak-0
namespace: keycloak
condition: ContainersReady
- description: Validate admin interface
wait:
network:
protocol: https
address: keycloak.admin.uds.dev
code: 200
- description: Validate public interface
wait:
network:
protocol: https
address: sso.uds.dev
code: 200