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

changing receptor config to v2 #1934

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
48 changes: 27 additions & 21 deletions roles/installer/templates/deployments/task.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,26 @@ spec:
- -c
- |
hostname=$MY_POD_NAME
receptor --cert-makereq \
bits=2048 \
commonname=$hostname \
dnsname=$hostname \
nodeid=$hostname \
outreq=/etc/receptor/tls/receptor.req \
outkey=/etc/receptor/tls/receptor.key
receptor --cert-signreq \
req=/etc/receptor/tls/receptor.req \
cacert=/etc/receptor/tls/ca/mesh-CA.crt \
cakey=/etc/receptor/tls/ca/mesh-CA.key \
outcert=/etc/receptor/tls/receptor.crt \
notafter=$(date --iso-8601=seconds --utc --date "10 years") \
verify=yes
cat << EOF > certgen-installer.yaml
---
version: 2
cert-makereqs:
- bits: 2048
commonname: $hostname
dnsname: $hostname
nodeid: $hostname
outreq: /etc/receptor/tls/receptor.req
outkey: /etc/receptor/tls/receptor.key

cert-signreqs:
- req: /etc/receptor/tls/receptor.req
cacert: /etc/receptor/tls/ca/mesh-CA.crt
cakey: /etc/receptor/tls/ca/mesh-CA.key
outcert: /etc/receptor/tls/receptor.crt
notafter: \$(date --iso-8601=seconds --utc --date "10 years")
resoluteCoder marked this conversation as resolved.
Show resolved Hide resolved
verify: yes
resoluteCoder marked this conversation as resolved.
Show resolved Hide resolved
EOF
receptor --config certgen-installer.yaml
{% if init_container_extra_commands %}
{{ init_container_extra_commands | indent(width=14) }}
{% endif %}
Expand Down Expand Up @@ -360,19 +366,19 @@ spec:
- /bin/sh
- -c
- |
if [ ! -f /etc/receptor/receptor.conf ]; then
cp /etc/receptor/receptor-default.conf /etc/receptor/receptor.conf
sed -i "s/HOSTNAME/$HOSTNAME/g" /etc/receptor/receptor.conf
if [ ! -f /etc/receptor/receptor.yaml ]; then
cp /etc/receptor/receptor-default.yaml /etc/receptor/receptor.yaml
sed -i "s/HOSTNAME/$HOSTNAME/g" /etc/receptor/receptor.yaml
fi
exec receptor --config /etc/receptor/receptor.conf
exec receptor --config /etc/receptor/receptor.yaml
volumeMounts:
{% if bundle_ca_crt %}
- name: "ca-trust-extracted"
mountPath: "/etc/pki/ca-trust/extracted"
{% endif %}
- name: "{{ ansible_operator_meta.name }}-default-receptor-config"
mountPath: "/etc/receptor/receptor-default.conf"
subPath: receptor.conf
mountPath: "/etc/receptor/receptor-default.yaml"
subPath: receptor.yaml
- name: "{{ ansible_operator_meta.name }}-receptor-config"
mountPath: "/etc/receptor/"
- name: "{{ ansible_operator_meta.name }}-receptor-ca"
Expand Down Expand Up @@ -610,7 +616,7 @@ spec:
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-configmap'
items:
- key: receptor_conf
path: receptor.conf
path: receptor.yaml
- name: "{{ ansible_operator_meta.name }}-projects"
{% if projects_persistence|bool %}
persistentVolumeClaim:
Expand Down
45 changes: 25 additions & 20 deletions roles/mesh_ingress/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,39 @@ spec:
{% if external_ipaddress is defined %}
external_ipaddress={{ external_ipaddress }}
{% endif %}
receptor --cert-makereq \
bits=2048 \
commonname=$internal_hostname \
dnsname=$internal_hostname \
nodeid=$internal_hostname \
cat << EOF > certgen-mesh-ingress.yaml
---
version: 2
cert-makereqs:
- bits=2048
commonname: $internal_hostname
dnsname: $internal_hostname
nodeid: $internal_hostname
outreq: /etc/receptor/tls/receptor.req
outkey: /etc/receptor/tls/receptor.key
{% if external_hostname is defined %}
dnsname=$external_hostname \
dnsname:$external_hostname
{% endif %}
{% if external_ipaddress is defined %}
ipaddress=$external_ipaddress \
ipaddress:$external_ipaddress
{% endif %}
outreq=/etc/receptor/tls/receptor.req \
outkey=/etc/receptor/tls/receptor.key
receptor --cert-signreq \
req=/etc/receptor/tls/receptor.req \
cacert=/etc/receptor/tls/ca/mesh-CA.crt \
cakey=/etc/receptor/tls/ca/mesh-CA.key \
outcert=/etc/receptor/tls/receptor.crt \
notafter=$(date --iso-8601=seconds --utc --date "10 years") \
verify=yes
exec receptor --config /etc/receptor/receptor.conf
cert-signreqs:
- req: /etc/receptor/tls/receptor.req
cacert: /etc/receptor/tls/ca/mesh-CA.crt
cakey: /etc/receptor/tls/ca/mesh-CA.key
outcert: /etc/receptor/tls/receptor.crt
notafter: $(date --iso-8601=seconds --utc --date "10 years")
resoluteCoder marked this conversation as resolved.
Show resolved Hide resolved
verify: yes
resoluteCoder marked this conversation as resolved.
Show resolved Hide resolved
EOF
receptor --config certgen-mesh-ingress.yaml
exec receptor --config /etc/receptor/receptor.yaml
image: '{{ _control_plane_ee_image }}'
imagePullPolicy: '{{ _image_pull_policy }}'
name: {{ ansible_operator_meta.name }}-mesh-ingress
volumeMounts:
- mountPath: /etc/receptor/receptor.conf
- mountPath: /etc/receptor/receptor.yaml
name: {{ ansible_operator_meta.name }}-receptor-config
subPath: receptor.conf
subPath: receptor.yaml
- mountPath: /etc/receptor/tls/ca/mesh-CA.crt
name: {{ ansible_operator_meta.name }}-receptor-ca
readOnly: true
Expand Down Expand Up @@ -97,6 +102,6 @@ spec:
defaultMode: 420
items:
- key: receptor_conf
path: receptor.conf
path: receptor.yaml
name: {{ ansible_operator_meta.name }}-receptor-config
name: {{ ansible_operator_meta.name }}-receptor-config
Loading