-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Provisioning updates. #5361
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
Provisioning updates. #5361
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 |
|---|---|---|
|
|
@@ -66,11 +66,23 @@ def action_needed(csr, action): | |
|
|
||
| return False | ||
|
|
||
| def get_csr_request(self, request): | ||
|
Contributor
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 don't understand why we're duplicating code here.
Contributor
Author
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. Ah, these are the code bits that produce the generated code that's in the |
||
| '''base64 decode the request object and call openssl to determine the | ||
| subject and specifically the CN: from the request | ||
|
|
||
| Output: | ||
| (0, '... | ||
| Subject: O=system:nodes, CN=system:node:ip-172-31-54-54.ec2.internal | ||
| ...') | ||
| ''' | ||
| import base64 | ||
| return self._run(['openssl', 'req', '-noout', '-text'], base64.b64decode(request))[1] | ||
|
|
||
| def match_node(self, csr): | ||
| '''match an inc csr to a node in self.nodes''' | ||
| for node in self.nodes: | ||
| # we have a match | ||
| if node['name'] in csr['metadata']['name']: | ||
| # we need to match based upon the csr's request certificate's CN | ||
| if node['name'] in self.get_csr_request(csr['spec']['request']): | ||
| node['csrs'][csr['metadata']['name']] = csr | ||
|
|
||
| # check that the username is the node and type is 'Approved' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| {% if openshift_aws_node_user_data is defined and openshift_aws_node_user_data != '' %} | ||
| {{ openshift_aws_node_user_data }} | ||
| {% else %} | ||
| #cloud-config | ||
| write_files: | ||
| - path: /root/openshift_bootstrap/openshift_settings.yaml | ||
| owner: 'root:root' | ||
| permissions: '0640' | ||
| content: | | ||
| openshift_group_type: {{ openshift_aws_node_group_type }} | ||
| {% if openshift_aws_node_group_type != 'master' %} | ||
| - path: /etc/origin/node/csr_kubeconfig | ||
|
Contributor
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'd prefer to call this bootstrap.kubeconfig to be consistent with its use and other kubeconfig files. Can be a followup.
Contributor
Author
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. Ok, sounds good. |
||
| owner: 'root:root' | ||
| permissions: '0640' | ||
| encoding: b64 | ||
| content: {{ openshift_aws_launch_config_bootstrap_token | b64encode }} | ||
| {% endif %} | ||
| runcmd: | ||
| {% if openshift_aws_node_run_bootstrap_startup %} | ||
| - [ ansible-playbook, /root/openshift_bootstrap/bootstrap.yml] | ||
| {% endif %} | ||
| {% if openshift_aws_node_group_type != 'master' %} | ||
| - [ systemctl, enable, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node] | ||
| - [ systemctl, start, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node] | ||
| {% endif %} | ||
| {% endif %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,3 +54,88 @@ r_openshift_master_sdn_network_plugin_name: "{{ r_openshift_master_sdn_network_p | |
|
|
||
| openshift_master_image_config_latest_default: "{{ openshift_image_config_latest | default(False) }}" | ||
| openshift_master_image_config_latest: "{{ openshift_master_image_config_latest_default }}" | ||
|
|
||
| openshift_master_config_dir_default: "{{ (openshift.common.config_base | default('/etc/origin/master')) ~ '/master' }}" | ||
| openshift_master_config_dir: "{{ openshift_master_config_dir_default }}" | ||
| openshift_master_cloud_provider: "{{ openshift_cloudprovider_kind | default('aws') }}" | ||
|
|
||
| openshift_master_node_config_networkconfig_mtu: 1450 | ||
|
|
||
| openshift_master_node_config_kubeletargs_cpu: 500m | ||
|
Contributor
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. These seem like node group specific settings, applied as defaults to a node-config generated per node group. |
||
| openshift_master_node_config_kubeletargs_mem: 512M | ||
|
|
||
| openshift_master_bootstrap_enabled: False | ||
|
|
||
| openshift_master_client_binary: "{{ openshift.common.client_binary if openshift is defined else 'oc' }}" | ||
|
|
||
| openshift_master_config_imageconfig_format: "{{ oreg_url if oreg_url != '' else 'registry.access.redhat.com/openshift3/ose-${component}:${version}' }}" | ||
|
Contributor
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. Don't we already have this in another form?
Contributor
Author
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 think the one that is used is oreg_url so I stayed with it. I'm open to change here. |
||
|
|
||
| # these are for the default settings in a generated node-config.yaml | ||
| openshift_master_node_config_default_edits: | ||
| - key: nodeName | ||
| state: absent | ||
| - key: dnsBindAddress | ||
| value: 127.0.0.1:53 | ||
| - key: dnsDomain | ||
| value: cluster.local | ||
| - key: dnsRecursiveResolvConf | ||
| value: /etc/origin/node/resolv.conf | ||
| - key: imageConfig.format | ||
| value: "{{ openshift_master_config_imageconfig_format }}" | ||
| - key: kubeletArguments.cloud-config | ||
| value: | ||
| - "/etc/origin/cloudprovider/{{ openshift_master_cloud_provider }}.conf" | ||
| - key: kubeletArguments.cloud-provider | ||
| value: | ||
| - "{{ openshift_master_cloud_provider }}" | ||
| - key: kubeletArguments.kube-reserved | ||
| value: | ||
| - "cpu={{ openshift_master_node_config_kubeletargs_cpu }},memory={{ openshift_master_node_config_kubeletargs_mem }}" | ||
| - key: kubeletArguments.system-reserved | ||
| value: | ||
| - "cpu={{ openshift_master_node_config_kubeletargs_cpu }},memory={{ openshift_master_node_config_kubeletargs_mem }}" | ||
| - key: enable-controller-attach-detach | ||
| value: | ||
| - 'true' | ||
| - key: networkConfig.mtu | ||
| value: 8951 | ||
| - key: networkConfig.networkPluginName | ||
| value: "{{ r_openshift_master_sdn_network_plugin_name }}" | ||
| - key: networkPluginName | ||
| value: "{{ r_openshift_master_sdn_network_plugin_name }}" | ||
|
|
||
|
|
||
| # We support labels for all nodes here | ||
| openshift_master_node_config_kubeletargs_default_labels: [] | ||
| # We do support overrides for node group labels | ||
| openshift_master_node_config_kubeletargs_master_labels: [] | ||
| openshift_master_node_config_kubeletargs_infra_labels: [] | ||
| openshift_master_node_config_kubeletargs_compute_labels: [] | ||
|
|
||
| openshift_master_node_config_master: | ||
| type: master | ||
| edits: | ||
| - key: kubeletArguments.node-labels | ||
| value: "{{ openshift_master_node_config_kubeletargs_default_labels | | ||
| union(openshift_master_node_config_kubeletargs_master_labels) | | ||
| union(['type=master']) }}" | ||
| openshift_master_node_config_infra: | ||
| type: infra | ||
| edits: | ||
| - key: kubeletArguments.node-labels | ||
| value: "{{ openshift_master_node_config_kubeletargs_default_labels | | ||
| union(openshift_master_node_config_kubeletargs_infra_labels) | | ||
| union(['type=infra']) }}" | ||
| openshift_master_node_config_compute: | ||
| type: compute | ||
| edits: | ||
| - key: kubeletArguments.node-labels | ||
| value: "{{ openshift_master_node_config_kubeletargs_default_labels | | ||
| union(openshift_master_node_config_kubeletargs_compute_labels) | | ||
| union(['type=compute']) }}" | ||
|
|
||
| openshift_master_node_configs: | ||
| - "{{ openshift_master_node_config_infra }}" | ||
| - "{{ openshift_master_node_config_compute }}" | ||
|
|
||
| openshift_master_bootstrap_namespace: openshift-node | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,5 @@ galaxy_info: | |
| - cloud | ||
| dependencies: | ||
| - role: lib_openshift | ||
| - role: lib_utils | ||
| - role: lib_os_firewall | ||
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.
import should be at the top of the file.
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.
Generally speaking I agree that it should be. This is a generated file and to minimize the impact I'd prefer to localize it.
This is a stop gap until the product accepts node CSRs.