-
Notifications
You must be signed in to change notification settings - Fork 52
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
[wip] add systemd services for configuration after start #980
base: master
Are you sure you want to change the base?
Conversation
systemd/crc-dnsmasq.sh
Outdated
address=/apps-crc.testing/$ip | ||
address=/api.crc.testing/$ip | ||
address=/api-int.crc.testing/$ip | ||
address=/$hostName.crc.testing/$iip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this one for node name resolve (in OCP context) Also I think ip
should be node name dummy IP which is 192.168.126.11?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah probably not needed now, i think this was needed before moving to SNO and in the crc code-base we still have it so added here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we test it with dummy IP 192.168.126.11
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean using address=/$hostName.crc.testing/192.168.126.11
? instead of use the result from hostname -i
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes right, because this is used by internal service resolution so it might work.
8ccdb6e
to
bd2b783
Compare
525b66d
to
1f5383b
Compare
systemd/ocp-cluster-status.sh
Outdated
done | ||
|
||
# need to set a marker to let `crc` know the cluster is ready | ||
# touch /tmp/.crc-cluster-ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a file in the guest, you can also write a 'ready' notification message to a socket. podman does something similar: cfergeau@9e80530
systemd/crc-pullsecret.sh
Outdated
[ $retry == $max_retry ] && exit 1 | ||
sleep 5 | ||
((retry++)) | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it is common/recommended to do this, but it might be possible to express "oc get secret ready" as a systemd unit
/test e2e-snc |
/retest |
9fd0545
to
e6a4516
Compare
systemd/ocp-cluster-ca.sh
Outdated
|
||
if [ -z $CRC_CLOUD ]; then | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
2 similar comments
/retest |
/retest |
@@ -0,0 +1,24 @@ | |||
# Self sufficient bundles | |||
|
|||
Since release 4.19.0 of OpenShift Local, the bundles generated by `snc` contains additional systemd services to provision the cluster and removes the need of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since release 4.19.0 of OpenShift Local, the bundles generated by `snc` contains additional systemd services to provision the cluster and removes the need of | |
Since release 4.19.0 of OpenShift Local, the bundles generated by `snc` contain additional systemd services to provision the cluster and remove the need for |
# Self sufficient bundles | ||
|
||
Since release 4.19.0 of OpenShift Local, the bundles generated by `snc` contains additional systemd services to provision the cluster and removes the need of | ||
an outside entity for provision the cluster, although an outside process needs to create some files on pre-defined locations inside the VM for the systemd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an outside entity for provision the cluster, although an outside process needs to create some files on pre-defined locations inside the VM for the systemd | |
an outside entity to provision the cluster, although an outside process needs to create some files on pre-defined locations inside the VM for the systemd |
an outside entity for provision the cluster, although an outside process needs to create some files on pre-defined locations inside the VM for the systemd | ||
services to do their work. | ||
|
||
## The following table lists the systemd services and the location of files they need to provision the cluster, users of SNC needs to create those files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## The following table lists the systemd services and the location of files they need to provision the cluster, users of SNC needs to create those files | |
## The following table lists the systemd services and the location of files they need to provision the cluster, users of SNC need to create those files |
|
||
> [!NOTE] | ||
> "Marker env variable" is set using an env file, if the required env variable is not set then unit is skipped | ||
> some units are ran only when CRC_CLOUD=1 is set, these are only needed when using the bundles with crc-cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> some units are ran only when CRC_CLOUD=1 is set, these are only needed when using the bundles with crc-cloud | |
> some units are run only when CRC_CLOUD=1 is set, these are only needed when using the bundles with crc-cloud |
done | ||
|
||
# need to set a marker to let `crc` know the cluster is ready | ||
# touch /tmp/.crc-cluster-ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, Are these commented-out lines important? If not, shall we remove them?
return 1 | ||
} | ||
|
||
# rm -rf /tmp/.crc-cluster-ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemd/ocp-clusterid.sh
Outdated
retry=0 | ||
max_retry=20 | ||
until `oc get clusterversion > /dev/null 2>&1` | ||
do | ||
[ $retry == $max_retry ] && exit 1 | ||
sleep 5 | ||
((retry++)) | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this block of code duplicated across various scripts where we are waiting for some resource to become available. I'm not 100% sure if it's possible to do it in SystemD setup but can we move this to a generic method that can handle various resource types? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe with https://fedoramagazine.org/systemd-template-unit-files/
Or just by using a shared script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll extract this into a function that we can re-use across scripts
12df080
to
c4d5572
Compare
systemd/crc-pullsecret.sh
Outdated
echo "${existingPs}" | jq -e '.auths' | ||
|
||
if [[ $? != 0 ]]; then | ||
pullSecretB64=$(cat /opt/crc/pull-secret) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pullSecretB64=$(cat /opt/crc/pull-secret | base64 -w0)
systemd/crc-cluster-status.sh
Outdated
|
||
export KUBECONFIG=/opt/kubeconfig | ||
|
||
function check_cluster_unhealthy() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name should be check_cluster_healthy
and return value should be 0 in case successful and 1 in case failure.
systemd/crc-cluster-status.sh
Outdated
CLUSTER_HEALTH_SLEEP=8 | ||
CLUSTER_HEALTH_RETRIES=500 | ||
|
||
while $(check_cluster_unhealthy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should change to while ! check_cluster_healthy
a62f49b
to
0ed44f4
Compare
the services does the various needed tasks to setup the ocp or microshift cluster, these systemd units runs small shell scripts which are based on: https://github.com/crc-org/crc-cloud/blob/main/pkg/bundle/setup/clustersetup.sh and does the following tasks: - creates crc specific configurations for dnsmasq - sets a new uuid as cluster id - creates the pod for routes-controller - tries to grow the disk and filesystem - checks if the cluster operators are ready - adds the pull secret to the cluster - sets kubeadmin and developer user passwords - sets a custom ca for authentication - sets custom nip.io cluster domain
@anjannath: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
this adds 4 small systemd services that: