Crie uma conta no openshitd redhat https://console.redhat.com/openshift/create/local
e baixe o minishift e execute, se for no windows
use
no powershell o comando
crc setup
crc start
copie e cole o pull secret para terminar a instalacao
Crie uma conta no openshitd redhat https://console.redhat.com/openshift/create/local
e baixe o minishift e execute, se for no windows
use
no powershell o comando
crc setup
crc start
copie e cole o pull secret para terminar a instalacao
baixe o oc cli no link https://console-openshift-console.apps.sandbox-m2.ll9k.p1.openshiftapps.com/command-line-tools na la parte onde tem um ?interogacao
descompacte e coloque numa pasta e nao esqueca de colocar o oc.exe nas variaiveis de ambiente
voce vai precisar logar use via https
no site https://console-openshift-console.apps.sandbox-m2.ll9k.p1.openshiftapps.com/command-line-tools vai la perto do logout e copy login commmand
vc vai logar novamente e vai aparecer uma url pra logar, COPIE E COLE NO POWERSHELL OU TERMINAL E JA ERA
oc login --token=sha256~U3HcFrJAbPLYdSdLN9-sssssAAAWWWWWW--server=https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443
Error from server (Forbidden): pods is forbidden: User "developer" cannot list resource "pods" in API group "" in the namespace "default"
PS C:\Users\Lucas> oc login --token=sha256~U3HcFrJAbPLYdSdLN9-C4SSSSSSSSqd20Q --server=https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443
Logged into "https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443" as "lfontini" using the token provided.
You have one project on this server: "lfontini-dev"
Using project "lfontini-dev".
PS C:\Users\Lucas>
https://gitlab.com/practical-openshift/labs
CRIANDPO UM POD
PS C:\Users\Lucas\labs\pods> oc create -f .\pod.yaml
pod/hello-world-pod created
PS C:\Users\Lucas\labs\pods> oc get pods
NAME READY STATUS RESTARTS AGE
hello-world-pod 1/1 Running 0 5s
PS C:\Users\Lucas\labs\pods> cat .\pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: hello-world-pod
labels:
app: hello-world-pod
spec:
containers:
- env:
- name: MESSAGE
value: Hi! I'm an environment variable
image: quay.io/practicalopenshift/hello-world
imagePullPolicy: Always
name: hello-world-override
resources: {}
PS C:\Users\Lucas\labs\pods>
Navegar dentro do pod
PS C:\Users\Lucas\labs\pods> oc rsh hello-world-pod
~ $
~ $
~ $
PS C:\Users\Lucas\labs\pods> oc delete -f .\pod.yaml
pod "hello-world-pod" deleted
PS C:\Users\Lucas\labs\pods> ls
Diretório: C:\Users\Lucas\labs\pods
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 23/03/2024 19:30 330 pod.yaml
-a---- 23/03/2024 19:30 343 pod2.yaml
-a---- 23/03/2024 19:30 192 service.yaml
PS C:\Users\Lucas\labs\pods> oc get pods
No resources found in lfontini-dev namespace.
PS C:\Users\Lucas\labs\pods>
error: unknown command "DeploymentConfig.spec" for "oc"
PS C:\Users\Lucas\labs\pods> oc explain deploymentconfig.spec
GROUP: apps.openshift.io
KIND: DeploymentConfig
VERSION: v1
FIELD: spec <DeploymentConfigSpec>
DESCRIPTION:
Spec represents a desired deployment state and how to deploy to it.
DeploymentConfigSpec represents the desired state of the deployment.
FIELDS:
minReadySeconds <integer>
MinReadySeconds is the minimum number of seconds for which a newly created
pod should be ready without any of its container crashing, for it to be
considered available. Defaults to 0 (pod will be considered available as
soon as it is ready)
paused <boolean>
Paused indicates that the deployment config is paused resulting in no new
deployments on template changes or changes in the template caused by other
triggers.
replicas <integer>
Replicas is the number of desired replicas.
revisionHistoryLimit <integer>
RevisionHistoryLimit is the number of old ReplicationControllers to retain
to allow for rollbacks. This field is a pointer to allow for differentiation
LatestVersion. If null, defaults to having a config change trigger.
PS C:\Users\Lucas\labs\pods> oc explain deploymentconfig.spec.replicas
GROUP: apps.openshift.io
KIND: DeploymentConfig
VERSION: v1
FIELD: replicas <integer>
DESCRIPTION:
Replicas is the number of desired replicas.
PS C:\Users\Lucas\labs\pods>
PS C:\Users\Lucas\labs\pods> oc get is
No resources found in lfontini-dev namespace.
PS C:\Users\Lucas\labs\pods> oc get imagestream
No resources found in lfontini-dev namespace.
PS C:\Users\Lucas\labs\pods>
criando uma nova
oc import image
PS C:\Users\Lucas\labs\pods> oc import-image --confirm <endereco da imagem>