Code Monkey home page Code Monkey logo

Comments (12)

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024 1

I updated the README file, under the Build section you'll see what I added, ....the starting point is for users to run 'make deploy'...they can follow that target to see what scripts are run and what Kube deployment JSON is used.....down stream a 'kubectl create -f deployment.json' command is eventually run after some environment setup is done.

from postgres-operator.

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024

thanks, I'll clear up this in the documentation today, I agree its vague at best.

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

Wow, this was a really quick response! Thanks for that.

I'm going to seem daft to you, I'm sure, but I have absolutely no experience with go so I'm still not able to follow your build instructions. Here's what I did:

  1. cd ~/projects/go/src && git clone https://github.com/CrunchyData/postgres-operator.git
  2. cd postgres-operator
  3. normally, I'd expect something like the standard ./configure && make but there's no configure (that's fine, this isn't a C project), so I run make. It says Nothing to be done for 'check-go-vars so I then run make deploy and I get this error:
$ make deploy
cd examples/operator && ./deploy.sh
CO_NAMESPACE not set, using default
CO_CMD not set, using kubectl
+++ dirname /Users/jar349/projects/go/src/postgres-operator/examples/operator/cleanup.sh
++ cd /Users/jar349/projects/go/src/postgres-operator/examples/operator
++ pwd
+ DIR=/Users/jar349/projects/go/src/postgres-operator/examples/operator
+ source /Users/jar349/projects/go/src/postgres-operator/examples/operator/setup.sh
++ '[' -z default ']'
++ '[' -z kubectl ']'
+ kubectl delete configmap operator-conf
Error from server (NotFound): configmaps "operator-conf" not found
+ kubectl --namespace=default delete deployment postgres-operator
Error from server (NotFound): deployments.extensions "postgres-operator" not found
+ sleep 10
error: error reading /conf/postgres-operator/backup-job.json: no such file or directory
./deploy.sh: line 28: envsubst: command not found
error: no objects passed to create
make: *** [deploy] Error 1

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

And in case I needed to run the operatorimage target first, that also has an exception.

$ make operatorimage
cd operator && go install postgres-operator.go
postgres-operator.go:20:2: cannot find package "github.com/Sirupsen/logrus" in any of:
	/Users/jar349/projects/go/src/postgres-operator/vendor/github.com/Sirupsen/logrus (vendor tree)
	/usr/local/Cellar/go/1.8.3/libexec/src/github.com/Sirupsen/logrus (from $GOROOT)
	/Users/jar349/projects/go/src/github.com/Sirupsen/logrus (from $GOPATH)
postgres-operator.go:25:2: cannot find package "github.com/crunchydata/postgres-operator/operator/server" in any of:
	/Users/jar349/projects/go/src/postgres-operator/vendor/github.com/crunchydata/postgres-operator/operator/server (vendor tree)
	/usr/local/Cellar/go/1.8.3/libexec/src/github.com/crunchydata/postgres-operator/operator/server (from $GOROOT)
	/Users/jar349/projects/go/src/github.com/crunchydata/postgres-operator/operator/server (from $GOPATH)
make: *** [operatorimage] Error 1

Because of my ignorance of go I don't know how to get package github.com/Sirupsen/logrus...

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

A google search tells me that I should try go get github.com/Sirupsen/logrus which seems to work for me, but then I get cannot find package "github.com/crunchydata/postgres-operator/operator/server". I can install that too, but isn't there a way to just download all the dependencies at once as part of the make target??

from postgres-operator.

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024

thanks for the testing this stuff out....I see several things I need to document from your feedback to make this easier to install....I'll work on another doc update and I see some missing dependencies there too from your logs which I'll document.

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

I've looked through the setup scripts in examples/operator and it seems to me like there's no need to pull the source code. I can foresee one day installing this like one installs nvm or homebrew, etc... via curl https://raw.githubusercontent.com/CrunchyData/postgres-operator/master/setup.sh | sh - where setup.sh downloads the files needed to create the configmaps, downloads the deployment.json template, runs a sed command to replace the placeholders, and runs kubectl create -f deployment.json.

This would turn the install instructions into:

  1. Run this script to install the server-side operator
  2. Download the binary release of the cli and put it in your path
  3. You're done!

from postgres-operator.

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024

I'm back to having users following the directions in the Build document...I think that is the best path for people to follow as it describes or attempts to describe the way to build/install....I'd be curious to your results if you follow from that document and see what happens. I've updated the docs to point users to the Build/Install doc from the README.

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

I can't follow the document in its entirety because I am trying to install it in a real k8s cluster in AWS created via kops.

That being said, I was able to pick my way around the documentation to correctly build the pgo cli and the docker images. The instructions for downloading the dependencies was very helpful!

The problem that I ran into was gettext's envsubst. I'm on a mac and although it provides the BSD gettext library, there's no envsubst command. So, I installed the gettext from homebrew, which says this:

This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD gettext library & some software gets confused if both are in the library path.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

Instead of putting it in my PATH via ~/.bash_profile, I simply ran: $ PATH=$PATH:/usr/local/opt/gettext/bin/ ./deploy.sh and got the following output:

CO_NAMESPACE not set, using default
CO_CMD not set, using kubectl
+++ dirname /Users/jar349/projects/go/src/github.com/crunchydata/postgres-operator/examples/operator/cleanup.sh
++ cd /Users/jar349/projects/go/src/github.com/crunchydata/postgres-operator/examples/operator
++ pwd
+ DIR=/Users/jar349/projects/go/src/github.com/crunchydata/postgres-operator/examples/operator
+ source /Users/jar349/projects/go/src/github.com/crunchydata/postgres-operator/examples/operator/setup.sh
++ '[' -z default ']'
++ '[' -z kubectl ']'
+ kubectl delete configmap operator-conf
Error from server (NotFound): configmaps "operator-conf" not found
+ kubectl --namespace=default delete deployment postgres-operator
Error from server (NotFound): deployments.extensions "postgres-operator" not found
+ sleep 10
error: error reading /conf/postgres-operator/backup-job.json: no such file or directory
deployment "postgres-operator" created

So the postgres-operator was deployed. But should I be concerned about this error?: error: error reading /conf/postgres-operator/backup-job.json: no such file or directory

from postgres-operator.

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024

that error is due to the COROOT environment variable not being set...that is the location where you have the source repo cloned to....on my system it is /home/jeffmc/odev/src/github.com/crunchydata/postgres-operator

that env var is specified in the build.asciidoc around line 149, you would add that typically into your .bashrc.

from postgres-operator.

jar349 avatar jar349 commented on May 13, 2024

You're totally right! My copy/paste of the env vars I thought I needed didn't include COROOT (I saw it as GOROOT and thought I didn't need it since my go env works). I'm sorry for that.

I put it in my ~/.bash_profile and re-ran the deploy.sh script and it worked without errors this time.

Thanks for helping me through this. I claim that the instructions are clear enough now for someone with limited go experience to set this up on their kubernetes cluster and I recommend that you close this issue. If I have further problems, I'll create a new issue.

Thanks again!

from postgres-operator.

jmccormick2001 avatar jmccormick2001 commented on May 13, 2024

thanks, outside testing helps me considerably.

from postgres-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.