-
Notifications
You must be signed in to change notification settings - Fork 36
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
PERFSCALE-1848 AWS Windows workers enablement #200
base: master
Are you sure you want to change the base?
Changes from 1 commit
64d0b50
3b33361
1d05ef3
2647c43
3b6f108
3b2d62c
ba55fe4
0fb96a4
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: operator.openshift.io/v1 | ||
kind: Network | ||
metadata: | ||
name: cluster | ||
spec: | ||
defaultNetwork: | ||
ovnKubernetesConfig: | ||
hybridOverlayConfig: | ||
hybridClusterNetwork: | ||
- cidr: 10.132.0.0/14 | ||
hostPrefix: 23 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
openshift_toggle_windows_node: false | ||
openshift_wmco_image: "quay.io/winc/wmco-index:6.0.0" | ||
openshift_wmco_channel: "stable" | ||
openshift_windows_node_instance_type: "{{ openshift_worker_instance_type }}" | ||
primary_windows_image: "Windows_Server-2019-English-Full-ContainersLatest" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
# | ||
# Applies Windows Worker nodes configuration to a cluster post installation | ||
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. Remove commented aspects of the yaml |
||
# | ||
# Performs: | ||
# * Creates infra node machineset | ||
# * Creates workload node machineset | ||
# * Moves infra node pods/workload to infra nodes | ||
# These registers be set from post-install tasks, but if you skip those tasks, you can enable them here to run this role one-off. | ||
# - name: Get cluster name | ||
# shell: | | ||
# {%raw%}oc get machineset -n openshift-machine-api -o=go-template='{{(index (index .items 0).metadata.labels {%endraw%} "{{ machineset_metadata_label_prefix }}/cluster-api-cluster" {%raw%})}}'{%endraw%} | ||
# register: cluster_name | ||
# environment: | ||
# KUBECONFIG: "{{ kubeconfig_path }}" | ||
|
||
# - name: (AWS) set cluster region | ||
# shell: | | ||
# {%raw%}oc get machineset -n openshift-machine-api -o=go-template='{{(index .items 0).spec.template.spec.providerSpec.value.placement.region}}'{%endraw%} | ||
# register: aws_region | ||
# environment: | ||
# KUBECONFIG: "{{ kubeconfig_path }}" | ||
|
||
- name: winC AWS - Get Windows AMI ID | ||
shell: | | ||
aws ec2 describe-images --filters Name=name,Values={{ primary_windows_image }}* --region {{ aws_region.stdout }} --query {%raw%}'sort_by(Images, &CreationDate)[-1].[ImageId]'{%endraw%} --output text | ||
register: windows_ami_id | ||
when: platform == "aws" | ||
|
||
- name: winC - Create WMCO catalog source | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
name: openshift-windows-machine-config-operator | ||
template: catalogsource.yaml.j2 | ||
retries: 3 | ||
|
||
- name: winC - Wait for catalog source | ||
shell: oc get catalogsource wmco -o=jsonpath={.status.connectionState.lastObservedState} -n openshift-marketplace | ||
environment: | ||
KUBECONFIG: "{{ kubeconfig_path }}" | ||
register: result | ||
until: result.stdout == "READY" | ||
retries: 3 | ||
delay: 10 | ||
Comment on lines
+30
to
+44
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. Curious why do you have to create a catalogsource?, these steps are not part of https://docs.openshift.com/container-platform/4.11/windows_containers/enabling-windows-container-workloads.html 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! I do need to remove it. Learned that from the winc team yesterday. |
||
|
||
- name: winC - Create WMCO namespace | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
state: present | ||
api_version: v1 | ||
kind: Namespace | ||
name: openshift-windows-machine-config-operator | ||
|
||
- name: winC - Add monitoring label to wmco namespace | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
state: patched | ||
kind: Namespace | ||
name: openshift-windows-machine-config-operator | ||
definition: | ||
metadata: | ||
labels: | ||
openshift.io/cluster-monitoring: "true" | ||
rsevilla87 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: winC - Create WMCO operatorgroup | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
state: present | ||
template: operatorgroup.yaml | ||
|
||
- name: winC - Create SSH key secret for WMCO to reach nodes | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
api_version: v1 | ||
kind: Secret | ||
name: cloud-private-key | ||
namespace: openshift-windows-machine-config-operator | ||
definition: | ||
type: Opaque | ||
data: | ||
private-key.pem: "{{ lookup('file', lookup( 'env', 'PRIVATE_KEY' ) ) | b64encode }}" | ||
|
||
- name: winC - Create WMCO subscription | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
state: present | ||
template: subscription.yaml | ||
|
||
- name: winC - Wait for WMCO Deployment to be ready | ||
kubernetes.core.k8s_info: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
api_version: apps/v1 | ||
kind: Deployment | ||
name: windows-machine-config-operator | ||
namespace: openshift-windows-machine-config-operator | ||
wait: yes | ||
wait_condition: | ||
type: Available | ||
status: True | ||
reason: MinimumReplicasAvailable | ||
retries: 3 | ||
delay: 10 | ||
|
||
- name: winC AWS - Template out machineset yamls | ||
kubernetes.core.k8s: | ||
kubeconfig: "{{ kubeconfig_path }}" | ||
state: present | ||
template: aws-windows-node-machineset.yml.j2 | ||
when: platform == "aws" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
apiVersion: v1 | ||
items: | ||
- apiVersion: machine.openshift.io/v1beta1 | ||
kind: MachineSet | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
name: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}a | ||
namespace: openshift-machine-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}a | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
machine.openshift.io/os-id: Windows | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}a | ||
spec: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
node-role.kubernetes.io/worker: "" | ||
providerSpec: | ||
value: | ||
ami: | ||
id: {{windows_ami_id.stdout}} | ||
apiVersion: awsproviderconfig.openshift.io/v1beta1 | ||
blockDevices: | ||
- ebs: | ||
iops: {{openshift_worker_root_volume_iops}} | ||
volumeSize: {{openshift_worker_root_volume_size}} | ||
volumeType: {{openshift_worker_root_volume_type}} | ||
credentialsSecret: | ||
name: aws-cloud-credentials | ||
deviceIndex: 0 | ||
iamInstanceProfile: | ||
id: {{cluster_name.stdout}}-worker-profile | ||
instanceType: {{openshift_windows_node_instance_type}} | ||
kind: AWSMachineProviderConfig | ||
metadata: | ||
creationTimestamp: null | ||
placement: | ||
availabilityZone: {{aws_region.stdout}}a | ||
region: {{aws_region.stdout}} | ||
publicIp: false | ||
securityGroups: | ||
- filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-worker-sg | ||
subnet: | ||
filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-private-{{aws_region.stdout}}a | ||
tags: | ||
- name: kubernetes.io/cluster/{{cluster_name.stdout}} | ||
value: owned | ||
userDataSecret: | ||
name: windows-user-data | ||
versions: | ||
kubelet: "" | ||
status: | ||
replicas: 0 | ||
- apiVersion: machine.openshift.io/v1beta1 | ||
kind: MachineSet | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
name: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}b | ||
namespace: openshift-machine-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}b | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
machine.openshift.io/os-id: Windows | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}b | ||
spec: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
node-role.kubernetes.io/worker: "" | ||
providerSpec: | ||
value: | ||
ami: | ||
id: {{windows_ami_id.stdout}} | ||
apiVersion: awsproviderconfig.openshift.io/v1beta1 | ||
blockDevices: | ||
- ebs: | ||
iops: {{openshift_worker_root_volume_iops}} | ||
volumeSize: {{openshift_worker_root_volume_size}} | ||
volumeType: {{openshift_worker_root_volume_type}} | ||
credentialsSecret: | ||
name: aws-cloud-credentials | ||
deviceIndex: 0 | ||
iamInstanceProfile: | ||
id: {{cluster_name.stdout}}-worker-profile | ||
instanceType: {{openshift_windows_node_instance_type}} | ||
kind: AWSMachineProviderConfig | ||
metadata: | ||
creationTimestamp: null | ||
placement: | ||
availabilityZone: {{aws_region.stdout}}b | ||
region: {{aws_region.stdout}} | ||
publicIp: false | ||
securityGroups: | ||
- filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-worker-sg | ||
subnet: | ||
filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-private-{{aws_region.stdout}}b | ||
tags: | ||
- name: kubernetes.io/cluster/{{cluster_name.stdout}} | ||
value: owned | ||
userDataSecret: | ||
name: windows-user-data | ||
versions: | ||
kubelet: "" | ||
status: | ||
replicas: 0 | ||
- apiVersion: machine.openshift.io/v1beta1 | ||
kind: MachineSet | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
name: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}c | ||
namespace: openshift-machine-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}c | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
machine.openshift.io/os-id: Windows | ||
{{machineset_metadata_label_prefix}}/cluster-api-cluster: {{cluster_name.stdout}} | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-role: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machine-type: worker | ||
{{machineset_metadata_label_prefix}}/cluster-api-machineset: {{cluster_name.stdout}}-windows-worker-{{aws_region.stdout}}c | ||
spec: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
node-role.kubernetes.io/worker: "" | ||
providerSpec: | ||
value: | ||
ami: | ||
id: {{windows_ami_id.stdout}} | ||
apiVersion: awsproviderconfig.openshift.io/v1beta1 | ||
blockDevices: | ||
- ebs: | ||
iops: {{openshift_worker_root_volume_iops}} | ||
volumeSize: {{openshift_worker_root_volume_size}} | ||
volumeType: {{openshift_worker_root_volume_type}} | ||
credentialsSecret: | ||
name: aws-cloud-credentials | ||
deviceIndex: 0 | ||
iamInstanceProfile: | ||
id: {{cluster_name.stdout}}-worker-profile | ||
instanceType: {{openshift_windows_node_instance_type}} | ||
kind: AWSMachineProviderConfig | ||
metadata: | ||
creationTimestamp: null | ||
placement: | ||
availabilityZone: {{aws_region.stdout}}c | ||
region: {{aws_region.stdout}} | ||
publicIp: false | ||
securityGroups: | ||
- filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-worker-sg | ||
subnet: | ||
filters: | ||
- name: tag:Name | ||
values: | ||
- {{cluster_name.stdout}}-private-{{aws_region.stdout}}c | ||
tags: | ||
- name: kubernetes.io/cluster/{{cluster_name.stdout}} | ||
value: owned | ||
userDataSecret: | ||
name: windows-user-data | ||
versions: | ||
kubelet: "" | ||
status: | ||
replicas: 0 | ||
kind: List | ||
metadata: {} |
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.
Wonder if we should template this out, but default to this value or maybe the
:lateset