Settings for WikiDeck Nights 1 and 2; production image from Gitea #1
@@ -214,6 +214,7 @@ All defaults are in [defaults/main.yml](defaults/main.yml).
|
||||
| `wikideck_node_selector` / `wikideck_tolerations` / `wikideck_affinity` | `{}` / `[]` / `{}` | Pod placement settings. |
|
||||
| `wikideck_trusted_proxies` | `[]` | Up to 16 literal proxy IPs/CIDRs; only trust actual edge source addresses after the edge overwrites forwarded headers. |
|
||||
| `wikideck_ops_port` | empty | Optional port for a diagnostics listener bound only to container loopback; never add it to the Service, Ingress, or NetworkPolicy. |
|
||||
| `wikideck_env` | `{}` | Extra application settings as `NAME: value` (at most 32), e.g. `WIKIDECK_OIDC_REDIRECT_URIS`, `WIKIDECK_OPERATOR_CONTACT`; role-managed names are rejected. |
|
||||
| `wikideck_network_policy_enabled` | `true` | Manage network isolation; disabling deletes this role's policy. |
|
||||
| `wikideck_network_policy_ingress_from` | same-namespace pods | List of NetworkPolicy peers allowed to reach TCP 3001; empty list denies all ingress. |
|
||||
| `wikideck_network_policy_dns_to` | `kube-system` namespace | DNS peers allowed on UDP/TCP 53; adapt for custom/NodeLocal DNS. |
|
||||
|
||||
@@ -57,6 +57,9 @@ wikideck_pod_annotations: {}
|
||||
wikideck_trusted_proxies: []
|
||||
# Optional private operations listener; application binds it to container loopback.
|
||||
wikideck_ops_port: ""
|
||||
# Extra application settings as NAME: value, e.g. WIKIDECK_OIDC_REDIRECT_URIS or
|
||||
# WIKIDECK_OPERATOR_CONTACT. Role-managed names cannot be overridden.
|
||||
wikideck_env: {}
|
||||
|
||||
# Requires a NetworkPolicy-capable CNI. Same-namespace clients only by default.
|
||||
wikideck_network_policy_enabled: true
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
- ~/Desktop/secrets.yaml
|
||||
vars:
|
||||
# This is an operator-controlled candidate, not an independent public network.
|
||||
wikideck_release_image: ericomeehan/wikideck:latest
|
||||
wikideck_release_image: gitea.eom.dev/wikideck/wikideck:latest
|
||||
wikideck_candidate_risk_ack: operator-accepts-unaudited-risk
|
||||
wikideck_cluster_nodes:
|
||||
- wikideck
|
||||
@@ -22,6 +22,10 @@
|
||||
wikideck_mainnet_risk_ack: "{{ wikideck_candidate_risk_ack }}"
|
||||
# Internal validators share the browser origin, but only the first has ingress.
|
||||
wikideck_public_origin: https://wikideck.eom.dev
|
||||
# eom.dev login (Dex, DevOps/ansible-role-dex) and the Wikimedia User-Agent contact.
|
||||
wikideck_env:
|
||||
WIKIDECK_OIDC_REDIRECT_URIS: https://wikideck.eom.dev/auth/callback,dev.eom.wikideck:/oauth/callback
|
||||
WIKIDECK_OPERATOR_CONTACT: https://gitea.eom.dev/WikiDeck/wikideck/issues
|
||||
wikideck_ingress_host: wikideck.eom.dev
|
||||
wikideck_ingress_class_name: nginx
|
||||
wikideck_ingress_annotations:
|
||||
|
||||
@@ -62,6 +62,31 @@
|
||||
set to https:// followed by exactly wikideck_ingress_host.
|
||||
when: wikideck_ingress_enabled | bool
|
||||
|
||||
- name: Validate extra application settings
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- wikideck_env is mapping
|
||||
- wikideck_env | length <= 32
|
||||
- wikideck_env.keys() | select('match', '^[A-Z_][A-Z0-9_]*$') | list | length == wikideck_env | length
|
||||
- wikideck_env.keys() | intersect(_wikideck_reserved_env) | list | length == 0
|
||||
- wikideck_env.values() | reject('string') | reject('number') | list | length == 0
|
||||
fail_msg: >-
|
||||
wikideck_env must map at most 32 upper-case variable names to string or number
|
||||
values, and must not set role-managed variables: {{ _wikideck_reserved_env | join(', ') }}.
|
||||
vars:
|
||||
_wikideck_reserved_env:
|
||||
- NODE_ENV
|
||||
- HOST
|
||||
- PORT
|
||||
- WIKIDECK_DATA_DIR
|
||||
- WIKIDECK_PEERS
|
||||
- WIKIDECK_ALLOW_PRIVATE_PEERS
|
||||
- WIKIDECK_MAINNET_LAUNCH
|
||||
- WIKIDECK_MAINNET_RISK_ACK
|
||||
- WIKIDECK_TRUSTED_PROXIES
|
||||
- WIKIDECK_OPS_PORT
|
||||
- PUBLIC_ORIGIN
|
||||
|
||||
- name: Validate list settings
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
|
||||
@@ -88,6 +88,10 @@ spec:
|
||||
- name: PUBLIC_ORIGIN
|
||||
value: {{ wikideck_public_origin | to_json }}
|
||||
{% endif %}
|
||||
{% for name, value in wikideck_env | dictsort %}
|
||||
- name: {{ name | to_json }}
|
||||
value: {{ (value | string) | to_json }}
|
||||
{% endfor %}
|
||||
resources: {{ wikideck_resources | to_json }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
wikideck_ops_port: "{{ invalid_case.ops_port | default('') }}"
|
||||
wikideck_mainnet_launch: "{{ invalid_case.mainnet_launch | default('') }}"
|
||||
wikideck_mainnet_risk_ack: "{{ invalid_case.risk_ack | default('') }}"
|
||||
wikideck_env: "{{ invalid_case.env | default({}) }}"
|
||||
block:
|
||||
- name: Run role input validation
|
||||
ansible.builtin.include_tasks: ../tasks/validate.yml
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
wikideck_network_policy_https_to: "{{ render_case.https_to | default([{'ipBlock': {'cidr': '0.0.0.0/0'}}]) }}"
|
||||
wikideck_network_policy_https_ports: "{{ render_case.https_ports | default([443]) }}"
|
||||
wikideck_network_policy_peer_egress: "{{ render_case.peer_egress | default([]) }}"
|
||||
wikideck_env: "{{ render_case.env | default({}) }}"
|
||||
loop:
|
||||
- label: isolated validator defaults
|
||||
- label: extra application settings
|
||||
env: {WIKIDECK_OPERATOR_CONTACT: "https://example.org/issues", WIKIDECK_WIKIMEDIA_RPS: 2}
|
||||
- label: TLS ingress and existing storage
|
||||
peers: [https://peer-a.example.org, https://peer-b.example.org]
|
||||
ingress: true
|
||||
@@ -141,6 +144,12 @@
|
||||
loop:
|
||||
- label: missing image
|
||||
image: ""
|
||||
- label: extra env overrides a role-managed variable
|
||||
env: {PORT: "9"}
|
||||
- label: extra env with a lower-case name
|
||||
env: {wikideck_x: "1"}
|
||||
- label: extra env with a list value
|
||||
env: {WIKIDECK_X: [1]}
|
||||
- label: untagged image
|
||||
image: registry.example.com/wikideck
|
||||
- label: registry port is not an image tag
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
- (env.WIKIDECK_OPS_PORT | default('')) == (wikideck_ops_port | string)
|
||||
- env.WIKIDECK_OFFLINE is not defined
|
||||
- env.RANDOMX_BINARY is not defined
|
||||
- wikideck_env | dict2items | map(attribute='key') | map('extract', env) | list == wikideck_env | dict2items | map(attribute='value') | map('string') | list
|
||||
- container.command is not defined and container.args is not defined
|
||||
- pod.containers | length == 1
|
||||
- (env.PUBLIC_ORIGIN | default('')) == wikideck_public_origin
|
||||
|
||||
Reference in New Issue
Block a user