-
Notifications
You must be signed in to change notification settings - Fork 253
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
Support keystone with certificate #224
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,7 @@ OPENSTACK_CLOUD_CONFIG_PLAIN=$(cat "$CLOUDS_PATH") | |
|
||
MACHINE_CONTROLLER_SSH_PRIVATE_FILE=openstack_tmp | ||
MACHINE_CONTROLLER_SSH_HOME=${HOME}/.ssh/ | ||
CACERT="/etc/certs/cacert" | ||
|
||
# Set up the output dir if it does not yet exist | ||
mkdir -p $PWD/$OUTPUT | ||
|
@@ -159,7 +160,7 @@ PASSWORD=$(echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" | yq r - clouds.$CLOUD.auth.pass | |
REGION=$(echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" | yq r - clouds.$CLOUD.region_name) | ||
PROJECT_ID=$(echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" | yq r - clouds.$CLOUD.auth.project_id) | ||
DOMAIN_NAME=$(echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" | yq r - clouds.$CLOUD.auth.user_domain_name) | ||
|
||
CACERT_ORIGINAL=$(echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" | yq r - clouds.$CLOUD.cacert) | ||
|
||
# Basic cloud.conf, no LB configuration as that data is not known yet. | ||
OPENSTACK_CLOUD_PROVIDER_CONF_PLAIN="[Global] | ||
|
@@ -171,11 +172,23 @@ tenant-id=\"$PROJECT_ID\" | |
domain-name=\"$DOMAIN_NAME\" | ||
" | ||
|
||
if [ "$CACERT_ORIGINAL" != "null" ]; then | ||
OPENSTACK_CLOUD_PROVIDER_CONF_PLAIN="$OPENSTACK_CLOUD_PROVIDER_CONF_PLAIN | ||
ca-file=\"$CACERT\" | ||
" | ||
fi | ||
|
||
OS=$(uname) | ||
if [[ "$OS" =~ "Linux" ]]; then | ||
OPENSTACK_CLOUD_PROVIDER_CONF=$(echo "$OPENSTACK_CLOUD_PROVIDER_CONF_PLAIN"|base64 -w0) | ||
if [ "$CACERT_ORIGINAL" != "null" ]; then | ||
OPENSTACK_CLOUD_CACERT_CONFIG=$(cat "$CACERT_ORIGINAL"|base64 -w0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the refer the test result below:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hchenxa Besides this issue, does there are any other issues that we need to raise with this PR? @hidekazuna can you help update? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am ok now, I prefer to do some offline test before merge (http and https) ... thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think @hidekazuna still need some update for his PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hchenxa can you help try
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found missed cmd/clusterctl/examples/openstack/provider-component/user-data/centos/templates/master-user-data.sh and worker-user-data.sh. I will update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated by 0bf8a1b There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hchenxa you should configure the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
fi | ||
elif [[ "$OS" =~ "Darwin" ]]; then | ||
OPENSTACK_CLOUD_PROVIDER_CONF=$(echo "$OPENSTACK_CLOUD_PROVIDER_CONF_PLAIN"|base64) | ||
if [ "$CACERT_ORIGINAL" != "null" ]; then | ||
OPENSTACK_CLOUD_CACERT_CONFIG=$(cat "$CACERT_ORIGINAL"|base64) | ||
fi | ||
else | ||
echo "Unrecognized OS : $OS" | ||
exit 1 | ||
|
@@ -184,24 +197,32 @@ fi | |
if [[ "$PROVIDER_OS" == "coreos" ]]; then | ||
cat $COREOS_COMMON_SECTION \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_PROVIDER_CONF#$OPENSTACK_CLOUD_PROVIDER_CONF#" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_CACERT_CONFIG#$OPENSTACK_CLOUD_CACERT_CONFIG#" \ | ||
| yq m -a - $COREOS_MASTER_SECTION \ | ||
> $COREOS_MASTER_USER_DATA | ||
cat $COREOS_COMMON_SECTION \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_PROVIDER_CONF#$OPENSTACK_CLOUD_PROVIDER_CONF#" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_CACERT_CONFIG#$OPENSTACK_CLOUD_CACERT_CONFIG#" \ | ||
| yq m -a - $COREOS_WORKER_SECTION \ | ||
> $COREOS_WORKER_USER_DATA | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you updated centos and ubuntu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Updated files for coreos. |
||
cat "$MASTER_USER_DATA" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_PROVIDER_CONF#$OPENSTACK_CLOUD_PROVIDER_CONF#" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_CACERT_CONFIG#$OPENSTACK_CLOUD_CACERT_CONFIG#" \ | ||
> $USERDATA/$PROVIDER_OS/master-user-data.sh | ||
cat "$WORKER_USER_DATA" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_PROVIDER_CONF#$OPENSTACK_CLOUD_PROVIDER_CONF#" \ | ||
| sed -e "s#\$OPENSTACK_CLOUD_CACERT_CONFIG#$OPENSTACK_CLOUD_CACERT_CONFIG#" \ | ||
> $USERDATA/$PROVIDER_OS/worker-user-data.sh | ||
fi | ||
|
||
printf $CLOUD > $CONFIG_DIR/os_cloud.txt | ||
echo "$OPENSTACK_CLOUD_CONFIG_PLAIN" > $CONFIG_DIR/clouds.yaml | ||
|
||
if [ "$CACERT_ORIGINAL" != "null" ]; then | ||
cat "$CACERT_ORIGINAL" > $CONFIG_DIR/cacert | ||
else | ||
echo "dummy" > $CONFIG_DIR/cacert | ||
fi | ||
|
||
# Build provider-components.yaml with kustomize | ||
# Coreos has a different kubeadm path (/usr is read-only) so gets a different kustomization. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,8 @@ CLUSTER_DNS_SERVER=$(prips ${SERVICE_CIDR} | head -n 11 | tail -n 1) | |
|
||
# Write the cloud.conf so that the kubelet can use it. | ||
echo $OPENSTACK_CLOUD_PROVIDER_CONF | base64 -d > /etc/kubernetes/cloud.conf | ||
mkdir /etc/certs | ||
echo $OPENSTACK_CLOUD_CACERT_CONFIG | base64 -d > /etc/certs/cacert | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks added this for centos. |
||
|
||
# Set up kubeadm config file to pass to kubeadm join. | ||
cat > /etc/kubernetes/kubeadm_config.yaml <<EOF | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 be problem if cacert doesn't exist...
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.
Fixed in the following commit: 192e70c