Hello!
We are having some troubles, and after more than 2 days of struggling, I really have no idea how to figure it out.
We build the images, push them to the ECR registry. Each image will be tagged with the env and the build number.
The deployment/services files will be on github and have keys as “app: #{hello}” inside of them.
We want to use deploy yaml (or kubectl cli?) step.
Ideally, deployments will be triggered with each new master build of an image.
I hope it is all clear. We want something very continuous deployment
However, here are the problems we are facing:
- Copy the package on the Octopus server: the deployments/services files are on github and therefore Octopus gets it as NAME/NAME, get confused because of the / and can’t copy it on the server.
- Extract package in kubectl cli step: it works without variables. I have found the variables where the package is extracted and put it in my cli script. It doesn’t seem to be able to get the variables, even with variables substitution on that file on. ( [/file.yaml] doesn’t exist. Written in the script as kubectl apply -f $OctopusParameters[“Octopus.Action.Package[comm-tech-k8s].ExtractedPath”]/file.yaml)
This is for getting the files/folder on the server.
- Deploy raw yaml: I used “app: #{hello}” in the yaml file, it doesn’t seem to like it and it returns “kubectl apply -o json” returned invalid JSON" which it doesn’t normally (without variables). It is the step I would want to use.
- Kubectl cli: We have a PS script running kubectl apply -f file.yaml with variables substitution, it does replace variables, but it doesn’t get recognized by the certificate. I did that step in the server and it didn’t let me run the script because it “wasn’t digitally signed” (which I believe are lack of rights and I can’t authorize manually every file at every pull). Which made me think I needed to copy the folder on the server, which brings me back to the first 2 steps.
I am starting to get very confused, any help would be GREATLY appreciated!!!