-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
362 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2024 VEXXHOST, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# portworx_pure_flasharray_san_type: | ||
# portworx_pure_json: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2024 VEXXHOST, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
galaxy_info: | ||
author: VEXXHOST, Inc. | ||
description: Ansible role for Portworx | ||
license: Apache-2.0 | ||
min_ansible_version: 5.5.0 | ||
standalone: false | ||
platforms: | ||
- name: EL | ||
versions: | ||
- "8" | ||
- "9" | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
- jammy | ||
|
||
dependencies: | ||
- role: defaults | ||
- role: multipathd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright (c) 2024 VEXXHOST, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
- name: Detect if InitiatorName is set | ||
ansible.builtin.slurp: | ||
src: /etc/iscsi/initiatorname.iscsi | ||
register: portworx_iscsi_initiatorname | ||
|
||
- name: Configure InitiatorName | ||
when: "'InitiatorName' not in portworx_iscsi_initiatorname.content | b64decode" | ||
block: | ||
- name: Generate a new InitiatorName | ||
ansible.builtin.shell: | ||
cmd: iscsi-iname | ||
register: portworx_iscsi_iname | ||
|
||
- name: Write the new InitiatorName | ||
ansible.builtin.copy: | ||
content: "InitiatorName={{ portworx_iscsi_iname.stdout }}" | ||
dest: /etc/iscsi/initiatorname.iscsi | ||
owner: root | ||
group: root | ||
mode: "0644" | ||
|
||
- name: Install Portworx | ||
run_once: true | ||
kubernetes.core.k8s: | ||
state: present | ||
template: | ||
- portworx.yml | ||
- config.yml | ||
|
||
- name: Wait till the CRDs are created | ||
run_once: true | ||
kubernetes.core.k8s_info: | ||
api_version: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
name: storageclusters.core.libopenstorage.org | ||
# NOTE(mnaser): Portworx operator creates the CRDs for the cluster | ||
# so we need to make sure they're created before we proceed. | ||
retries: 60 | ||
delay: 5 | ||
register: _result | ||
until: _result.resources | length > 0 | ||
|
||
- name: Create Portworx Storage Cluster | ||
run_once: true | ||
kubernetes.core.k8s: | ||
state: present | ||
template: | ||
- storage_cluster.yml | ||
- storage_class.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: px-pure-secret | ||
namespace: portworx | ||
stringData: | ||
pure.json: '{{ portworx_pure_json | to_json }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# SOURCE: https://install.portworx.com/?comp=pxoperator | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: portworx-operator | ||
namespace: kube-system | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: portworx-operator | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: portworx-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: portworx-operator | ||
namespace: kube-system | ||
roleRef: | ||
kind: ClusterRole | ||
name: portworx-operator | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: portworx-operator | ||
namespace: kube-system | ||
spec: | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: portworx-operator | ||
template: | ||
metadata: | ||
labels: | ||
name: portworx-operator | ||
spec: | ||
containers: | ||
- name: portworx-operator | ||
imagePullPolicy: Always | ||
image: portworx/px-operator:23.10.5 | ||
command: | ||
- /operator | ||
- --verbose | ||
- --driver=portworx | ||
- --leader-elect=true | ||
env: | ||
- name: OPERATOR_NAME | ||
value: portworx-operator | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: "name" | ||
operator: In | ||
values: | ||
- portworx-operator | ||
topologyKey: "kubernetes.io/hostname" | ||
serviceAccountName: portworx-operator | ||
# NOTE(mnaser): Add this to keep running on control plane | ||
nodeSelector: | ||
openstack-control-plane: enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: general | ||
annotations: | ||
storageclass.kubernetes.io/is-default-class: "true" | ||
provisioner: pxd.portworx.com | ||
parameters: | ||
backend: pure_block | ||
allowVolumeExpansion: true |
Oops, something went wrong.