Created
March 26, 2019 05:49
-
-
Save zahodi/d6ced9d9078a227dfa1cbfa6039b5af2 to your computer and use it in GitHub Desktop.
awx ansible inventory defintion for use with k8s, make sure you have an ingress controller running
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
--- | |
groups: | |
all: | |
vars: | |
eks_namespaces: | |
- awx | |
- ingress-nginx | |
k8s_secrets: | |
- apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: your_organization-wildcard | |
namespace: awx | |
type: kubernetes.io/tls | |
data: | |
tls.crt: "{{ your_organization_crt }}" | |
tls.key: "{{ your_organization_key }}" | |
pvc_defintions: | |
- kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: awx-db | |
namespace: awx | |
labels: | |
app: awx | |
role: db-pvc | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 10Gi | |
storageClassName: gp2 | |
ingress_defintions: | |
- apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: awx | |
namespace: awx | |
annotations: | |
kubernetes.io/ingress.class: "nginx" | |
nginx.ingress.kubernetes.io/ssl-redirect: "true" | |
spec: | |
tls: | |
- hosts: | |
- awx-core.your_organization.io | |
secretName: your_organization-wildcard | |
rules: | |
- host: awx-core.your_organization.io | |
http: | |
paths: | |
- path: / | |
backend: | |
serviceName: awx-web | |
servicePort: 80 | |
deployment_defintions: | |
# awx-cache | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: awx-cache | |
namespace: awx | |
labels: | |
app: awx | |
role: cache | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: awx | |
role: cache | |
spec: | |
containers: | |
- name: memcached | |
image: memcached:alpine | |
ports: | |
- name: memcached | |
containerPort: 11211 | |
# awx-db | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: awx-db | |
namespace: awx | |
labels: | |
app: awx | |
role: database | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: awx | |
role: database | |
spec: | |
containers: | |
- name: postgres | |
image: postgres:9.6 | |
ports: | |
- name: postgres | |
containerPort: 5432 | |
env: | |
- name: POSTGRES_DB | |
value: awx | |
- name: POSTGRES_PASSWORD | |
value: awxpass | |
- name: POSTGRES_USER | |
value: awx | |
- name: PGDATA | |
value: "/var/lib/postgresql/data/pgdata" | |
volumeMounts: | |
- mountPath: /var/lib/postgresql/data | |
name: data-volume | |
volumes: | |
- name: data-volume | |
persistentVolumeClaim: | |
claimName: awx-db | |
# awx-queue | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: awx-queue | |
namespace: awx | |
labels: | |
app: awx | |
role: queue | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: awx | |
role: queue | |
spec: | |
containers: | |
- name: rabbitmq | |
image: rabbitmq:3 | |
env: | |
- name: RABBITMQ_DEFAULT_VHOST | |
value: awx | |
ports: | |
- containerPort: 5672 | |
# awx-task | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: awx-task | |
namespace: awx | |
labels: | |
app: awx | |
role: task | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: awx | |
role: task | |
spec: | |
containers: | |
- name: awx-task | |
image: ansible/awx_task:latest | |
env: | |
- name: DATABASE_HOST | |
value: awx-db | |
- name: DATABASE_NAME | |
value: awx | |
- name: DATABASE_PASSWORD | |
value: awxpass | |
- name: DATABASE_PORT | |
value: "5432" | |
- name: DATABASE_USER | |
value: awx | |
- name: MEMCACHED_HOST | |
value: awx-cache | |
- name: MEMCACHED_PORT | |
value: "11211" | |
- name: RABBITMQ_HOST | |
value: awx-queue | |
- name: RABBITMQ_PASSWORD | |
value: guest | |
- name: RABBITMQ_PORT | |
value: "5672" | |
- name: RABBITMQ_USER | |
value: guest | |
- name: RABBITMQ_VHOST | |
value: awx | |
- name: SECRET_KEY | |
value: aabbcc | |
# awx-web | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: awx-web | |
namespace: awx | |
labels: | |
app: awx | |
role: web | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: awx | |
role: web | |
spec: | |
containers: | |
- name: awx-web | |
image: ansible/awx_web:latest | |
ports: | |
- name: http | |
containerPort: 8052 | |
env: | |
- name: DATABASE_HOST | |
value: awx-db | |
- name: DATABASE_NAME | |
value: awx | |
- name: DATABASE_PASSWORD | |
value: awxpass | |
- name: DATABASE_PORT | |
value: "5432" | |
- name: DATABASE_USER | |
value: awx | |
- name: MEMCACHED_HOST | |
value: awx-cache | |
- name: MEMCACHED_PORT | |
value: "11211" | |
- name: RABBITMQ_HOST | |
value: awx-queue | |
- name: RABBITMQ_PASSWORD | |
value: guest | |
- name: RABBITMQ_PORT | |
value: "5672" | |
- name: RABBITMQ_USER | |
value: guest | |
- name: RABBITMQ_VHOST | |
value: awx | |
- name: SECRET_KEY | |
value: aabbcc | |
service_definitions: | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: awx-cache | |
namespace: awx | |
spec: | |
ports: | |
- name: memcached | |
port: 11211 | |
targetPort: 11211 | |
selector: | |
app: awx | |
role: cache | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: awx-web | |
namespace: awx | |
spec: | |
ports: | |
- name: http | |
port: 80 | |
targetPort: 8052 | |
selector: | |
app: awx | |
role: web | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: awx-db | |
namespace: awx | |
spec: | |
ports: | |
- name: postgres | |
port: 5432 | |
targetPort: 5432 | |
selector: | |
app: awx | |
role: database | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: awx-db | |
namespace: awx | |
spec: | |
ports: | |
- name: postgres | |
port: 5432 | |
targetPort: 5432 | |
selector: | |
app: awx | |
role: database | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: awx-queue | |
namespace: awx | |
spec: | |
ports: | |
- name: queue | |
port: 5672 | |
targetPort: 5672 | |
selector: | |
app: awx | |
role: queue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment