-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: max <[email protected]>
- Loading branch information
Showing
10 changed files
with
203 additions
and
16 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,21 @@ | ||
--- | ||
- name: Generate TLS Server Cert secret manifest | ||
ansible.builtin.template: | ||
src: "{{ role_path }}/templates/manifests/infra/Secret-server-tls.yaml.j2" | ||
dest: "{{ tpa_single_node_server_secret }}" | ||
mode: "0600" | ||
vars: | ||
tpa_single_node_trust_tls_cert_pem: "{{ lookup('file', tpa_single_node_trust_server_cert_tls_crt_path) }}" | ||
tpa_single_node_trust_tls_cert_key: "{{ lookup('file', tpa_single_node_trust_server_cert_tls_key_path) }}" | ||
|
||
|
||
- name: Generate OIDC secret manifest | ||
ansible.builtin.template: | ||
src: "{{ role_path }}/templates/manifests/infra/Secret-oidc.yaml.j2" | ||
dest: "{{ tpa_single_node_server_secret }}" | ||
mode: "0600" | ||
|
||
- name: Apply server secret manifest | ||
ansible.builtin.command: | ||
cmd: "podman kube play {{ tpa_single_node_server_secret }}" | ||
changed_when: false |
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,16 @@ | ||
--- | ||
|
||
- name: Generate Server secret manifest | ||
ansible.builtin.template: | ||
src: "{{ role_path }}/templates/manifests/infra/Secret-server-tls.yaml.j2" | ||
dest: "{{ tpa_single_node_server_secret }}" | ||
mode: "0600" | ||
|
||
- name: Deploy server | ||
ansible.builtin.include_tasks: install_manifest.yml | ||
vars: | ||
podman_spec: | ||
state: started | ||
systemd_file: server | ||
network: "{{ tpa_single_node_podman_network }}" | ||
kube_file_content: "{{ lookup('ansible.builtin.template', 'manifests/server/Deployment.yaml.j2') | from_yaml }}" |
8 changes: 8 additions & 0 deletions
8
roles/tpa_single_node/templates/manifests/infra/Secret-server-tls.yaml.j2
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,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: server-tls | ||
data: | ||
server-tls.crt: "{{ tpa_single_node_trust_tls_cert_pem | b64encode }}" | ||
server-tls.key: "{{ tpa_single_node_trust_tls_cert_key | b64encode }}" |
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
108 changes: 108 additions & 0 deletions
108
roles/tpa_single_node/templates/manifests/server/Deployment.yaml.j2
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,108 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: server | ||
namespace: "{{ tpa_single_node_namespace }}" | ||
labels: | ||
app: server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: server | ||
app.kubernetes.io/component: server | ||
app.kubernetes.io/instance: redhat-trusted-profile-analyzer | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: server | ||
app.kubernetes.io/component: server | ||
app.kubernetes.io/instance: redhat-trusted-profile-analyzer | ||
spec: | ||
containers: | ||
- name: service | ||
image: "{{ tpa_single_node_trustification_image }}" | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
initialDelaySeconds: 2 | ||
httpGet: | ||
path: /health/live | ||
port: 9010 | ||
readinessProbe: | ||
initialDelaySeconds: 2 | ||
httpGet: | ||
path: /health/ready | ||
port: 9010 | ||
command: | ||
- /usr/local/bin/trustd | ||
args: | ||
- api | ||
- --auth-configuration | ||
- /etc/config/auth.yaml | ||
env: | ||
- name: NAMESPACE | ||
value: "{{ tpa_single_node_namespace }}" | ||
- name: RUST_LOG | ||
value: info | ||
- name: INFRASTRUCTURE_ENABLED | ||
value: 'true' | ||
- name: INFRASTRUCTURE_BIND | ||
value: '[::]:9010' | ||
- name: HTTP_SERVER_BIND_ADDR | ||
value: '::' | ||
- name: HTTP_SERVER_TLS_ENABLED | ||
value: 'true' | ||
- name: HTTP_SERVER_TLS_KEY_FILE | ||
value: /etc/tls/tls.key | ||
- name: HTTP_SERVER_TLS_CERTIFICATE_FILE | ||
value: /etc/tls/tls.crt | ||
- name: TRUSTD_DB_HOST | ||
value: "{{ tpa_single_node_pg_host }}" | ||
- name: TRUSTD_DB_PORT | ||
value: "{{ tpa_single_node_pg_port }}" | ||
- name: TRUSTD_DB_NAME | ||
value: "{{ tpa_single_node_pg_db }}" | ||
- name: TRUSTD_DB_USER | ||
value: "{{ tpa_single_node_pg_user }}" | ||
- name: TRUSTD_DB_PASSWORD | ||
value: "{{ tpa_single_node_pg_user_passwd }}" | ||
- name: TRUSTD_DB_SSLMODE | ||
value: allow | ||
- name: TRUSTD_STORAGE_STRATEGY | ||
value: fs | ||
- name: TRUSTD_STORAGE_FS_PATH | ||
value: /data/storage | ||
- name: SWAGGER_UI_OIDC_ISSUER_URL | ||
value: https://ssochange-me/realms/chicken | ||
- name: SWAGGER_UI_OIDC_CLIENT_ID | ||
value: frontend | ||
- name: UI_ISSUER_URL | ||
value: https://ssochange-me/realms/chicken | ||
- name: UI_CLIENT_ID | ||
value: frontend | ||
ports: | ||
- containerPort: 9010 | ||
protocol: TCP | ||
name: infra | ||
- containerPort: 8080 | ||
name: endpoint | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /etc/tls | ||
name: tls | ||
readOnly: true | ||
- name: config-auth | ||
mountPath: /etc/config/auth.yaml | ||
subPath: auth.yaml | ||
- name: storage | ||
mountPath: /data/storage | ||
volumes: | ||
- name: tls | ||
secret: | ||
secretName: server-tls | ||
- name: config-auth | ||
configMap: | ||
name: server-auth | ||
- name: storage | ||
persistentVolumeClaim: | ||
claimName: storage |
14 changes: 14 additions & 0 deletions
14
roles/tpa_single_node/templates/manifests/server/PersistentVolumeClaim.yaml.j2
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,14 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: storage | ||
namespace: "{{ tpa_single_node_namespace }}" | ||
labels: | ||
app: rhtpa | ||
component: server | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 32Gi |
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