Cluster administration Red Hat OpenShift Service on AWS 4 Configuring Red Hat OpenShift Service on AWS clusters Red Hat OpenShift Documentation Team

Commands:
oc run netcat-test --image=busybox -i -t --restart=Never --rm -- /bin/sh
/ nc -zvv 192.168.1.1 8080 10.181.3.180 (10.181.3.180:8080) open sent 0, rcvd 0
/ nc -zvv 192.168.1.2 8080 nc: 10.181.3.180 (10.181.3.180:8081): Connection refused sent 0, rcvd 0
/ exit
oc run netcat-test --image=busybox -i -t --restart=Never --rm -- /bin/sh
/ nc -zvv 192.168.1.1 8080 10.181.3.180 (10.181.3.180:8080) open sent 0, rcvd 0
/ nc -zvv 192.168.1.2 8080 nc: 10.181.3.180 (10.181.3.180:8081): Connection refused sent 0, rcvd 0
/ exit
You have new non-redundant VPN connections One or more of your vpn connections are not using both tunnels. This mode of operation is not highly available and we strongly recommend you configure your second tunnel. View your non-redundant VPN connections.
rosa create cluster --cluster-name <cluster_name> --enable-autoscaling --interactive
? Configure cluster-autoscaler (optional): [? for help] (y/N) y <enter>
rosa create autoscaler --cluster=<mycluster> --interactive
rosa create cluster --cluster-name <cluster_name> --enable-autoscaling
rosa create cluster --cluster-name <cluster_name> --enable-autoscaling <parameter>
rosa create autoscaler --cluster=<mycluster>
rosa create autoscaler --cluster=<mycluster> <parameter>
rosa edit autoscaler --cluster=<mycluster>
rosa edit autoscaler --cluster=<mycluster> <parameter>
rosa describe autoscaler --cluster=<mycluster>
rosa delete autoscaler --cluster=<mycluster>
rosa edit autoscaler -h --cluster=<mycluster>
rosa edit autoscaler -h --cluster=<mycluster> <parameter>
rosa describe autoscaler -h --cluster=<mycluster>
rosa create machinepool --cluster=<cluster-name> --name=<machine_pool_id> --replicas=<replica_count> --instance-type=<instance_type> --labels=<key>=<value>,<key>=<value> --taints=<key>=<value>:<effect>,<key>=<value>:<effect> --use-spot-instances --spot-max-price=<price> --disk-size=<disk_size> --availability-zone=<availability_zone_name> --additional-security-group-ids <sec_group_id> --subnet <subnet_id>
rosa describe cluster -c <cluster name>|grep "Infra ID:"
Infra ID: mycluster-xqvj7
rosa create machinepool --cluster=mycluster --name=mymachinepool --replicas=2 --instance-type=m5.xlarge --labels=app=db,tier=backend
I: Machine pool 'mymachinepool' created successfully on cluster 'mycluster' I: To view all machine pools, run 'rosa list machinepools -c mycluster'
rosa create machinepool --cluster=<cluster-name> --name=<machine_pool_id> --enable-autoscaling --min-replicas=<minimum_replica_count> --max-replicas=<maximum_replica_count> --instance-type=<instance_type> --labels=<key>=<value>,<key>=<value> --taints=<key>=<value>:<effect>,<key>=<value>:<effect> --availability-zone=<availability_zone_name> --use-spot-instances --spot-max-price=<price>
rosa create machinepool --cluster=mycluster --name=mymachinepool --enable-autoscaling --min-replicas=3 --max-replicas=6 --instance-type=m5.xlarge --labels=app=db,tier=backend
I: Machine pool 'mymachinepool' created successfully on cluster 'mycluster' I: To view all machine pools, run 'rosa list machinepools -c mycluster'
rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES Default No 3 m5.xlarge us-east-1a, us-east-1b, us-east-1c N/A mymachinepool Yes 3-6 m5.xlarge app=db, tier=backend us-east-1a, us-east-1b, us-east-1c No
rosa describe machinepool --cluster=<cluster_name> --machinepool=mymachinepool
ID: mymachinepool Cluster ID: 27iimopsg1mge0m81l0sqivkne2qu6dr Autoscaling: Yes Replicas: 3-6 Instance type: m5.xlarge Labels: app=db, tier=backend Taints: Availability zones: us-east-1a, us-east-1b, us-east-1c Subnets: Spot instances: No Disk size: 300 GiB Security Group IDs:
rosa create cluster --worker-disk-size=<disk_size>
rosa create machinepool --cluster=<cluster_id> \ 1 --disk-size=<disk_size> 2
rosa delete machinepool -c=<cluster_name> <machine_pool_ID>
? Are you sure you want to delete machine pool <machine_pool_ID> on cluster <cluster_name>? (y/N)
rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES DISK SIZE SG IDs default No 2 m5.xlarge us-east-1a 300GiB sg-0e375ff0ec4a6cfa2 mp1 No 2 m5.xlarge us-east-1a 300GiB sg-0e375ff0ec4a6cfa2
rosa edit machinepool --cluster=<cluster_name> --replicas=<replica_count> \ 1 <machine_pool_id> 2
rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES DISK SIZE SG IDs default No 2 m5.xlarge us-east-1a 300GiB sg-0e375ff0ec4a6cfa2 mp1 No 3 m5.xlarge us-east-1a 300GiB sg-0e375ff0ec4a6cfa2
rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES Default No 2 m5.xlarge us-east-1a N/A db-nodes-mp No 2 m5.xlarge us-east-1a No
rosa edit machinepool --cluster=<cluster_name> --replicas=<replica_count> \ 1 --labels=<key>=<value>,<key>=<value> \ 2 <machine_pool_id>
rosa edit machinepool --cluster=mycluster --replicas=2 --labels=app=db,tier=backend db-nodes-mp
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
rosa edit machinepool --cluster=<cluster_name> --min-replicas=<minimum_replica_count> \ 1 --max-replicas=<maximum_replica_count> \ 2 --labels=<key>=<value>,<key>=<value> \ 3 <machine_pool_id>
rosa edit machinepool --cluster=mycluster --min-replicas=2 --max-replicas=3 --labels=app=db,tier=backend db-nodes-mp
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
rosa describe machinepool --cluster=<cluster_name> --machinepool=<machine-pool-name>
ID: db-nodes-mp Cluster ID: <ID_of_cluster> Autoscaling: No Replicas: 2 Instance type: m5.xlarge Labels: app=db, tier=backend Taints: Availability zones: us-east-1a Subnets: Spot instances: No Disk size: 300 GiB Security Group IDs:
rosa create machinepools --cluster=<name> --replicas=<replica_count> --name <mp_name> --tags='<key> <value>,<key> <value>' 1
rosa create machinepools --cluster=mycluster --replicas 2 --tags='tagkey1 tagvalue1,tagkey2 tagvaluev2' I: Checking available instance types for machine pool 'mp-1' I: Machine pool 'mp-1' created successfully on cluster 'mycluster' I: To view the machine pool details, run 'rosa describe machinepool --cluster mycluster --machinepool mp-1' I: To view all machine pools, run 'rosa list machinepools --cluster mycluster'
rosa describe machinepool --cluster=<cluster_name> --machinepool=<machinepool_name>
ID: mp-1 Cluster ID: 2baiirqa2141oreotoivp4sipq84vp5g Autoscaling: No Replicas: 2 Instance type: m5.xlarge Labels: Taints: Availability zones: us-east-1a Subnets: Spot instances: No Disk size: 300 GiB Additional Security Group IDs: Tags: red-hat-clustertype=rosa, red-hat-managed=true, tagkey1=tagvalue1, tagkey2=tagvaluev2
rosa list machinepools --cluster=<cluster_name>
rosa edit machinepool --cluster=<cluster_name> --replicas=<replica_count> \ 1 --taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ 2 <machine_pool_id>
rosa edit machinepool --cluster=mycluster --replicas 2 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
rosa edit machinepool --cluster=<cluster_name> --min-replicas=<minimum_replica_count> \ 1 --max-replicas=<maximum_replica_count> \ 2 --taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ 3 <machine_pool_id>
rosa edit machinepool --cluster=mycluster --min-replicas=2 --max-replicas=3 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
rosa describe machinepool --cluster=<cluster_name> --machinepool=<machinepool_name>
ID: db-nodes-mp Cluster ID: <ID_of_cluster> Autoscaling: No Replicas: 2 Instance type: m5.xlarge Labels: Taints: key1=value1:NoSchedule, key2=value2:NoExecute Availability zones: us-east-1a Subnets: Spot instances: No Disk size: 300 GiB Security Group IDs:
rosa create machinepool -c <cluster-name> -i
I: Enabling interactive mode 1 ? Machine pool name: xx-lz-xx 2 ? Create multi-AZ machine pool: No 3 ? Select subnet for a single AZ machine pool (optional): Yes 4 ? Subnet ID: subnet-<a> (region-info) 5 ? Enable autoscaling (optional): No 6 ? Replicas: 2 7 I: Fetching instance types 8 ? disk-size (optional): 9
rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SUBNETS SPOT INSTANCES DISK SIZE SG IDs worker No 2 m5.xlarge us-east-2a No 300 GiB mp1 No 2 m5.xlarge us-east-2a No 300 GiB
rosa edit machinepool --cluster=<cluster_name> <machinepool_ID> --enable-autoscaling --min-replicas=<number> --max-replicas=<number>
rosa edit machinepool --cluster=mycluster mp1 --enable-autoscaling --min-replicas=2 --max-replicas=5
rosa edit machinepool --cluster=<cluster_name> <machinepool_ID> --enable-autoscaling=false --replicas=<number>
rosa edit machinepool --cluster=mycluster default --enable-autoscaling=false --replicas=3
-XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90.
JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true"
apiVersion: v1 kind: Pod metadata: name: test spec: securityContext: runAsNonRoot: true seccompProfile: type: RuntimeDefault containers: - name: test image: fedora:latest command: - sleep - "3600" env: - name: MEMORY_REQUEST 1 valueFrom: resourceFieldRef: containerName: test resource: requests.memory - name: MEMORY_LIMIT 2 valueFrom: resourceFieldRef: containerName: test resource: limits.memory resources: requests: memory: 384Mi limits: memory: 512Mi securityContext: allowPrivilegeEscalation: false capabilities: drop: [ALL]
oc create -f <file_name>.yaml
oc rsh test
env | grep MEMORY | sort
MEMORY_LIMIT=536870912 MEMORY_REQUEST=402653184
oc rsh test
grep '^oom_kill ' /sys/fs/cgroup/memory/memory.oom_control
oom_kill 0
sed -e '' </dev/zero
Killed
echo USD?
137
grep '^oom_kill ' /sys/fs/cgroup/memory/memory.oom_control
oom_kill 1
oc get pod test
NAME READY STATUS RESTARTS AGE test 0/1 OOMKilled 0 1m
oc get pod test -o yaml
status: containerStatuses: - name: test ready: false restartCount: 0 state: terminated: exitCode: 137 reason: OOMKilled phase: Failed
oc get pod test -o yaml
status: containerStatuses: - name: test ready: true restartCount: 1 lastState: terminated: exitCode: 137 reason: OOMKilled state: running: phase: Running
oc get pod test
NAME READY STATUS RESTARTS AGE test 0/1 Evicted 0 1m
oc get pod test -o yaml
status: message: 'Pod The node was low on resource: [MemoryPressure].' phase: Failed reason: Evicted
rosa create kubeletconfig -c <cluster_name> --name <kubeletconfig_name> --pod-pids-limit=<value>
rosa create kubeletconfig -c my-cluster --name set-high-pids --pod-pids-limit=16384
rosa edit kubeletconfig -c <cluster_name> --name <kubeletconfig_name> --pod-pids-limit=<value>
oc get machineconfigpool
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE master rendered-master-06c9c4... True False False 3 3 3 0 4h42m worker rendered-worker-f4b64... True False False 4 4 4 0 4h42m
rosa describe kubeletconfig --cluster=<cluster_name>
Pod Pids Limit: 16384
rosa delete kubeletconfig --cluster <cluster_name> --name <kubeletconfig_name>
rosa describe kubeletconfig --name <cluster_name>