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
#!/bin/bash | |
# Function to check certificate expiration using openssl | |
check_certificate_expiration() { | |
local service_name=$1 | |
local endpoint=$2 | |
echo -e "\nChecking certificate for $service_name at $endpoint" | |
expiration_date=$(echo | openssl s_client -connect $endpoint 2>/dev/null | openssl x509 -noout -dates | grep 'notAfter' | cut -d= -f2) | |
if [ -z "$expiration_date" ]; then |
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
FROM registry.access.redhat.com/ubi9/ubi:latest | |
RUN dnf -y --enablerepo=ubi-9-baseos-rpms install dhcp-server |
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
apiVersion: operator.openshift.io/v1 | |
kind: IngressController | |
metadata: | |
creationTimestamp: '2024-04-26T01:27:20Z' | |
finalizers: | |
- ingresscontroller.operator.openshift.io/finalizer-ingresscontroller | |
generation: 1 | |
managedFields: | |
- apiVersion: operator.openshift.io/v1 | |
fieldsType: FieldsV1 |
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
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: checks-openshift | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: checks-openshift |
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
kind: BuildConfig | |
apiVersion: build.openshift.io/v1 | |
metadata: | |
annotations: | |
openshift.io/generated-by: OpenShiftNewApp | |
pipeline.alpha.openshift.io/uses: '[{"name": "jenkins", "namespace": "", "kind": "DeploymentConfig"}]' | |
resourceVersion: '1758456' | |
name: tasks-pipeline | |
uid: fdc77381-5d75-4711-b530-616c6a215b12 | |
creationTimestamp: '2022-09-20T14:56:32Z' |
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
export control_cluster=$(oc config current-context) | |
for cluster in ocp1 ocp2 ocp3; do | |
password=$(oc --context ${control_cluster} get secret $(oc --context ${control_cluster} get clusterdeployment ${cluster} -n ${cluster} -o jsonpath='{.spec.clusterMetadata.adminPasswordSecretRef.name}') -n ${cluster} -o jsonpath='{.data.password}' | base64 -d) | |
url=$(oc --context ${control_cluster} get clusterdeployment ${cluster} -n ${cluster} -o jsonpath='{.status.apiURL}') | |
console_url=$(oc --context ${control_cluster} get clusterdeployment ${cluster} -n ${cluster} -o jsonpath='{.status.webConsoleURL}') | |
oc login -u kubeadmin -p ${password} --insecure-skip-tls-verify=true ${url} | |
oc config set-cluster ${cluster} --insecure-skip-tls-verify=true --server ${url} | |
oc config set-credentials admin-${cluster} --token $(oc whoami -t) | |
oc config set-context $cluster --cluster ${cluster} --user=admin-${cluster} | |
echo cluster: ${cluster} |
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
oc get project <project> -o json |grep -v "kubernetes" > <project>.json | |
apiVersion": "project.openshift.io/v1" --- before | |
"kind": "Project""apiVersion": "v1" --- after | |
"kind": "Namespace" | |
oc proxy --port=8080 & |
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
{"auths":{"cloud.openshift.com":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K2pheXNvbnpoYW93b3JrMWkwd2hzNW8wcGd5ZG40c3FmcGdsMGhvdnhoOk0yV0JXUVpHWUNQN0FNUVlQVkNWNFRJUU04T0tZSFBIUkY4SFFERU5BRjcyTkNDRUIzUzg3T1MxRE9WWDdDU0E=","email":"jaysonzhao@vip.qq.com"},"quay.io":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K2pheXNvbnpoYW93b3JrMWkwd2hzNW8wcGd5ZG40c3FmcGdsMGhvdnhoOk0yV0JXUVpHWUNQN0FNUVlQVkNWNFRJUU04T0tZSFBIUkY4SFFERU5BRjcyTkNDRUIzUzg3T1MxRE9WWDdDU0E=","email":"jaysonzhao@vip.qq.com"},"registry.connect.redhat.com":{"auth":"NTIzMTEzNDJ8dWhjLTFJMHdIUzVvMHBHWWRONHNRRnBnbDBIb3Z4aDpleUpoYkdjaU9pSlNVelV4TWlKOS5leUp6ZFdJaU9pSXpNRFJtTnpJNVltWTFZMlEwWkRSbE9XWTFNekJtWlROaVkyTm1NV1kyT1NKOS5ycnpvbHdrckZBNGdmZGFQWUFSbHpnLUdNZWNBbUhNOEgyTzV6QWFGeUQ5VzV0YkhMQ3pXWm02LUtoaDU5MDE5Z2JEU2pQVUJKWFNlZlkxU25kVlFRdXBuUE1DQlpYZ1hLSThZWlFlN1pTQXo2bzktSzhMbFA4QS00ODhJeVJMNlMyaTJ3YkFQYjIzb3RUM2F6TXhFUGNRNGVUbmZHZ0JILWplS3IwTW9DX2hsbERLaDVjbHN1ZTIxNGloSk03QU1Tcm5iSVBiSHJZNnltanFWd3M4ZGF0bHhWMEI2TGlPbmo4bHRYaG5kS09naFl2dkltajJqRHBHV1Y1WTZ0bm95V3R2MXRaZzF |
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
apiVersion: tekton.dev/v1beta1 | |
kind: Pipeline | |
metadata: | |
name: build-and-deploy-openshift | |
namespace: tekton-pipelines | |
resourceVersion: '4658308' | |
uid: fb3261bc-68dc-4834-a604-d47a38f577ea | |
spec: | |
params: |
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
### Create file called machine-config-daemon-force in /run ### | |
ssh core@hostname.local sudo touch /run/machine-config-daemon-force | |
### Edit node annotations ### | |
oc edit node <node-name> | |
### Check Annotations, change like below sample ### | |
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/reason: "" |
NewerOlder