C:\Users\win10\Downloads\tower>ssh root@192.168.50.239 root@192.168.50.239's password: Activate the web console with: systemctl enable --now cockpit.socket Last login: Mon Mar 6 23:52:14 2023 from ::ffff:192.168.50.200 [root@localhost ~]# pwd /root [root@localhost ~]# mkdir ansible [root@localhost ~]# cd ansible
curl -sfL https://get.k3s.io | sh –
[root@localhost ansible]# curl -sfL https://get.k3s.io | sh -
[INFO] Finding release for channel stable
[INFO] Using v1.25.6+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.25.6+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.25.6+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
Rancher K3s Common (stable) 2.1 kB/s | 2.0 kB 00:00
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
k3s-selinux noarch 1.2-2.el8 rancher-k3s-common-stable 20 k
Installing dependencies:
container-selinux noarch 2:2.201.0-1.fc37 updates 50 k
Transaction Summary
========================================================================================================================
Install 2 Packages
Total download size: 70 k
Installed size: 157 k
Downloading Packages:
(1/2): container-selinux-2.201.0-1.fc37.noarch.rpm 148 kB/s | 50 kB 00:00
(2/2): k3s-selinux-1.2-2.el8.noarch.rpm 40 kB/s | 20 kB 00:00
------------------------------------------------------------------------------------------------------------------------Total 41 kB/s | 70 kB 00:01
Rancher K3s Common (stable) 7.7 kB/s | 2.4 kB 00:00
Importing GPG key 0xE257814A:
Userid : "Rancher (CI) <ci@rancher.com>"
Fingerprint: C8CF F216 4551 26E9 B9C9 18BE 925E A29A E257 814A
From : https://rpm.rancher.io/public.key
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1 Running scriptlet: container-selinux-2:2.201.0-1.fc37.noarch 1/2 Installing : container-selinux-2:2.201.0-1.fc37.noarch 1/2 Running scriptlet: container-selinux-2:2.201.0-1.fc37.noarch 1/2 Running scriptlet: k3s-selinux-1.2-2.el8.noarch 2/2 Installing : k3s-selinux-1.2-2.el8.noarch 2/2 Running scriptlet: k3s-selinux-1.2-2.el8.noarch 2/2 Conflicting name type transition rules
Binary policy creation failed at /var/lib/selinux/targeted/tmp/modules/200/k3s/cil:135
Failed to generate binary
/usr/sbin/semodule: Failed!
Running scriptlet: container-selinux-2:2.201.0-1.fc37.noarch
Running scriptlet: k3s-selinux-1.2-2.el8.noarch 2/2 Verifying : container-selinux-2:2.201.0-1.fc37.noarch 1/2 Verifying : k3s-selinux-1.2-2.el8.noarch 2/2
Installed:
container-selinux-2:2.201.0-1.fc37.noarch k3s-selinux-1.2-2.el8.noarch
Complete!
[INFO] Creating /usr/local/bin/kubectl symlink to k3s
[INFO] Creating /usr/local/bin/crictl symlink to k3s
[INFO] Creating /usr/local/bin/ctr symlink to k3s
[INFO] Creating killall script /usr/local/bin/k3s-killall.sh
[INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO] systemd: Creating service file /etc/systemd/system/k3s.service
[INFO] systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO] systemd: Starting k3s
==================================================================================================================

kubectl version
[root@localhost ansible]# kubectl version WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version. Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.6+k3s1", GitCommit:"9176e03c5788e467420376d10a1da2b6de6ff31f", GitTreeState:"clean", BuildDate:"2023-01-26T00:47:47Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"} Kustomize Version: v4.5.7 Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.6+k3s1", GitCommit:"9176e03c5788e467420376d10a1da2b6de6ff31f", GitTreeState:"clean", BuildDate:"2023-01-26T00:47:47Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}
kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain Ready control-plane,master 31m v1.25.6+k3s1
kubectl get pods –namespace awx
No resources found in awx namespace.
kubectl get ns
NAME STATUS AGE
default Active 31m
kube-system Active 31m
kube-public Active 31m
kube-node-lease Active 31m
https://github.com/ansible/awx-operator
curl -s “https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh” | bash
kubectl get pods
No resources found in default namespace.
vi kustomazation.yaml ----------------------------------------------------------------------------- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - github.com/ansible/awx-operator/config/default?ref=1.3.0 - awx.yaml images: - name: quay.io/ansible/awx-operator newTag: 1.3.0 namespace: awx
vi awx.yaml ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- apiVersion: awx.ansible.com/v1beta1 kind: AWX metadata: name: awx spec: service_type: nodeport nodeport_port: 300800 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
apiVersion: v1 kind: Namespace metadata: labels: control-plane: controller-manager name: awx --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxbackups.awx.ansible.com spec: group: awx.ansible.com names: kind: AWXBackup listKind: AWXBackupList plural: awxbackups singular: awxbackup scope: Namespaced versions: - name: v1beta1 schema: openAPIV3Schema: description: Schema validation for the AWXBackup CRD properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: additional_labels: description: Additional labels defined on the resource, which should be propagated to child resources items: type: string type: array backup_pvc: description: Name of the backup PVC type: string backup_pvc_namespace: description: (Deprecated) Namespace the PVC is in type: string backup_resource_requirements: description: Resource requirements for the management pod used to create a backup properties: limits: properties: cpu: type: string memory: type: string type: object requests: properties: cpu: type: string memory: type: string type: object type: object backup_storage_class: description: Storage class to use when creating PVC for backup type: string backup_storage_requirements: description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from) type: string clean_backup_on_delete: description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted type: boolean deployment_name: description: Name of the deployment to be backed up type: string no_log: default: true description: Configure no_log for no_log tasks type: boolean pg_dump_suffix: description: Additional parameters for the pg_dump command type: string postgres_image: description: Registry path to the PostgreSQL container to use type: string postgres_image_version: description: PostgreSQL container image version to use type: string postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string set_self_labels: default: true description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self) type: boolean required: - deployment_name type: object x-kubernetes-preserve-unknown-fields: true status: properties: backupClaim: description: Backup persistent volume claim type: string backupDirectory: description: Backup directory name on the specified pvc type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: properties: lastTransitionTime: type: string reason: type: string status: type: string type: type: string type: object type: array type: object x-kubernetes-preserve-unknown-fields: true type: object served: true storage: true subresources: status: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxrestores.awx.ansible.com spec: group: awx.ansible.com names: kind: AWXRestore listKind: AWXRestoreList plural: awxrestores singular: awxrestore scope: Namespaced versions: - name: v1beta1 schema: openAPIV3Schema: description: Schema validation for the AWXRestore CRD properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: additional_labels: description: Additional labels defined on the resource, which should be propagated to child resources items: type: string type: array backup_dir: description: Backup directory name, set as a status found on the awxbackup object (backupDirectory) type: string backup_name: description: AWXBackup object name type: string backup_pvc: description: Name of the PVC to be restored from, set as a status found on the awxbackup object (backupClaim) type: string backup_pvc_namespace: description: (Deprecated) Namespace the PVC is in type: string backup_source: description: Backup source enum: - CR - PVC type: string cluster_name: description: Cluster name type: string deployment_name: description: Name of the restored deployment. This should be different from the original deployment name if the original deployment still exists. type: string no_log: default: true description: Configure no_log for no_log tasks type: boolean postgres_image: description: Registry path to the PostgreSQL container to use type: string postgres_image_version: description: PostgreSQL container image version to use type: string postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string restore_resource_requirements: description: Resource requirements for the management pod that restores AWX from a backup properties: limits: properties: cpu: type: string memory: type: string type: object requests: properties: cpu: type: string memory: type: string type: object type: object set_self_labels: default: true description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self) type: boolean type: object x-kubernetes-preserve-unknown-fields: true status: properties: conditions: description: The resulting conditions when a Service Telemetry is instantiated items: properties: lastTransitionTime: type: string reason: type: string status: type: string type: type: string type: object type: array restoreComplete: description: Restore process complete type: boolean type: object x-kubernetes-preserve-unknown-fields: true type: object served: true storage: true subresources: status: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxs.awx.ansible.com spec: group: awx.ansible.com names: kind: AWX listKind: AWXList plural: awxs singular: awx scope: Namespaced versions: - name: v1beta1 schema: openAPIV3Schema: description: Schema validation for the AWX CRD properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: additional_labels: description: Additional labels defined on the resource, which should be propagated to child resources items: type: string type: array admin_email: description: The admin user email type: string admin_password_secret: description: Secret where the admin password can be found type: string admin_user: default: admin description: Username to use for the admin account type: string affinity: description: If specified, the pod's scheduling constraints properties: nodeAffinity: properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: preference: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchFields: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array type: object x-kubernetes-map-type: atomic weight: format: int32 type: integer required: - preference - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: properties: nodeSelectorTerms: items: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchFields: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array type: object x-kubernetes-map-type: atomic type: array required: - nodeSelectorTerms type: object x-kubernetes-map-type: atomic type: object podAffinity: properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: podAffinityTerm: properties: labelSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaceSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaces: items: type: string type: array topologyKey: type: string required: - topologyKey type: object weight: format: int32 type: integer required: - podAffinityTerm - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: items: properties: labelSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaceSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaces: items: type: string type: array topologyKey: type: string required: - topologyKey type: object type: array type: object podAntiAffinity: properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: podAffinityTerm: properties: labelSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaceSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaces: items: type: string type: array topologyKey: type: string required: - topologyKey type: object weight: format: int32 type: integer required: - podAffinityTerm - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: items: properties: labelSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaceSelector: properties: matchExpressions: items: properties: key: type: string operator: type: string values: items: type: string type: array required: - key - operator type: object type: array matchLabels: additionalProperties: type: string type: object type: object x-kubernetes-map-type: atomic namespaces: items: type: string type: array topologyKey: type: string required: - topologyKey type: object type: array type: object type: object annotations: description: annotations for the pods type: string api_version: description: apiVersion of the deployment type type: string auto_upgrade: default: true description: Should AWX instances be automatically upgraded when operator gets upgraded type: boolean broadcast_websocket_secret: description: Secret where the broadcast websocket secret can be found type: string bundle_cacert_secret: description: Secret where can be found the trusted Certificate Authority Bundle type: string ca_trust_bundle: description: Path where the trusted CA bundle is available type: string control_plane_ee_image: description: Registry path to the Execution Environment container image to use on control plane pods type: string control_plane_priority_class: description: Assign a preexisting priority class to the control plane pods type: string create_preload_data: default: true description: Whether or not to preload data upon instance creation type: boolean csrf_cookie_secure: description: Set csrf cookie secure mode for web type: string deployment_type: description: Name of the deployment type type: string development_mode: description: If the deployment should be done in development mode type: boolean ee_extra_env: type: string ee_extra_volume_mounts: description: Specify volume mounts to be added to Execution container type: string ee_images: description: Registry path to the Execution Environment container to use items: properties: image: type: string name: type: string type: object type: array ee_pull_credentials_secret: description: Secret where pull credentials for registered ees can be found type: string ee_resource_requirements: description: Resource requirements for the ee container properties: limits: properties: cpu: type: string memory: type: string storage: type: string type: object requests: properties: cpu: type: string memory: type: string storage: type: string type: object type: object extra_settings: description: Extra settings to specify for the API items: properties: setting: type: string value: x-kubernetes-preserve-unknown-fields: true type: object type: array extra_volumes: description: Specify extra volumes to add to the application pod type: string garbage_collect_secrets: default: false description: Whether or not to remove secrets upon instance removal type: boolean hostname: description: The hostname of the instance type: string image: description: Registry path to the application container to use type: string image_pull_policy: default: IfNotPresent description: The image pull policy enum: - Always - always - Never - never - IfNotPresent - ifnotpresent type: string image_pull_secret: description: (Deprecated) Image pull secret for app and database containers type: string image_pull_secrets: description: Image pull secrets for app and database containers items: type: string type: array image_version: description: Application container image version to use type: string ingress_annotations: description: Annotations to add to the Ingress Controller type: string ingress_api_version: description: The Ingress API version to use type: string ingress_class_name: description: The name of ingress class to use instead of the cluster default. type: string ingress_path: description: The ingress path used to reach the deployed service type: string ingress_path_type: description: The ingress path type for the deployed service type: string ingress_tls_secret: description: Secret where the Ingress TLS secret can be found type: string ingress_type: description: The ingress type to use to reach the deployed instance enum: - none - Ingress - ingress - Route - route type: string init_container_extra_commands: description: Extra commands for the init container type: string init_container_extra_volume_mounts: description: Specify volume mounts to be added to the init container type: string init_container_image: description: Registry path to the init container to use type: string init_container_image_version: description: Init container image version to use type: string init_projects_container_image: description: Registry path to the init projects container to use type: string ipv6_disabled: default: false description: Disable web container's nginx ipv6 listener type: boolean kind: description: Kind of the deployment type type: string ldap_cacert_secret: description: Secret where can be found the LDAP trusted Certificate Authority Bundle type: string ldap_password_secret: description: Secret where can be found the LDAP bind password type: string loadbalancer_port: default: 80 description: Port to use for the loadbalancer type: integer loadbalancer_protocol: default: http description: Protocol to use for the loadbalancer enum: - http - https type: string no_log: default: true description: Configure no_log for no_log tasks type: boolean node_selector: description: nodeSelector for the pods type: string nodeport_port: description: Port to use for the nodeport type: integer old_postgres_configuration_secret: description: Secret where the old database configuration can be found for data migration type: string postgres_configuration_secret: description: Secret where the database configuration can be found type: string postgres_data_path: description: Path where the PostgreSQL data are located type: string postgres_extra_args: items: type: string type: array postgres_image: description: Registry path to the PostgreSQL container to use type: string postgres_image_version: description: PostgreSQL container image version to use type: string postgres_init_container_resource_requirements: description: Resource requirements for the postgres init container properties: limits: properties: cpu: type: string memory: type: string storage: type: string type: object requests: properties: cpu: type: string memory: type: string storage: type: string type: object type: object postgres_keep_pvc_after_upgrade: description: Specify whether or not to keep the old PVC after PostgreSQL upgrades type: boolean postgres_label_selector: description: Label selector used to identify postgres pod for data migration type: string postgres_priority_class: description: Assign a preexisting priority class to the postgres pod type: string postgres_resource_requirements: description: Resource requirements for the PostgreSQL container properties: limits: properties: cpu: type: string memory: type: string type: object requests: properties: cpu: type: string memory: type: string type: object type: object postgres_selector: description: nodeSelector for the Postgres pods type: string postgres_storage_class: description: Storage class to use for the PostgreSQL PVC type: string postgres_storage_requirements: description: Storage requirements for the PostgreSQL container properties: limits: properties: storage: type: string type: object requests: properties: storage: type: string type: object type: object postgres_tolerations: description: node tolerations for the Postgres pods type: string projects_existing_claim: description: PersistentVolumeClaim to mount /var/lib/projects directory type: string projects_persistence: default: false description: Whether or not the /var/lib/projects directory will be persistent type: boolean projects_storage_access_mode: default: ReadWriteMany description: AccessMode for the /var/lib/projects PersistentVolumeClaim type: string projects_storage_class: description: Storage class for the /var/lib/projects PersistentVolumeClaim type: string projects_storage_size: default: 8Gi description: Size for the /var/lib/projects PersistentVolumeClaim type: string projects_use_existing_claim: description: Using existing PersistentVolumeClaim enum: - _Yes_ - _No_ type: string redis_capabilities: description: Redis container capabilities items: type: string type: array redis_image: description: Registry path to the redis container to use type: string redis_image_version: description: Redis container image version to use type: string redis_resource_requirements: description: Resource requirements for the redis container properties: limits: properties: cpu: type: string memory: type: string storage: type: string type: object requests: properties: cpu: type: string memory: type: string storage: type: string type: object type: object replicas: default: 1 description: Number of instance replicas format: int32 type: integer route_api_version: description: The route API version to use type: string route_host: description: The DNS to use to points to the instance type: string route_tls_secret: description: Secret where the TLS related credentials are stored type: string route_tls_termination_mechanism: default: Edge description: The secure TLS termination mechanism to use enum: - Edge - edge - Passthrough - passthrough type: string secret_key_secret: description: Secret where the secret key can be found type: string security_context_settings: description: Key/values that will be set under the pod-level securityContext field type: object x-kubernetes-preserve-unknown-fields: true service_account_annotations: description: ServiceAccount annotations type: string service_annotations: description: Annotations to add to the service type: string service_labels: description: Additional labels to apply to the service type: string service_type: description: The service type to be used on the deployed instance enum: - LoadBalancer - loadbalancer - ClusterIP - clusterip - NodePort - nodeport type: string session_cookie_secure: description: Set session cookie secure mode for web type: string set_self_labels: default: true description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self) type: boolean task_args: items: type: string type: array task_command: items: type: string type: array task_extra_env: type: string task_extra_volume_mounts: description: Specify volume mounts to be added to Task container type: string task_privileged: default: false description: If a privileged security context should be enabled type: boolean task_resource_requirements: description: Resource requirements for the task container properties: limits: properties: cpu: type: string memory: type: string storage: type: string type: object requests: properties: cpu: type: string memory: type: string storage: type: string type: object type: object termination_grace_period_seconds: description: Optional duration in seconds pods needs to terminate gracefully format: int32 type: integer tolerations: description: node tolerations for the pods type: string topology_spread_constraints: description: topology rule(s) for the pods type: string web_args: items: type: string type: array web_command: items: type: string type: array web_extra_env: type: string web_extra_volume_mounts: description: Specify volume mounts to be added to the Web container type: string web_resource_requirements: description: Resource requirements for the web container properties: limits: properties: cpu: type: string memory: type: string storage: type: string type: object requests: properties: cpu: type: string memory: type: string storage: type: string type: object type: object type: object status: properties: URL: description: URL to access the deployed instance type: string adminPasswordSecret: description: Admin password secret name of the deployed instance type: string adminUser: description: Admin user of the deployed instance type: string broadcastWebsocketSecret: description: Broadcast websocket secret name of the deployed instance type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: properties: lastTransitionTime: type: string reason: type: string status: type: string type: type: string type: object type: array image: description: URL of the image used for the deployed instance type: string migratedFromSecret: description: The secret used for migrating an old instance type: string postgresConfigurationSecret: description: Postgres Configuration secret name of the deployed instance type: string secretKeySecret: description: Secret key secret name of the deployed instance type: string upgradedPostgresVersion: description: Status to indicate that the database has been upgraded to the version in the status type: string version: description: Version of the deployed instance type: string type: object type: object served: true storage: true subresources: status: {} --- apiVersion: v1 kind: ServiceAccount metadata: name: awx-operator-controller-manager namespace: awx --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: creationTimestamp: null name: awx-operator-awx-manager-role namespace: awx rules: - apiGroups: - route.openshift.io resources: - routes - routes/custom-host verbs: - get - list - create - delete - patch - update - watch - apiGroups: - "" - rbac.authorization.k8s.io resources: - pods - services - services/finalizers - serviceaccounts - endpoints - persistentvolumeclaims - events - configmaps - secrets - roles - rolebindings verbs: - get - list - create - delete - patch - update - watch - apiGroups: - apps - networking.k8s.io resources: - deployments - daemonsets - replicasets - statefulsets - ingresses verbs: - get - list - create - delete - patch - update - watch - apiGroups: - monitoring.coreos.com resources: - servicemonitors verbs: - get - create - apiGroups: - apps resourceNames: - awx-operator resources: - deployments/finalizers verbs: - update - apiGroups: - apps resources: - deployments/scale - statefulsets/scale verbs: - patch - apiGroups: - "" resources: - pods/exec - pods/attach - pods/log verbs: - create - get - apiGroups: - apps resources: - replicasets verbs: - get - create - apiGroups: - awx.ansible.com resources: - '*' - awxbackups - awxrestores verbs: - '*' --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: awx-operator-leader-election-role namespace: awx rules: - apiGroups: - "" resources: - configmaps verbs: - get - list - watch - create - update - patch - delete - apiGroups: - coordination.k8s.io resources: - leases verbs: - get - list - watch - create - update - patch - delete - apiGroups: - "" resources: - events verbs: - create - patch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: awx-operator-metrics-reader rules: - nonResourceURLs: - /metrics verbs: - get --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: awx-operator-proxy-role rules: - apiGroups: - authentication.k8s.io resources: - tokenreviews verbs: - create - apiGroups: - authorization.k8s.io resources: - subjectaccessreviews verbs: - create --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: awx-operator-awx-manager-rolebinding namespace: awx roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: awx-operator-awx-manager-role subjects: - kind: ServiceAccount name: awx-operator-controller-manager namespace: awx --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: awx-operator-leader-election-rolebinding namespace: awx roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: awx-operator-leader-election-role subjects: - kind: ServiceAccount name: awx-operator-controller-manager namespace: awx --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: awx-operator-proxy-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: awx-operator-proxy-role subjects: - kind: ServiceAccount name: awx-operator-controller-manager namespace: awx --- apiVersion: v1 data: controller_manager_config.yaml: | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 kind: ControllerManagerConfig health: healthProbeBindAddress: :6789 metrics: bindAddress: 127.0.0.1:8080 leaderElection: leaderElect: true resourceName: 811c9dc5.ansible.com # leaderElectionReleaseOnCancel defines if the leader should step down volume # when the Manager ends. This requires the binary to immediately end when the # Manager is stopped, otherwise, this setting is unsafe. Setting this significantly # speeds up voluntary leader transitions as the new leader don't have to wait # LeaseDuration time first. # In the default scaffold provided, the program ends immediately after # the manager stops, so would be fine to enable this option. However, # if you are doing or is intended to do any operation such as perform cleanups # after the manager stops then its usage might be unsafe. # leaderElectionReleaseOnCancel: true kind: ConfigMap metadata: name: awx-operator-awx-manager-config namespace: awx --- apiVersion: v1 kind: Service metadata: labels: control-plane: controller-manager name: awx-operator-controller-manager-metrics-service namespace: awx spec: ports: - name: https port: 8443 protocol: TCP targetPort: https selector: control-plane: controller-manager --- apiVersion: apps/v1 kind: Deployment metadata: labels: control-plane: controller-manager name: awx-operator-controller-manager namespace: awx spec: replicas: 1 selector: matchLabels: control-plane: controller-manager template: metadata: annotations: kubectl.kubernetes.io/default-container: awx-manager labels: control-plane: controller-manager spec: containers: - args: - --secure-listen-address=0.0.0.0:8443 - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - --v=0 image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 name: kube-rbac-proxy ports: - containerPort: 8443 name: https protocol: TCP resources: limits: cpu: 500m memory: 128Mi requests: cpu: 5m memory: 64Mi securityContext: allowPrivilegeEscalation: false - args: - --health-probe-bind-address=:6789 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - --leader-election-id=awx-operator env: - name: ANSIBLE_GATHERING value: explicit - name: ANSIBLE_DEBUG_LOGS value: "false" - name: WATCH_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace image: quay.io/ansible/awx-operator:1.3.0 livenessProbe: httpGet: path: /healthz port: 6789 initialDelaySeconds: 15 periodSeconds: 20 name: awx-manager readinessProbe: httpGet: path: /readyz port: 6789 initialDelaySeconds: 5 periodSeconds: 10 resources: limits: cpu: 2000m memory: 4096Mi requests: cpu: 50m memory: 32Mi securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL imagePullSecrets: - name: redhat-operators-pull-secret securityContext: runAsNonRoot: true serviceAccountName: awx-operator-controller-manager terminationGracePeriodSeconds: 10 --- apiVersion: awx.ansible.com/v1beta1 kind: AWX metadata: name: awx namespace: awx spec: nodeport_port: 300800 service_type: nodeport [root@localhost ansible]# ls awx.yaml kustomization.yaml [root@localhost ansible]# cat kustomization.yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - github.com/ansible/awx-operator/config/default?ref=1.3.0 - awx.yaml images: - name: quay.io/ansible/awx-operator newTag: 1.3.0 namespace: awx
kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager –namespace awx