mirror of
https://github.com/Expand-sys/awx-on-k3s
synced 2025-12-16 05:52:15 +11:00
add: add examples for dns and env for container group
This commit is contained in:
parent
c60c4bc9be
commit
23495bc7ac
1 changed files with 22 additions and 4 deletions
|
|
@ -3,13 +3,15 @@
|
||||||
|
|
||||||
You can customize the specification of the Pod of the Execution Environment using **Container Group**.
|
You can customize the specification of the Pod of the Execution Environment using **Container Group**.
|
||||||
|
|
||||||
In this example, we make the Execution Environment to work with the Pod with following specification .
|
In this example, we make the Execution Environment to work with the Pod with following specification.
|
||||||
|
|
||||||
- Run in a different namespace `ee-demo` instead of default one
|
- Run in a different namespace `ee-demo` instead of default one
|
||||||
- Have an additional label `app: ee-demo-pod`
|
- Have an additional label `app: ee-demo-pod`
|
||||||
- Have `requests` and `limits` for CPU and Memory resources
|
- Have `requests` and `limits` for CPU and Memory resources
|
||||||
- Mount PVC as `/etc/demo`
|
- Mount PVC as `/etc/demo`
|
||||||
- Run on the node with the label `awx-node-type: demo` using `nodeSelector`
|
- Run on the node with the label `awx-node-type: demo` using `nodeSelector`
|
||||||
|
- Have custom environment variable `MY_CUSTOM_ENV`
|
||||||
|
- Use custom DNS server `192.168.0.100` in addition to the default DNS servers
|
||||||
|
|
||||||
<!-- omit in toc -->
|
<!-- omit in toc -->
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
@ -73,9 +75,9 @@ Note that this is a little tricky but super useful way to duplicate resource bet
|
||||||
|
|
||||||
### Create Container Group
|
### Create Container Group
|
||||||
|
|
||||||
You can create new Container Group by `Administration` > `Instance Group`.
|
You can create new Container Group by `Administration` > `Instance Group` > `Add`.
|
||||||
|
|
||||||
Chake `Customize pod specification` and define specification as following.
|
Enable `Customize pod specification` and define specification as following.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|
@ -85,6 +87,8 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: ee-demo-pod
|
app: ee-demo-pod
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: default
|
||||||
|
automountServiceAccountToken: false
|
||||||
containers:
|
containers:
|
||||||
- image: 'quay.io/ansible/awx-ee:latest'
|
- image: 'quay.io/ansible/awx-ee:latest'
|
||||||
name: worker
|
name: worker
|
||||||
|
|
@ -92,6 +96,9 @@ spec:
|
||||||
- ansible-runner
|
- ansible-runner
|
||||||
- worker
|
- worker
|
||||||
- '--private-data-dir=/runner'
|
- '--private-data-dir=/runner'
|
||||||
|
env:
|
||||||
|
- name: MY_CUSTOM_ENV
|
||||||
|
value: 'This is my custom environment variable'
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
|
|
@ -104,6 +111,9 @@ spec:
|
||||||
mountPath: /etc/demo
|
mountPath: /etc/demo
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
awx-node-type: demo
|
awx-node-type: demo
|
||||||
|
dnsConfig:
|
||||||
|
nameservers:
|
||||||
|
- 192.168.0.100
|
||||||
volumes:
|
volumes:
|
||||||
- name: demo-volume
|
- name: demo-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
|
|
@ -117,12 +127,14 @@ This is the customized manifest to achieve;
|
||||||
- Having `requests` and `limits` for CPU and Memory resources
|
- Having `requests` and `limits` for CPU and Memory resources
|
||||||
- Mounting PVC as `/etc/demo`
|
- Mounting PVC as `/etc/demo`
|
||||||
- Running on the node with the label `awx-node-type: demo` using `nodeSelector`
|
- Running on the node with the label `awx-node-type: demo` using `nodeSelector`
|
||||||
|
- Having custom environment variable `MY_CUSTOM_ENV`
|
||||||
|
- Using custom DNS server `192.168.0.100` in addition to the default DNS servers
|
||||||
|
|
||||||
You can also change `image`, but it will be overridden by specifying Execution Environment for the Job Template, Project Default, or Global Default.
|
You can also change `image`, but it will be overridden by specifying Execution Environment for the Job Template, Project Default, or Global Default.
|
||||||
|
|
||||||
## Quick Testing
|
## Quick Testing
|
||||||
|
|
||||||
The use of Container Group can be specified in the Job Template. After specifying and running the Job, you can see the result as follows.
|
The Container Group that to be used can be specified as `Instance Groups` in the Job Template. After specifying and running the Job, you can see the result as follows.
|
||||||
|
|
||||||
The Pod for the Job is running in `ee-demo` namespace.
|
The Pod for the Job is running in `ee-demo` namespace.
|
||||||
|
|
||||||
|
|
@ -146,6 +158,9 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
...
|
...
|
||||||
|
env:
|
||||||
|
- name: MY_CUSTOM_ENV
|
||||||
|
value: This is my custom environment variable
|
||||||
image: registry.example.com/ansible/ee:2.12-custom
|
image: registry.example.com/ansible/ee:2.12-custom
|
||||||
...
|
...
|
||||||
resources:
|
resources:
|
||||||
|
|
@ -160,6 +175,9 @@ spec:
|
||||||
- mountPath: /etc/demo
|
- mountPath: /etc/demo
|
||||||
name: demo-volume
|
name: demo-volume
|
||||||
...
|
...
|
||||||
|
dnsConfig:
|
||||||
|
nameservers:
|
||||||
|
- 192.168.0.100
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
awx-node-type: demo
|
awx-node-type: demo
|
||||||
...
|
...
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue