A CircleCI Orb to simplify deployments to Red Hat OpenShift.
Here are some features that the Red Hat OpenShift orb provides:
- Allowing
kubectl
and other tools that accesskubeconfig
(likehelm
) to connect to a local/remote Red Hat OpenShift cluster via thelogin-and-update-kubeconfig
command - Creating of a local Red Hat OpenShift cluster via the
create-local-cluster-with-oc
command. This could be useful for tests. - Installing the Red Hat OpenShift client CLI (
oc
) via theinstall-openshift-cli
command.
See the orb registry listing for usage guidelines.
curl
should be present inPATH
.
Full usage examples can be found on the Red Hat OpenShift orb's page in the orb registry, here.
version: 2.1
orbs:
redhat-openshift: circleci/redhat-openshift@0.1.0
kubernetes: circleci/kubernetes@0.3.0
jobs:
deploy-to-cluster:
executor: redhat-openshift/default
steps:
- redhat-openshift/login-and-update-kubeconfig:
# e.g. https://api.mycluster.myserver.org:6443
server-address: $OPENSHIFT_SERVER
username: $OPENSHIFT_USER
password: $OPENSHIFT_PASSWORD
# Enable this if the cluster uses a self-signed cert
insecure-skip-tls-verify: true
openshift-platform-version: "4.x"
- run:
name: Create example k8s deployment yaml file
command: |
cat \<<- EOF > deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
EOF
- kubernetes/create-or-update-resource:
resource-file-path: "deployment.yaml"
resource-name: "deployment/nginx-deployment"
get-rollout-status: true
workflows:
deployment:
jobs:
- deploy-to-cluster
We welcome issues to and pull requests against this repository!
For further questions/comments about this or other orbs, visit CircleCI's orbs discussion forum.