forked fromcodefresh-io/cf-deploy-kubernetes
- Notifications
You must be signed in to change notification settings - Fork0
alex-codefresh/cf-deploy-kubernetes
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the source code for thecodefresh/cf-deploy-kubernetes container.This container is used to demonstrate a Kubernetes deployment using Codefresh.io
The deployment script makes the following assumptions about your application andKubernetes configuration:
- The application is deployed using the Kubernetes deployment API (versus thethe replication controller directly). For more information readhttp://kubernetes.io/docs/user-guide/deployments/
- The tested codebase has a yaml file (i.e. deployment.yml) that describes the Kubernetes deploymentparameters and configuration of your application.
- The script processes deployment.yml as a simple template where all
{{ ENV_VARIABLE }}are replaced with a value of $ENV_VARIABLE deployment.yml
The following env variables control the deployment configuration:
- KUBERNETES_DEPLOYMENT_TIMEOUT - How much to wait for a successful deployment before failing the build. Defaults to 120 (secs).
- KUBECONTEXT - corresponds to the name of a cluster added to codefresh
- KUBERNETES_NAMESPACE - The namespace to deploy
- KUBECTL_ACTION - means an action for
kubectl <action>. Valid values are apply|create|replace. Default is "apply"
Optional:
SERVER_VERSION - Manually set the Minor kubectl version. Supports 10-16.
---apiVersion:extensions/v1beta1kind:Deploymentmetadata:name:api-svcspec:replicas:1template:metadata:annotations:revision:"{{CF_REVISION}}"labels:app:api-svcspec:containers: -name:apisvcimage:myrepo/apisvc:{{CF_BRANCH}}-{{CF_REVISION}}ports: -containerPort:80name:http
---version:'1.0'steps:build:type:builddockerfile:Dockerfileimage_name:myrepo/apisvctag:'${{CF_BRANCH}}-{{CF_REVISION}}'push:type:pushcandidate:${{build}}tag:'${{CF_BRANCH}}-{{CF_REVISION}}'deploy-to-kubernetes:image:codefresh/cf-deploy-kubernetestag:latestworking-directory:${{initial-clone}}commands: -/cf-deploy-kubernetes deployment.ymlenvironment: -KUBECONTEXT=my-clusterg@my-staging -KUBERNETES_NAMESPACE=mynamespace
About
A Codefresh step to deploy to Kubernetes
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Languages
- Shell83.8%
- Dockerfile16.2%